controlling a solenoid valve using a pir

Thread Starter

drewex81

Joined Oct 3, 2023
6
Hello all, i got a simple project i am trying to setup.
Using PIR sensor SR501 i want to turn on a 24volt solenoid valve. I need this to work off a 12 or 24 volt adapter. I need is when the sensor is triggered turn the valve on for a period of time and after it turns off waits a little time before reactivating the sensor. The timing doesn't have to precise but it should be adjustable to prevent triggering the sensor by accident. I want to set this up without an Arduino. Can anyone help. Started to use flux.ai recently which could be place to share the circuit. Thanks
1696345518750.png 1696345527108.png
 

ericgibbs

Joined Jan 29, 2010
18,234
Hi Drew,
Welcome to AAC,
As you may know, the PIR module works from 4.5v through 20v supply and outputs a +3V voltage when the PIR is activated.

This means that you require a transistor driver for your Solenoid.
What DC voltage supplies do you have?
What are your timing period requirements?
E
EG57_ 1236.png
 

Thread Starter

drewex81

Joined Oct 3, 2023
6
Thank you for the quick reply, I can really use any power source i will buy power adapter for this purpose so it can be a 24V 1A for the solenoid or any low dc voltage that would make the circuit work. timing requirements are few seconds of run time whatever the pir sensor activates for since they time adjustment on it as i understand it. re activation time needs to maybe needs to be up to 10 seconds im guessing since i want to stop the water flow from triggering the sensor again.

The project is to build a simple sprinkler system to deter unwanted pests that wonder into the garden with a dc power supply so i can pug it in and forget it. Pir sensor will get triggered by the passing by pest and start the sprinkler after few seconds of run time stops the water and resets.

basically building this on the cheap and want to do some customization. https://a.co/d/3jc8cXh
 

ericgibbs

Joined Jan 29, 2010
18,234
Hi.
If you buy a 24Vdc supply for the solenoid, you will need a +12V regulator to power the PIR.

This PDF explains the set-up for the delay time, check to see if it covers your period times.
E

Update: what is the current rating of your 24Vdc solenoid?
 

Attachments

MaxHeadRoom

Joined Jul 18, 2013
28,046
When electronics is involved you will also require the customary reverse-diode across the relay coil and solenoid, e.g. 1n4007 etc.
 

ericgibbs

Joined Jan 29, 2010
18,234
Hi drew,
You do not need a microcontroller or a 555, the Timer On setting is from a couple of Seconds up to a few 10's of Seconds.
Let me know the current required for the solenoid and I will post a circuit diagram

E
 

ericgibbs

Joined Jan 29, 2010
18,234
Hi sgh,
The re-trig delay period can be modified on the PIR module to give a longer period, also the output pin has 1k in series.
In case you do not have this PDF, attached a copy for you.
E
 

Attachments

sghioto

Joined Dec 31, 2017
5,100
The re-trig delay period can be modified on the PIR module to give a longer period, also the output pin has 1k in series.
I know about the 1K but did not know about the retrigger timer. Can it be set as long as 10 seconds using a 1uf for C7 and 416K resistor for R9?
 

ntzovanis

