Introduction: DIY Solenoid Valve to Servo Valve Conversion
I wanted to build a garden watering system.
To do so, I need a source of power. I don't like putting AC voltage close to water source, so I decided to go solar and low-voltage only. Soon I encountered major issue - to turn the water on and off, I needed valve.
However, the only reasonably priced valves were 230V AC and 12V DC.
I thought I will use a step-up DC converter to get the battery voltage to 12V and run the valve.
That was a wrong assumption.
As the DC magnet coil has resistance of only 37 ohms, the required current is 300mA. That does not sound like much, but that's at 12V. Meaning the total power requirement of the valve is 3.6W. I tried to lower the input voltage - that also decreased the current and lowered the total power requirement, but it was unstable - the coil failed to pick the needle valve 30-50% of the times. Unusable for real-life application. On top, 3.6W out of 1 LiPo battery means 1A current. Adding 20% for losses of DC-to-DC conversion, I would need 1.2A of current from the battery.
Running 2 valves, each for 20-30 minutes, I would drain full 2000mAh battery no problem.
I had to look for another solution - something that would not require constant power to stay open. I found servo-valves - where a servo drive is able to open and close a ball valve. Great idea, low power consumption (5V, 50mA, 5 seconds to fully open or close). But the cheapest was $25 and shipping would take a month.
Out of desperation, I decided to open up the solenoid and look into it - can I somehow rewire it to work from 3.6V? Can I do something else?
Very soon I found out that any re-wiring was nonsense - I would have to feed same amount of power, maybe without the 20% conversion losses, but otherwise I would not gain anything.
I dismantled the valve completely and realized it only needs magnetic field to hold the needle up during operation.
I have a few rear-earth magnets - so I took 2 and realized I am able to control the needle!
The force, required to pull the magnets away from the pin was quite high - I had to use serious force. So I continued the experiments and realized that when I do it perpendicular to the needle, I need a lot of force. But when I remove the magnet in parallel to the needle upwards, I can do it with much less force.
That was an usable idea and it worked!
Step 1: Disassembling the Valve
I've done the same thing with 12V DC version and 220V AC version - the physical HW is the same, the difference is just the coil wiring.
First, take the valve and remove the 4 screws in the corners.
Keep the screws, they are required to hold the needle-pin and seal the valve properly.
Step 2: Removing the Coil
To remove the coil, we will need to disassemble the whole mechanism - we need to keep the bottom part to hold the seal and remove the coil and upper holder to allow the access for magnet.
Use strong pliers to squish the pins holding the upper assembly. I needed significant force to do so. You need to squish back all 4 pins on all sides.
Once done, push a screwdriver in-between the base and the upper coil holder. Push a bit if needed. Once a gap is opened and the screwdriver slides into the hole, just turn it - it will "pop" the upper assembly away.
Repeat the same step on the opposite side.
Step 3: Sealing Back the Base of the Valve
Once done, assemble back the valve using the bottom part of the coil and the 4 screws from initial step.
If you don't need it, you can throw the coil and the upper holder away - it's not need it for the final product.
Measure, how many magnets you need to "pull" the pin. I suggest to do the test with the water-lines connected - you need more magnetic force when there is a water pressure.
Step 4: Prepare the Servo Base
In order to mount the servo, it needs to be 4-5mm higher than the base of the valve and also a bit further from the needle pin to make sure the magnets will fit between the servo handle and the pin.
To make a base plate for such distance, I used old 3D printed piece of plastic, but you can use anything - piece of wood, plastic or non-ferrous metal - just drill 11mm hole for the pin and slide it on top of the valve as seen on the picture.
To fix it in place, I used hot glue - not pretty, but works OK.
Step 5: Prepare the Servo
Get the "9g" servo - mine came with the handle assembled.
To make sure it sticks to the base, remove the sticker from the glued side.
Replace the handle by the single-sided one.
Use serious amount of hot glue to glue the magnet to place - make sure you still have access to the screw on the servo handle.
Step 6: Glue the Servo to the Valve
Using a lot of hot glue again, glue the servo to the valve.
Make sure there is sufficient gap for all the needed magnets - I used just one to glue it so it does not "fall down" under it's own weight, but you can use all of the needed magnets to do so.
Final step - add the final amount of magnets and verify there is still at least some gap between the pins and the magnets - the servo is not strong enough to overcome the force of friction and the magnetic attraction.
Step 7: Connect Servo Controller and Verify
I used the ESP8266 with Arduino IDE to drive the servo.
As I am testing the setup with 1 LiPo battery, I used it to power the setup. The 3.7V of the battery is not sufficient to drive the servo, so I used the step-up DC-to-DC converter to step the voltage to cca. 5.5V.
Even when the servo was not used, the comparator in it used 5mA of current - so I used an old Arduino MOSFET module to turn it on and off when operated - this is optional of course and only serves as a power saving feature.
Using trial-and-error I set the servo angles - 95 degrees to turn the valve on and 40 degrees to turn it off completely.
Step 8: Sample Code
This is just a demo code - it only moves the servo every 2 seconds to on and off position.
The servo signal is connected to PIN 2, the MOSFET is connected to PIN 4 of the ESP.
We have a be nice policy.
Please be positive and constructive.