Author Topic: 0-10v LED driver control with Microcontroller  (Read 18912 times)

0 Members and 1 Guest are viewing this topic.

Offline g137556s

  • Contributor
  • Posts: 12
0-10v LED driver control with Microcontroller
« on: December 22, 2012, 09:59:20 pm »
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.   :palm:

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

 :-//  I don't know what else to try.  Any ideas?

Thanks in advance,
Robert
 

Offline MikeK

  • Frequent Contributor
  • **
  • Posts: 577
  • Country: us
Re: 0-10v LED driver control with Microcontroller
« Reply #1 on: December 23, 2012, 12:30:37 am »
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)?
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 7561
  • Country: nz
Re: 0-10v LED driver control with Microcontroller
« Reply #2 on: December 23, 2012, 12:35:28 am »
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.

« Last Edit: December 23, 2012, 12:53:35 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline McMonster

  • Frequent Contributor
  • **
  • Posts: 417
  • Country: pl
    • McMonster's blog
Re: 0-10v LED driver control with Microcontroller
« Reply #3 on: December 23, 2012, 02:22:36 am »
But the Analog out is not linear and the controller voltage regulator gets pretty darn hot.   :palm:
Look 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.

Quote
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.   |O
You can try with a rail-to-rail op amp, they can work with a single supply.
 

Offline UPI

  • Regular Contributor
  • *
  • Posts: 139
  • Country: us
Re: 0-10v LED driver control with Microcontroller
« Reply #4 on: December 23, 2012, 02:32:58 am »
Take a look at these:

http://www.bristolwatch.com/ele/transistor_drivers.htm

http://cq.cx/interface.pl#12

I believe this one will do what you want.

 

Offline g137556s

  • Contributor
  • Posts: 12
Re: 0-10v LED driver control with Microcontroller
« Reply #5 on: December 23, 2012, 01:53:16 pm »
Can you put a load resistor at the emitter (in the first circuit) and take your output across that?

Ah, that makes sense.  I will try that.
 

Offline g137556s

  • Contributor
  • Posts: 12
Re: 0-10v LED driver control with Microcontroller
« Reply #6 on: December 23, 2012, 01:58:04 pm »
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.

Yes, it is just an analog signal for the LED.  The PWM frequency is about 500Hz.
 

Offline g137556s

  • Contributor
  • Posts: 12
Re: 0-10v LED driver control with Microcontroller
« Reply #7 on: December 23, 2012, 02:05:46 pm »
Look 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.
You can try with a rail-to-rail op amp, they can work with a single supply.

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

Offline g137556s

  • Contributor
  • Posts: 12
Re: 0-10v LED driver control with Microcontroller
« Reply #8 on: December 23, 2012, 02:54:55 pm »
Take a look at these:
http://www.bristolwatch.com/ele/transistor_drivers.htm
http://cq.cx/interface.pl#12
I believe this one will do what you want.


Thanks 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. 
« Last Edit: December 23, 2012, 02:56:55 pm by g137556s »
 

Offline UPI

  • Regular Contributor
  • *
  • Posts: 139
  • Country: us
Re: 0-10v LED driver control with Microcontroller
« Reply #9 on: December 23, 2012, 04:37:03 pm »
That does not appear to work on the simulator. Please checkout the simulation below.
http://tinyurl.com/btrt84n

Maybe this will work?
http://tinyurl.com/c7jjxrf

I 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-BSS84AK215
http://www.mouser.com/Search/ProductDetail.aspx?R=MMBT3904_D87Zvirtualkey51210000virtualkey512-MMBT3904D87Z

 

Offline MikeK

  • Frequent Contributor
  • **
  • Posts: 577
  • Country: us
Re: 0-10v LED driver control with Microcontroller
« Reply #10 on: December 23, 2012, 05:05:03 pm »
Oh, man...I just realized how stupid I was for suggesting he take the load from the NPN emitter. LOL

Robert, 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.
« Last Edit: December 23, 2012, 05:10:00 pm by MikeK »
 

Offline g137556s

  • Contributor
  • Posts: 12
Re: 0-10v LED driver control with Microcontroller
« Reply #11 on: December 26, 2012, 03:02:08 pm »
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
« Last Edit: December 26, 2012, 06:18:25 pm by g137556s »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf