3.3v/5v NPN Transistor PWM Switching Issue - Page 1
Forum section: electronics / beginners

author: NotionalLabs
author_rank: Unknown
timestamp: July 09, 2018, 10:20:17 pm
content: Hey everyone,I'm struggling to understand the behaviour of a little circuit I'm playing with and was wondering if someone here could help explain it to me. I'm looking to control a set of 5 super bright LED's via PWM from a Raspi Zero W. I envisioned using an NPN transistor (currently using a 2N2222) with the base connected to my PWM pin (3.3v), the Collector connected to the 5VDC power rail on the Raspi, and the Emitter connected to a current-limiting resistor (100 ohm) and subsequently the 5 LEDs in parallel). The forward voltage drop on my LEDs is 3v, with peak brightness at 20mA.I've mocked up the circuit in the browser simulator here:http://tinyurl.com/yam4zfhtThe issue I'm having in real life (and in the simulator) is that the voltage on the emitter is capping out at ~2.5/2.7V, less than the forward voltage drop of the LEDs, so they are very dim and are drawing very little current.It was my understanding that as long as I saturated the B, the voltage drop between C and E should be small (0.2V or so) and I should be able to realise the required 3v to the LEDs without issue. I've checked the PWM signal which is clean and as-expected, the 5V rail is strong (it's tied directly to the 5V USB input, a 2.4A iPad charger), and trying multiple current-limiting Base resistors makes little/no difference to the Emitter voltage.Does anyone know why this is? The voltage drop between CE seems really high, and I don't understand the relationship between BE voltage and CE voltage (in the simulator, changing the base logic voltage level to 5V yields a better voltage on the emitter, but still higher drop than I would have imagined).Thanks!

author: JustMeHere
author_rank: Frequent Contributor
timestamp: July 09, 2018, 10:24:10 pm
content: You are missing your gate resistor.

author: JustMeHere
author_rank: Frequent Contributor
timestamp: July 09, 2018, 10:28:39 pm
content: Also your transistor should be below the LEDs if you're using a NPN transistor. And make sure you're not overloading your LED current limiting resistor.

author: NotionalLabs
author_rank: Unknown
timestamp: July 09, 2018, 10:31:54 pm
content: Thanks for the replies!Re: the Gate resistor: in the sim - yeah, although I have one in the real circuit (I calculated the Base resistor value as ~8.6k to guarantee saturation, and I've tried 10k, 4.7k, and 1k with no difference). I've updated the sim to include it to avoid any confusion:http://tinyurl.com/yanu9wsfRe: the position of the load, I didn't realised that mattered (I assumed that when saturated, the CE path was effectively a short (minus the CE voltage drop) so it wouldn't really matter which side. Could you explain why this is the case?Best, Jim

author: JustMeHere
author_rank: Frequent Contributor
timestamp: July 09, 2018, 11:02:03 pm
content: To turn on, your base pin has to be higher than the emitter. Let's say about 1.4v.If the emitter is connected to GND then the emitter pin is 0v and it's easy to get the base 1.4v higher.In your circuit, the emitter probably around 3v. That means you need your base voltage at 4.4v.(Google low side vs high side switching. For a better explanation.)

author: NotionalLabs
author_rank: Unknown
timestamp: July 09, 2018, 11:21:02 pm
content: That's perfect, I'll read up on that now. Moving it around solved my issue in my test circuit too - really appreciate the help!