Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: Flammable on March 11, 2011, 11:09:04 AM

Title: Building wake-up light (op-amp question)
Post by: Flammable on March 11, 2011, 11:09:04 AM
Hi,

I'm building my own wake-up light using a 12V LED that I will control the voltage for. I have a microcontroller with a DAC that outputs about 4,5V(5V ideal) at maximum.
My plan is to use an op-amp to amplify the signal to about 12 V. The input signal will be a 490 Hz PWM signal. Will this work? I assume that the LED load will draw current from the op-amp supply, not the input signal. The LED needs 375mA at peak. What kind of op-amp am I looking for?

Arnis
Title: Re: Building wake-up light (op-amp question)
Post by: rbtying on March 11, 2011, 04:34:29 PM
It'd be easier to just use a logic-level MOSFET or a similar transistor setup to switch the LED on and off with some PWM duty cycle (duty cycle is proportional to average voltage).  It's not a true DAC, but works well for LED brightness, and MOSFETs usually can source or sink a significant amount of current. 
Title: Re: Building wake-up light (op-amp question)
Post by: waltr on March 11, 2011, 06:39:01 PM
Also: I am not aware of any op-amp that can output 375mA.
rbtying's method is a good way to go since you are already using a processor and doesn't need a DAC.
Title: Re: Building wake-up light (op-amp question)
Post by: Soeren on March 12, 2011, 12:15:55 AM
Hi,

Also: I am not aware of any op-amp that can output 375mA.
Unfortunately, the old LM12 (a 150W op-amp) is declared obsolete, but LM3886 (http://www.national.com/mpf/LM/LM3886.html#Overview) should be able to handle itself pretty fine with its 11.5A output rating ;D
(They do come in more moderate powers as well, like eg. 1A, 4A or 6A output)

Also... Many of the so-called Audio Amps, like LM386, TDA2003, whatever their names, are in fact just power op-amps and even those that aren't built straight to spec can usually be convinced anyway.

A lot of projects can be simplified, when you don't need to build power drivers for an op-amp, and they're extremely good for lab supplies as well (although the price is a little steep, but then you save both time and complexity).


That aside... PWM is the only way to go, if it's a white LED, as the color temperature will shift (very much indeed) if dimmed or "un-dimmed" by voltage change. (A few hundred Hz upward and even the fastest eye won't see the flashes).

BTW. What is the correct term for the opposite of dimming/fading?
Title: Re: Building wake-up light (op-amp question)
Post by: Flammable on March 12, 2011, 05:48:13 AM
Thanks for replies, I realize that using a transistor will probably be the best approach.
Title: Building wake-up light transistor question
Post by: Flammable on March 19, 2011, 12:29:06 PM
Hi again,

Would this circuit and these components do the job for me??

