Jump to content


Photo

arduino 0-10v ?


  • Please log in to reply
14 replies to this topic

#1
adambrum

adambrum

    Nano Reefer

  • Members
  • 40 posts
  • Joined 22 Sep 2009

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

#2
evilc66

evilc66

    LED Gawd

  • Premium Members
  • 17,843 posts
  • Joined 26 Aug 2007
  • Shelby Twp. Michigan
Easiest is to just switch a 10v voltage source with a PNP transistor.

#3
adambrum

adambrum

    Nano Reefer

  • Members
  • 40 posts
  • Joined 22 Sep 2009
Never thought of it like that

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

#4
Vancouver Reefer

Vancouver Reefer

    Nano Reefer

  • Members
  • 213 posts
  • Joined 25 Nov 2008
  • Kenora, ON
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.

Posted Image

VR

3295388379_d9e601fa5f.jpg

 

 

 

 

 

 

 


The Ultimate DIY Aquarium Controller of the 21st Century!!!


LED's, PH, Salinity, Clock, LCD, ATO, Auto Water Changer, Variable Speed Cooling Fan Control and lots, lots more......



View My Build Here........

 

 

aquarium2031.png

 


#5
adambrum

adambrum

    Nano Reefer

  • Members
  • 40 posts
  • Joined 22 Sep 2009
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, 11 December 2009 - 01:56 PM.


#6
neanderthalman

neanderthalman

    Two hands working can do more than a thousand clasped in prayer.

  • Members
  • 10,943 posts
  • Joined 11 Mar 2005
  • Pickering, ON

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....

Posted Image

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....
Posted Image
^^New Coral 2010-03-27^^

Posted Image

I looked down her shirt. *shrug* I ain't gay or nothin', but it's boobs. It's what you do.


#7
Vancouver Reefer

Vancouver Reefer

    Nano Reefer

  • Members
  • 213 posts
  • Joined 25 Nov 2008
  • Kenora, ON
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.

3295388379_d9e601fa5f.jpg

 

 

 

 

 

 

 


The Ultimate DIY Aquarium Controller of the 21st Century!!!


LED's, PH, Salinity, Clock, LCD, ATO, Auto Water Changer, Variable Speed Cooling Fan Control and lots, lots more......



View My Build Here........

 

 

aquarium2031.png

 


#8
adambrum

adambrum

    Nano Reefer

  • Members
  • 40 posts
  • Joined 22 Sep 2009

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....

Posted Image

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

#9
neanderthalman

neanderthalman

    Two hands working can do more than a thousand clasped in prayer.

  • Members
  • 10,943 posts
  • Joined 11 Mar 2005
  • Pickering, ON

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.

Posted Image

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. :)
Posted Image
^^New Coral 2010-03-27^^

Posted Image

I looked down her shirt. *shrug* I ain't gay or nothin', but it's boobs. It's what you do.


#10
adambrum

adambrum

    Nano Reefer

  • Members
  • 40 posts
  • Joined 22 Sep 2009
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.

#11
neanderthalman

neanderthalman

    Two hands working can do more than a thousand clasped in prayer.

  • Members
  • 10,943 posts
  • Joined 11 Mar 2005
  • Pickering, ON

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.
Posted Image
^^New Coral 2010-03-27^^

Posted Image

I looked down her shirt. *shrug* I ain't gay or nothin', but it's boobs. It's what you do.


#12
adambrum

adambrum

    Nano Reefer

  • Members
  • 40 posts
  • Joined 22 Sep 2009
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.

#13
neanderthalman

neanderthalman

    Two hands working can do more than a thousand clasped in prayer.

  • Members
  • 10,943 posts
  • Joined 11 Mar 2005
  • Pickering, ON
Looks basically the same to me.

I didn't see the current requirements in the first post. Looking good then.
Posted Image
^^New Coral 2010-03-27^^

Posted Image

I looked down her shirt. *shrug* I ain't gay or nothin', but it's boobs. It's what you do.


#14
adambrum

adambrum

    Nano Reefer

  • Members
  • 40 posts
  • Joined 22 Sep 2009

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

#15
neanderthalman

neanderthalman

    Two hands working can do more than a thousand clasped in prayer.

  • Members
  • 10,943 posts
  • Joined 11 Mar 2005
  • Pickering, ON

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!
Posted Image
^^New Coral 2010-03-27^^

Posted Image

I looked down her shirt. *shrug* I ain't gay or nothin', but it's boobs. It's what you do.