Author Options:

Powering a 24 Volt sensor with an arduino? Answered

 Ok here is the issue. Right now I am designing a rain water collection system by having my down spout drain into a 55 gallon plastic drum. I want to cap the drum to avoid spillage. The problem is what happens when the drum is full and the rain is still coming in. I know there are plenty of mechanical ways to solve this problem but I wanna have fun with an Arduino I have laying around. What I am thinking is run a pipe out of the bottom that has an irrigation valve installed (for anyone who is reading that that isn't aware of what an irrigation valve is, it is and inexpensive solenoid valve that is used for unground sprinkler systems). I figure I will add a water level sensor to the inside of the barrel and then hook the sensor and valve together via my Arduino. From there type a little code and violaa I have an over fill protection device!

Here is the problem: An irrigation valve is 24v and the Arduino is 6volts. I know I can get the 24 volts from a power supply down to 6volts via resister, but then how would power the valve? My goal is to NOT have to buy a 12volt 1" solenoid (i didn't want to spend a lot of money on this project). I am not sure if there is a solution to this problem, but being a very green/inexperienced electronics hobbyist figured could hurt to ask.




Best Answer 4 years ago

All you need is a transistor, a resistor, and a diode.

Try this for ideas.



4 years ago

A simple overflow back to the drain would be sooo much easier....
Valves and electronics fail, same for power supplies, a simple pipe won't ;)
And with the max. voltage the Arduino can handle you need a boost converter for the valve and of course a suitable transistor to switch it on.
Although some people might just use a float connected to a drain valve on huge tanks.
Guess I am just too old and fail to understand why everything need an Arduino these days.
Still waitin for an Arduino light switch though ;)


Answer 4 years ago


You are 100% right!!! But how cool is it to make it using motors and sensor hahaha:-)


4 years ago

thanks Stevastrouk!