The circuit:
(http://www.kpsec.freeuk.com/images/trswinpn.gif)
BC 337-25 NPN transistor datasheet: https://www1.elfa.se/data1/wwwroot/assets/datasheets/ceON-BC337_data_e.pdf
 (https://www1.elfa.se/data1/wwwroot/assets/datasheets/ceON-BC337_data_e.pdf)

The LED lamp (RL) has a max current of about 375 mA (12 V and 4,5W).
The arduino has a max output current of 40 mA.

The calculations that I base my choice of transistor on:

hFE(min) > 5*(IC/IArd.max) = 5*(375/40) = 46.875 about 50

==> hFE(min) > 50

RB = (VIC * hFE)/(5*IC) = 60/(375*10-3) = 160 ohm

I'm a bit unsure about the hFE value because the datasheet displayed many values....
Title: Re: Building wake-up light transistor question
Post by: Soeren on March 19, 2011, 08:32:12 PM
Hi,

Would this circuit and these components do the job for me??
More or less, yes.


The LED lamp (RL) has a max current of about 375 mA (12 V and 4,5W).
The arduino has a max output current of 40 mA.
I wouldn't load an Arduino with 40mA, but even more important is whether you're sure your LED is 4.5W @ 12V?
While it is possible, it's a rather unusual voltage for an LED, so if in doubt, post a link to the datasheet or what hard data you may have.


The calculations that I base my choice of transistor on:

hFE(min) > 5*(IC/IArd.max) = 5*(375/40) = 46.875 about 50

==> hFE(min) > 50

RB = (VIC * hFE)/(5*IC) = 60/(375*10-3) = 160 ohm

I'm a bit unsure about the hFE value because the datasheet displayed many values....
A transistor doesn't have a single hFE, as it depends on the current through it and the binning. At 375mA, you should calculate with say 150 max. and to be a bit conservative, use 100.

For 375mA, you then need (375/100=) 3.75mA base current
To be on the safe side here as well, shoot for eg. 5mA

Assuming a Vdd of +5V, the voltage drop over the base resistor will be: (5-0.7=)  4.3V
The base resistor should thus be: (4.3/0.05) = 860 Ohm
Nearest E12 resistor is 820 Ohm
The current with 820 Ohm will be: (4.3/820=) 5.24mA

You can use any resistor in the interval 220 Ohm to 1kOhm, but the higher the value, the less current it consumes and the less strain it sees. Only go down in value if you have problems with eg. an electrically noisy environment.
Title: Re: Building wake-up light (op-amp question)
Post by: Flammable on March 20, 2011, 04:23:55 AM
Thanks Soeren, this helps me alot.

I might need to change my LED lamp because it says on the site of order that it can't be dimmed..... Not sure why. It's a lamp that consists of 90 individual LED's, they seem to be controlled by an internal chip and I suspect that this chip triggers on a certain voltage to turn the LED's fully on. How it will respond to a PWM signal is not known to me.

I think I will buy another lamp from ebay:
http://cgi.ebay.com/12V-180-LED-Light-Bulb-Lamp-E27-Solar-RV-Marine-Truck-/390109384759?pt=LH_DefaultDomain_0&hash=item5ad454d037 (http://cgi.ebay.com/12V-180-LED-Light-Bulb-Lamp-E27-Solar-RV-Marine-Truck-/390109384759?pt=LH_DefaultDomain_0&hash=item5ad454d037)
Title: Re: Building wake-up light (op-amp question)
Post by: Soeren on March 20, 2011, 11:41:00 AM
Hi,

[...] it says on the site of order that it can't be dimmed..... Not sure why. It's a lamp that consists of 90 individual LED's, they seem to be controlled by an internal chip and I suspect that this chip triggers on a certain voltage to turn the LED's fully on. How it will respond to a PWM signal is not known to me.
It probably won't like it, as it might already have some form of PWM to control it.
Have you got a link to it?


I think I will buy another lamp from ebay:
It's very bluish - 6400K

You might consider either hacking the lamp you have, or build another from the ground up. As it's for a wake up lamp, I guess you mostly need the majority of the light in one direction, so you might get away with using a single (or a few) LEDs of either 1W or 3W - they're pretty wide beam, usually around 120° or more.

Here are some at $2 a piece (http://cgi.ebay.com/New-5-pcs-High-Power-3W-White-LED-Light-150LM-Lamp-/280618440641?pt=LH_DefaultDomain_0&hash=item41562997c1) (shipping included).

Title: Re: Building wake-up light (op-amp question)
Post by: Flammable on March 20, 2011, 02:13:57 PM
Nice, I just got a much better idea from those LED's you recommended. I will attach them to a plate in a circular fashion and hang it up on the wall in front of my bed :-) It will be the best wake-up light ever....
Title: Re: Building wake-up light (op-amp question)
Post by: Soeren on March 20, 2011, 02:30:35 PM
Hi,

If you use an aluminum plate, you won't need further cooling (if it's not too small).
Title: Re: Building wake-up light (op-amp question)
Post by: Flammable on March 21, 2011, 01:41:12 PM
All components ordered :-)

LED's: 3W 150lm http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=280618440641&ssPageName=STRK:MEWNX:IT#ht_2152wt_905 (http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=280618440641&ssPageName=STRK:MEWNX:IT#ht_2152wt_905)
transistor: ZTX 653 power transistor http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=170266228506&ssPageName=STRK:MEWNX:IT#ht_2731wt_1139 (http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=170266228506&ssPageName=STRK:MEWNX:IT#ht_2731wt_1139)
Power Supply: 230VAC/50Hz - 24VDC http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=270688205176&ssPageName=STRK:MEWNX:IT#ht_2433wt_905 (http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=270688205176&ssPageName=STRK:MEWNX:IT#ht_2433wt_905)