0-10v LED driver control with Microcontroller - Page 1
Forum section: electronics / projects

author: g137556s
author_rank: Contributor
timestamp: December 22, 2012, 09:59:20 pm
content: Hello,I need a circuit to output 0-10v from a 5v PWM coming from an Atmel controller. First, I tried;That works but as the PWM duty cycle goes up the Analog out goes down and vice versa. But I need them to be the same because I am running a PWM device (fan) to go along with the analog 0-10v out (LED Controller).I also tried inverting with;But the Analog out is not linear and the controller voltage regulator gets pretty darn hot.I also tried a non-inverting op amp but I only have 5v, 12v and ground. Without a -12v the Op Amp won't go to 0v.I don't know what else to try. Any ideas?Thanks in advance,Robert

author: MikeK
author_rank: Super Contributor
timestamp: December 23, 2012, 12:30:37 am
content: Can you put a load resistor at the emitter (in the first circuit) and take your output across that?In the second circuit either the second transistor should be a PNP or the second transistor's base should be tied to the first transistor's emitter (with a emitter resistor)?

author: Psi
author_rank: Super Contributor
timestamp: December 23, 2012, 12:35:28 am
content: How much current do you need at 0-10V?Is it just a signal for a LED controller or does it actually run leds?Does the LED controller expect PWM input or an analog signal? If it expects pwm it probably wont need 10V, 5V may work fine.If your only pwm'ing at a slow speed, like 100Hz, you could probably invert it in software using a second pin.Have the hardware timer running as normal and your own logic just mirroring the inverse of that on another pin.

author: McMonster
author_rank: Frequent Contributor
timestamp: December 23, 2012, 02:22:36 am
content: Quote from: g137556s on December 22, 2012, 09:59:20 pmLook at the first transistor, when Arduino turns it on you have basically a short between 5V and GND, that's why regulator is hot. It would need a load resistor from the power rail to the collector.QuoteYou can try with a rail-to-rail op amp, they can work with a single supply.

author: UPI
author_rank: Regular Contributor
timestamp: December 23, 2012, 02:32:58 am
content: Take a look at these:http://www.bristolwatch.com/ele/transistor_drivers.htmhttp://cq.cx/interface.pl#12I believe this one will do what you want.

author: g137556s
author_rank: Contributor
timestamp: December 23, 2012, 01:53:16 pm
content: Quote from: MikeK on December 23, 2012, 12:30:37 amAh, that makes sense. I will try that.

author: g137556s
author_rank: Contributor
timestamp: December 23, 2012, 01:58:04 pm
content: Quote from: Psi on December 23, 2012, 12:35:28 amYes, it is just an analog signal for the LED. The PWM frequency is about 500Hz.

author: g137556s
author_rank: Contributor
timestamp: December 23, 2012, 02:05:46 pm
content: Quote from: McMonster on December 23, 2012, 02:22:36 amDoh, I also forgot the resistor between the transistors. So the 5v was shorted when power was applied. If the above does not work I will order an LM358 instead of the LM741 I tried.

author: g137556s
author_rank: Contributor
timestamp: December 23, 2012, 02:54:55 pm
content: Quote from: UPI on December 23, 2012, 02:32:58 amThanks for those links! The first one explained something that I didn't think about, which is that the load in this circuit cannot have a common ground. I will actually be running 4 of these circuits off the micro and all of them will be running from a common ground. So I need to switch the load to the emitter side to switch the positive voltage on and off. Otherwise, the drivers will always be on. So taking your idea and MikeK's I came up with this;I will breadboard this later today when I get time (wife has me doing other things). I need to watch the Afrotechmod videos on LTSpice and learn that so I can test circuits without breadboarding.

author: UPI
author_rank: Regular Contributor
timestamp: December 23, 2012, 04:37:03 pm
content: That does not appear to work on the simulator. Please checkout the simulation below.http://tinyurl.com/btrt84nMaybe this will work?http://tinyurl.com/c7jjxrfI used a BSS84 MOSFET and a MMBT3904 in my circuit to drive a buzzer with 12V.http://www.mouser.com/Search/ProductDetail.aspx?R=BSS84AK,215virtualkey66800000virtualkey771-BSS84AK215http://www.mouser.com/Search/ProductDetail.aspx?R=MMBT3904_D87Zvirtualkey51210000virtualkey512-MMBT3904D87Z

author: MikeK
author_rank: Super Contributor
timestamp: December 23, 2012, 05:05:03 pm
content: Oh, man...I just realized how stupid I was for suggesting he take the load from the NPN emitter. LOLRobert, just so you know why my suggestion was wrong: An NPN transistor is a low-side driver, meaning it switches the low side of a load. If we have a 10V load at its emitter then its base needs to be at 10.7V in order to switch on, which in this case is impossible and is why UPI's simulation did not work.

author: g137556s
author_rank: Contributor
timestamp: December 26, 2012, 03:02:08 pm
content: Yep, that didn't work. Oh well, all of these failure are learning experiences.I really liked the ease of use of the simulator shown earlier by UPI. I came up with the following and tested it on a breadboard and it works great!75% Duty Cylce PWM to Analog out