Joined Oct 3, 2023
1
Hello all, i got a simple project i am trying to setup.
Using PIR sensor SR501 i want to turn on a 24volt solenoid valve. I need this to work off a 12 or 24 volt adapter. I need is when the sensor is triggered turn the valve on for a period of time and after it turns off waits a little time before reactivating the sensor. The timing doesn't have to precise but it should be adjustable to prevent triggering the sensor by accident. I want to set this up without an Arduino. Can anyone help. Started to use flux.ai recently which could be place to share the circuit. Thanks
View attachment 304089 View attachment 304090
You should be able to do it with a 555 timer:


  1. SR501 PIR Sensor Setup: The SR501 PIR sensor has three pins: VCC, OUT, and GND. Connect VCC to your power source (12V or 24V as per your adapter), GND to the common ground, and the OUT pin will provide a high signal when motion is detected.
  2. 555 Timer Setup: Use the 555 Timer IC in monostable mode. The trigger input (pin 2) will connect to the OUT pin of the SR501 sensor. When the PIR sensor detects motion, it sends a high signal which triggers the 555 timer. The duration for which the output (pin 3) of the 555 timer remains high (and thus the solenoid valve remains on) can be adjusted by changing the resistance and capacitance values connected to the 555 timer (pins 7 and 6). For example, a 1 megaohm resistor and a 1uF capacitor will give a delay of roughly 1 second.
  3. MOSFET Setup: Connect the output (pin 3) of the 555 timer to the gate of the N-channel MOSFET through a 10k ohm resistor. The solenoid's one end connects to the 24V and the other end to the drain of the MOSFET. The source of the MOSFET goes to ground. Also, connect a diode in parallel with the solenoid, with the anode to the MOSFET side and cathode to the 24V side, to protect the circuit from back EMF when the solenoid turns off.
 

ericgibbs

Joined Jan 29, 2010
18,234
HI @sghioto
Checking the basic PIR PCB layout for the inhibit period, before re-arming is approx 5 to 8 Secs, with the existing R/C values.

The TS stated:
I need is when the sensor is triggered turn the valve on for a period of time and after it turns off waits a little time before reactivating the sensor. The timing doesn't have to precise but it should be adjustable to prevent triggering the sensor by accident.

This suggests to me that 5 to 8 Sec 'waits a little time' is sufficient.
We know the Timer adjust pot can be set from a couple of Seconds up to a few 10's of Seconds., which covers the 'on for a Period of Time'

The Sensitivity Pot sets the detection level at which the PIR is triggered On, so I believe the basic PIR circuit should be OK and the TS should try it out.

E

Update:
The Inhibit Period, adding actual capacitors in parallel with C7
basic C = 8 Secs
+100nF = 15 Secs
+200nF = 21 Secs
BTW: R9 in the drawing says 15K, but it is actually a 105 ie: 1meg Ohm

PIR_PCB1.png
 
Last edited:

Thread Starter

drewex81

Joined Oct 3, 2023
6
Hi @drewex81
Are you able to get the components and build this circuit?

The components inside the dotted line box is the PIR Module.
E
This is exactly what i was looking for thank you. simple and great setup. I was trying to keep everything simple. I am waiting for the solenoid valve to come and ill order the parts today in 1 to 2 weeks or so I should have this ready to test. I will write back when its done or if i have questions.
 

sghioto

Joined Dec 31, 2017
5,100
Update:
The Inhibit Period, adding actual capacitors in parallel with C7
basic C = 8 Secs
+100nF = 15 Secs
+200nF = 21 Secs
BTW: R9 in the drawing says 15K, but it is actually a 105 ie: 1meg Ohm
How do you know it's 1meg, do you have one of those modules? Is my math wrong as from the formula 24 x R9(1M) x C7 (10nf) comes out to 0.24 seconds.
 

sghioto

Joined Dec 31, 2017
5,100
After further study I see several schematics for the SR501 showing a 1M and 100nf cap for the inhibit timer TI. Then the on board timing should be 2.4 seconds. Adding a 220nf cap should give appx 8 seconds.
I imagine it will actually depend on the SR501 module the TS has on hand.
 
Last edited:

ericgibbs

Joined Jan 29, 2010
18,234
How do you know it's 1meg, do you have one of those modules?
Hi sg,
I have a number of those modules, they have 105 printed on that r(, also the C7 cap is not 10nf, But would guess its about 1uf or 2uF.

E
EG57_ 1243.png
 
Last edited:

Thread Starter

drewex81

Joined Oct 3, 2023
6
drew, have you tried testing the SR501 as is to see what the inhibit timing is?
i have not, just ordering the components now its all in project face right now. I might have to mod this if the delay isn't enough on the reset time. not sure how much of the water will be out when the solenoid is complete. I will do a short recording when its all done.
 
Top