Jump to content
adambrum

arduino 0-10v ?

Recommended Posts

adambrum   

What be a good way of getting a 0-10v from an arduino, I have had a look on the arduino site and there are not two the same with all sorts of circuits. most use 5v filter and then double it which might be ok but no idea how many ma this will have left. From what i have seen if your a newby at electronics there not too helpfull.

 

What im after is 2 channels at about 30-40ma.

 

Im guessing some sort of filter then op-amp set up ?

 

Any help would be great

 

Thanks Adam

Share this post


Link to post
evilc66   

Easiest is to just switch a 10v voltage source with a PNP transistor.

Share this post


Link to post
adambrum   

Never thought of it like that

 

i take it you mean turn the 5v pwm tp 10v pwm and then smooth it ?

Share this post


Link to post

Evil is talking about using a transistor like a relay.

 

Use the 5v from the Arduino to drive the Base pin and control the transistor, then supply the collector ( And whatever your driving ) with 10v.

 

This will allow you to control your 0-10v. Just select a transistor big enough to cope with your mA requirements.

 

Connect like this, then place in your device to control where the relay is, then make your supply voltage to that device 10vdc.

 

FYS8BEJFQ2DZ0X6.MEDIUM.jpg

 

VR

Share this post


Link to post
adambrum   

I must be missing something, wont that circuit just give me a 10 volt pwm not a 0-10v analog signal.

 

I have knocked up a curcuit a with a tip120 to control 12v fan while the voltage did go from 0.6 to 11.6v i could here the pwm on the fan maybe a cap would smooth it out a bit ?

 

would the pwm cause any problems in controlling a meanwell eln-60d.

Edited by adambrum

Share this post


Link to post
I must be missing something, wont that circuit just give me a 10 volt pwm not a 0-10v analog signal.

 

I have knocked up a curcuit a with a tip120 to control 12v fan while the voltage did go from 0.6 to 11.6v i could here the pwm on the fan maybe a cap would smooth it out a bit ?

 

would the pwm cause any problems in controlling a meanwell eln-60d.

 

Sounds like all you need is an amplifier with a gain of 2.

 

As I recall, it should be pretty simple to build from an op-amp....

 

146px-Operational_amplifier_noninverting.svg.png

 

Set Rf = Rg, and you'll get a gain of 2.

 

You'll want an op-amp with an input voltage greater than 10V, of course, and I'd suggest using a small potentiometer for Rg - this will allow you to calibrate and maybe take the 0-5v signal from 0-12V, rather than just 0-10V. Make the potentiometer twice the resistance of Rg, so that they are equal at about the half-way point in the potentiometer.

 

I think.....thinking.....you want to have Rg and Rf fairly large, so maybe a 5M resistor and 10M pot? I can't recall for sure, but I think this will minimize wasted current....

Share this post


Link to post

Ive used a 100uF cap on my pwm to smooth out the fans and it works great.

 

Looking at theMeanwell datasheet it can accept any pwm signal between 100 - 3KHz without any problems.

Share this post


Link to post
adambrum   
Sounds like all you need is an amplifier with a gain of 2.

 

As I recall, it should be pretty simple to build from an op-amp....

 

146px-Operational_amplifier_noninverting.svg.png

 

Set Rf = Rg, and you'll get a gain of 2.

 

You'll want an op-amp with an input voltage greater than 10V, of course, and I'd suggest using a small potentiometer for Rg - this will allow you to calibrate and maybe take the 0-5v signal from 0-12V, rather than just 0-10V. Make the potentiometer twice the resistance of Rg, so that they are equal at about the half-way point in the potentiometer.

 

I think.....thinking.....you want to have Rg and Rf fairly large, so maybe a 5M resistor and 10M pot? I can't recall for sure, but I think this will minimize wasted current....

 

 

Any idea what happens to the current, if the voltage doubles surely the current will drop ?

 

