I'm operating a number of solenoid valves to control irrigation.
The valves need 12v to operate but will then happily stay operated at 5v.
Only way I could think of was to use a rule with a one second timer to operate the valve and then switch to pwm at 512.
It works but also needs another gpio (4) operated by MQTT in order to generate an event (the switch input) to start the rule.
If I use the gpio the solenoid is connected to (2) it gets very confused. So here is the setup:
Rules:
On DummyIn#Switch=1 do
timerSet,1,1
gpio,2,1
endon
On DummyIn#Switch=0 do
pwm,2,0
endon
On Rules#Timer=1 do
pwm,2,512
endon
If I am being a bit thick and there is a much easier way to do this, please enlighten me!
Easier way to hold a solenoid on pwm?
Moderators: grovkillen, Stuntteam, TD-er
Re: Easier way to hold a solenoid on pwm?
Hi daxkamala
Not sure why you want to do this, do you have an issue supplying 12, current limitation issues?
The best is to supply your solenoid with 12V and keep it at 12V, unless you have a PWM solenoid that can do flow control, i personally do not see any advantage of trying to get complicated and switch between 12V and 5V to control the solenoid.
I use 12Vac solenoids on my irrigation system and the only thing i did was to use opto-coupler isolation to drive the solenoid via a Thyristor.
Not sure why you want to do this, do you have an issue supplying 12, current limitation issues?
The best is to supply your solenoid with 12V and keep it at 12V, unless you have a PWM solenoid that can do flow control, i personally do not see any advantage of trying to get complicated and switch between 12V and 5V to control the solenoid.
I use 12Vac solenoids on my irrigation system and the only thing i did was to use opto-coupler isolation to drive the solenoid via a Thyristor.
Who is online
Users browsing this forum: No registered users and 15 guests