I've just created a PCB, it's soldered and everything. Its main goal is to switch an electrolock on and off. The problem is - it doesn't do its job. I replaced an electrolock with an LED (I connect them as an external device - by cables, you can see that on schematics) and the LED was being turned on and off every 1 second (that is what my code was meant to do). I guess there is some current limitation problem - I'm quite new to transistors, this would be my first project where I use one.
My transistor is an NPN transistor BD911 , it's most important features are:
- Vcbo = 100V
- Vceo = 100V
- Vebo = 5V
- Ie, Ic = 15A
- Ib = 5A
- hfe should be sth around 35
My electrolock draws up to 900mA.
The 7805TV you can see in the schematics is actually a LM1117 (3.3V regulator).
In the schematics you can see 300R resistor going to the base of the transistor - but that's a miscalculation. Let me count the actual value here, maybe I'm just doing some mistake:
The supply voltage is U1. The 3.3V voltage coming out of LM1117 is U2.
U1 = 12V
U2 = 3.3V
Ice = 0.9A
hFE = 35
Ib = 0.9 / 35 = 0.026A
Rb = (3.3V - 0.7V) / 0.026A = 100R
So putting a 100R resistor between the ATmega pin and transistor's base should be good. I tried resistors less than 100R but the electrolock did not work.
What's interesting I created a breadboard solution without a uC and it worked. I just put LM1117 with capacitors, a transistor with a 10R (yes, 10R, not 100R) resistor and it all worked (I was switching the electrolock on and off by putting the transistor's base cable to GND or 3.3V). The only problem here is that all current goes through the LM1117 - which is a bad idea because it gets reaaally hot (I melted my carpet haha :D).
- What am I doing wrong on the PCB?
- How to avoid routing all the current through the linear regulator?