Ive used a 100uF cap on my pwm to smooth out the fans and it works great.

 

Looking at theMeanwell datasheet it can accept any pwm signal between 100 - 3KHz without any problems.

 

I will give it a go later, The meanwell im using is an analog 0-10v there is 2 different types the other is 10v pwm which is almost impossable to get of in the uk and i all ready have the drivers

Share this post


Link to post
Any idea what happens to the current, if the voltage doubles surely the current will drop ?

 

Nope. The output current is independent of the voltage. That schematic omits the power input pins for clarity.

 

opamp_block.jpg

 

In the circuit provided above, the input impedance of the op-amp will be close to infinite, so you need not worry about the input current - it will be very nearly zero. The output current will be provided through the power pin(s) not shown in the original diagram, and is not limited by the input current on the input pins.

 

You're confusing the voltage/current relationship with what happens in a transformer. This is an amplifier - it's meant to boost power. :)

Share this post


Link to post
adambrum   

Ah i see now,

 

So what op amp would in need there seem to be thousands of them and i have no idea what characteristics im looking for. I know its a bit of spoon feeding but any chance of a part No.

Share this post


Link to post
Ah i see now,

 

So what op amp would in need there seem to be thousands of them and i have no idea what characteristics im looking for. I know its a bit of spoon feeding but any chance of a part No.

 

Op-amps are pretty generic, so I'd just go with the cheapest one with sufficient input/output voltage and output current, in a package that you feel comfortable soldering. Obviously, you should look for a through-hole if possible, but surface mount soldering is within the abilities of an average home DIY'er. Tutorials are available online. You'd be surprised at what you can solder when you've seen the "tricks".

 

I took a look through the digikey catalog, and it seems they have nothing in stock to meet your needs. I took another look at fairchild semiconductors (they used to give free samples :D), and found nothing with sufficient output current. Then it hit me.

 

The Fairchild LM324A is a quad op-amp on an 14-pin DIP. Each op-amp has an output current of about 40mA. Clearly not enough. However, lets say you buy two chips, so we have eight amps in parallel. The total current output would then be about 320mA - enough to drive a typical DC fan.

 

All you'd have to do is tie all of the corresponding terminals together, then treat it as one op-amp with your external resistor / potentiometer. Pretty sure that'd work.

 

 

Another option is to move to a BJT or mosfet amplifier, but that's a more complicated design. Before going there, the PWM might be an option to reconsider.

Share this post


Link to post
adambrum   

Thanks for that, 40ma is fine and a bonus that it can do 4 channels.

 

Just one last question, is the lm324a the same as a lm324n from what i can see there the same maybe its just a material difference.

 

This is the link to the part i can get from a uk supplier.lm324m.

 

The main use of this is backup for lighting just in case my profilux controller dies, While controllers are great they can all ways break down at the worst time.

Share this post


Link to post

Looks basically the same to me.

 

I didn't see the current requirements in the first post. Looking good then.

Share this post


Link to post
adambrum   
Looks basically the same to me.

 

I didn't see the current requirements in the first post. Looking good then.

 

Got the bits today knocked it up on a bread board and it works a treat, i tied all the op-amps together and ran a small fan off it just for fun, the fan pulled about 45ma at 10v so no problems there. I am getting about 0.4v on the meter when i switch to ac but im sure i can get that lower with a bigger cap.

 

i will get it all tidy and post some pics later.

 

Thanks for all your help guys i now have 0-10v from an arduino

Share this post


Link to post
Got the bits today knocked it up on a bread board and it works a treat, i tied all the op-amps together and ran a small fan off it just for fun, the fan pulled about 45ma at 10v so no problems there. I am getting about 0.4v on the meter when i switch to ac but im sure i can get that lower with a bigger cap.

 

i will get it all tidy and post some pics later.

 

Thanks for all your help guys i now have 0-10v from an arduino

 

Success! Congratulations!

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×