I want to make a simple motion-enabled light with an esp8266, and I'm searching for the best way to transfer the electricity from a lithium battery to a 3W LED. I thought the best way would be to use a simple transistor, but either I'm using the wrong one (BC547) or I don't know how to use them because my output voltage is very low, around 1.7V from the esp's 3.3V. So I want to power the LED directly from the battery without losing anything by connecting the LED through the esp gpio (preferably still with a dimming option).
Hi,
Please post a circuit diagram of what you have tried and what resulted.
Then we can offer some advice.
Please post a link to specs/data of the 3W LED.
What are the specs of your Lithium battery?
Thanks.. Tom..
3 W at 3.3 V is almost 1A.
That is too much for bc547.
You need a constant current source for your LED.
You can build one yourself if you want.
First time i tried to make a circuit online:
Here is the difference in the led brightness when connected to the transistor: (edit 2.6v measured)
VS straight from the 3.3v pin:
Here are the led specs:
Battery:
This led is a bit overkill, as the battery won't provide me with 1A, but I'm still using it. Also i dont need an extremely powerful power source because powering the led directly from the battery gives me the desired brightness. I guess the voltage and current drops are pretty big with the bc 547, so are there any alternatives?
Without current limiting you will overheat your battery (trying to get more current than it can deliver).
You may also destroy your LED.
Show your schematic. With that transistor it should be low side switching...
But that transistor will get damaged at currents higher than 0.5A... (and maybe at lower currents as well. It is not a power transistor).
A power transistor would have a house that you can/should bolt onto a cooling element (jus a piece of aluminium would do in this case).
A mosfet would be more modern...
But still you need some current control...
Hi,
Try this;
Try R1 = 1K0.
Do not go lower than 270R, as you will then be drawing too much current from the 8266 pin.
Max current from 8266 ouput pin is 12mA.
V = I x R
R= V / I
V= 3.3 - 0.7 = 2.6V
R1 = 2.6 / .012 = 216R, stay safe with 270R as minimum value.
Tom....
PS. Ideally you should use a N-CH MOSFET for efficiency.
This should get you started
This is more detailed
This may help you select the best MOSFET for your application
So I watched the videos and tried to do a similar thing using IRFZ44N. But, even without anything attached to the gate, I get this:
Is this the wrong MOSFET? Sorry, i'm not good yet at understanding the documentations...
This circuit does work pretty well, but the output voltage is around 2.8V, so i guess switching to mosfet will be a better solution.
The MOSFET gate shouldn't be floating, but that's not all...
LEDs are "current operated". Regular little LEDs use a current limiting resistor with "extra voltage" dropped across the resistor. Higher power LEDs normally use a special switchmode constant-current driver, again with a little "extra" voltage.
You can use a resistor with your 3W resistor but you'll need at least 5 or 6V and a resistor rated to handle the power (wattage). Typically, the resistor has to dissipate approximately the same amount of power as the LED.
A switchmode driver is nearly 100% efficient (very little wasted power) so you don't generate excess heat and your battery lasts longer.
I was hoping to complete the project without using complicated circuits such as LED drivers because I dont think the lithium battery can produce more than 3W, thus killing my LED.
And also what do you mean by this? (what exactly do i need a resistor for)
ps I'm more into programming than making circuits, so I don't know much about all of this, and might be asking some dumb questions
IRLZ44 has a lower turn on voltage Vgs(th). The L is for logic level, which you are using.
Another option would be IRL540.
Put a 10K or so resistor from gate to ground if you haven't already.
This is not complicated. You just need the correct parts.
Hi,
Is your circuit like this?
Your picture is not clear, have you made sure of the G, D and S terminals of the MOSFET?
Tom..
OP should not use the battery max current delivery as current limiter for his LED.
It will damage the battery. It could cause leakage fire,or explosion.... maybe not at 3W but it simply is bad practice...
I tried this circuit, but the LED continues to glow dimly even when no voltage is applied to the gate. I guess the problem is in IRFZ44N, and I have to switch it to IRLZ44 as mentioned by @2112.
I guess I have to order IRLZ44 and then test it out. 10K resistor doesn't change anything. And also, an interesting thing i found is that I have one irfz44n that acts differently:
from the others:
I am using a potentiometer as a 10k resistor replacement*
The BC547 is good for 0.1 A, I would be surprised if it didn't released the magic smoke.
In my experiments it has survived things that it should not survive.
I was also too lazy to lookup the exact specs.
But it is definitely not suitable in this application...