# using solenoid driver board with Uno

Thank you for reading this. I have limited electronic expertise please bear with me:

I have a proportional air solenoid that I hoped to be controlled by my Uno. The driver board I purchased with the solenoid takes an input signal of between 0-5v, 4-20 milliamps which sounded perfect- just what the UNO outputs safely. This Uno control input to the solenoid board gives an output in current of 0-3 watts when the board has a supply voltage hooked up of 24V. That varying current controls the solenoid proportionally. Sounds good too. The problem is that the 24V supply voltage and 5V Uno input signal are suppose to share the same ground. The Uno receives power via my USB cable for serial communication from my Laptop. I have no idea what to do!!! I am afraid that if I share a 24V power source and UNO’s ground I will smoke my laptop through the USB cable. Any suggestions would be so appreciated!!! Thank you.

There is no problem sharing grounds.

The Arduino puts-out PWM which can approximate analog and it will probably work, but it doesn't put-out true analog. For example, it can't put-out 2.5VDC, but it can put-out 5V PWM at a 50% duty cycle which is an average of 2.5V.

The driver board I purchased with the solenoid takes an input signal of between 0-5v, 4-20 milliamps

No.
How do you get 4mA when the input is 0V?

What you have there is a current loop input requirement, you can't just connect it up to an Arduino pin you need a current loop driver.

Thanks guys. I dont understand the part where the signal input required is 0V but 4ma. good call. How can you have 0 volts but 4ma???? I will check with the company on that. Also maybe I can use a low pass filter with the arduino to give me true analog volts out. There is a great tutorial for it here:

http://provideyourown.com/2011/analogwrite-convert-pwm-to-voltage/

Still worried about sharing the arduino/laptop ground with an independant 24V power supply...

How can you have 0 volts but 4ma?

You can't, that is what tells me that it is the spec of a current loop not a simple voltage output. With a current loop you always have 4mA flowing and that indicates to the receiver do nothing. With 20mA flowing that tells the receiver to turn on fully. That doesn't mean that the solenoid is going to be powered by 20mA, it is that it is being controlled by 20mA. See this
4-20-ma-current-loops

till worried about sharing the arduino/laptop ground with an independant 24V power supply...

Don't that is how electronics works, it won't work without doing this, see:-
http://www.thebox.myzen.co.uk/Tutorial/Power_Supplies.html

I would think the board would take an input of 0 to 5 volts OR 4 to 20 mA for 0 to 100% output, that’s pretty common in industrial equipment.

So it is an control input of 0-5 Volts OR 2 to 20ma. So.... How about a power regulator stepping down the 24 v power for the solenoid to 5v then using a digital pot controlled by the Uno for the 0-5v input signal???

house231:
So.... How about a power regulator stepping down the 24 v power for the solenoid to 5v then using a digital pot controlled by the Uno for the 0-5v input signal???

No, don't be silly.
You need 24V to move the solenoid, you need a current loop to control it. Just make a current loop interface for the Arduino's PWM output pin and use that.

Mike, I think I got it or I am really lost. Thank you for your awesome tutorials and patience. Are you talking about just powering the solenoid directly via the dual power supply diagram using a TIP120 transistor and a 24v power source?

Well that is the way you would power a normal solenoid yes. But you haven’t got one of those, you have got one that you connect to the 24V power and then you control it with a tiny signal, the current loop signal.

These interfaces are designed for robust industrial control over long wires, they are not simple. An input of 0V results in a current of 4mA, an input of 5V results in a current of 20mA. This current is constant irrespective of the length of wire. What happens is that the voltage on the output keeps on increasing until 20mA is reached.

Now if you want to control this solenoid proportionally, you need an analogue output from the Arduino. Unfortunately the Arduino does not have an analogue output but has the next best thing a PWM output. If you don’t know what that means read this . You need to put an RC filter on the output to give a varying voltage. Then you need to feed that varying voltage into a current loop driver. There are ICs that do this, this is one:- http://www.ti.com/lit/ds/sbos344c/sbos344c.pdf
Or you can make your own, this was a circuit in a thread some time ago:-

awesome Mike