EEVblog Electronics Community Forum
Electronics => Beginners => Topic started by: ohren on January 02, 2025, 11:50:42 pm
-
Hello,
While trying to control a TV backlight without its logic board I came across an unexpected result. I first tried the following circuit:
Rpi3 hardware PWM → 220 Ohm → NPN transistor → LED driver PWM pin on power board
...where the transistor was switching the 3.3 V supply from the Pi (3.3 V was measured at presumably 100% brightness on TV startup).
This worked, but with the side-effect that when I increased the frequency (without adjusting the duty cycle) the LEDs got brighter, and the total power draw increased significantly:
1 % duty [Hz] [W]:
15 10
30 11
60 13
120 17
240 27
480 46
600 55
In contrast, when I skipped the transistor and used the Pi's PWM output directly it behaved like expected, and brightness only increased with increased duty, and not with frequency.
My question is: why did this happen?
- I don't have access to an oscilloscope, so I'm left to asking and guessing. I don't expect any definite answer, but your guesses are better than mine.
- I asked in another forum, but didn't get any wiser there.
- The transistor is marked "8050" and came in a Pi kit where it was used for driving buzzers in example projects, etc. Assuming I connected it properly, I assume it's suitable for the task?
- The only idea I could think of is maybe using a pulldown resistor after the transistor, but it's just a wild guess since I'm not familiar with when that should be used.
- The LED driver chip has no available data sheet.
-
Why do you feel you need the transistor at all, if you're just driving a digital input that works without it?
It seems the 8050 is designed to work in push/pull wth an 8550 in audio output stages, putting out up to 2W. Maybe it's not soo happy single-ended. Do you have it forming a voltage divider for the output, or what?
The frequency response should be fine. It's got 400:1 gain (so you're probably over-driving and saturating it) but it's got >1 gain up to 100 MHz ... even at 10 MHz it's got surely plenty of gain for this application. 600 Hz is a walk in the park. But, yeah, you probably want small voltage swings on the input, not full CMOS output swings.
If you really want to put something between the RPi and the backlight board, maybe a digital inverter chip?
-
The turn on time is shorter than the turn off time because your 220 ohm resistor has to pull the transistor base down below 0.6 volts to turn it off, so you have 12ma of current available to turn it on. (3.3-0.6/220)
where as for turn off, you've only got .6 volts/220 ohms or 2.7ma of current available. and your transistor is probably saturated so the turn off is going to be extra long on top of the base emitter capacitance.
basically run the frequency up high enough and the transistor won't turn off.
-
As I interpret this you were driving the transistor base via a 220 Ohm resistor, which seems very low. How was the transistor wired e.g. as common emitter with a resistor as collector load (if so what value resistor), or as an emitter follower? A simple schematic would help.
I suspect that your drive waveform from the transistor has very asymmetric rise/fall times which means the effective duty cycle will change with frequency. If it's a common emitter with a weak pull-up (e.g. relying on a weak pull-up in the LED driver) then you'd have a fast falling edge and slow rising edge.
-
Thank you for taking the time. I didn't know I wasn't automatically subscribed to notifications (did I miss a checkbox when signing up?) so I didn't notice at first.
basically run the frequency up high enough and the transistor won't turn off.
Thanks for the explanation. Would you say that what you describe would account for the ~30% increased power draw when going from 15 to 60 Hz? I would have imagined that adding 45 "extra long" turn off times per second still wouldn't add up to a lot of extra on-time per second. If the 1% duty actually resulted in an on-time of 10 ms/s then these 45 turn off times would have to add up to about 3 ms to account for a 30% increased power draw, right? (Edit, answering my own question: Well, no because the power board has some overhead, doh. But even if I subtract the 3 W of overhead, then the proportional increase in power draw will be even greater (42%) and the 45 turn off times would have to add up to ~4 ms.)
My initial impression was that the turn on/turn off times were down in the nano-to-microsecond range, but it seems to me that this "extra long" turn-off time would have to approach about 60 microseconds or so (3000 us / 45). Is that a reasonable order of magnitude for the phenomenon you're describing?
As I interpret this you were driving the transistor base via a 220 Ohm resistor, which seems very low. How was the transistor wired e.g. as common emitter with a resistor as collector load (if so what value resistor), or as an emitter follower? A simple schematic would help.
The simple schematic is basically exactly what was illustrated in the first post (minus the proper symbols) – I used no other components. I'm assuming there's only one sensible way to hook up the transistor in the specified series, with the specified components (and with the 3.3 V rail), so that's the way I did it.
To be honest I haven't really built any transistor circuit before so I just made sure I could dim a single LED with PWM via a transistor, and then substituted the LED with the LED driver to see if PWM was the way to go. I didn't put more thought into it because I didn't know enough anyway. Apparently it both worked, and failed.
What circuit design pattern(s) would you suggest I look up in order to do it properly with a transistor?
Why do you feel you need the transistor at all, if you're just driving a digital input that works without it?
I don't feel I need it now since I've since found the solution to the problem, but at the time I wanted some sort of indirection between my Pi and any unknown future mistake I was going to make. At the time I 1) didn't know whether the power board actually expected a PWM signal on the dimming control pin, 2) didn't have the service manual for the power board (i.e. didn't know what was connected to the control pin), 3) didn't (and still don't) have the datasheet for the LED driver on the power board (which turns out to be all that was connected to the control pin). It seemed like a good idea to let the transistor break instead of my Pi in case I messed up, I guess.
-
I'm assuming there's only one sensible way to hook up the transistor in the specified series, with the specified components (and with the 3.3 V rail), so that's the way I did it.
There are three possible ways you could have configured this; common emitter, common base or common collector(usually called emitter follower). A common emitter configuration would invert the signal, e.g. 99% duty cycle at the Pi would appear as 1% at the backlight driver, but this configuration gives voltage gain so can be used to give voltage level translation. Emitter follower gives no inversion or voltage gain, only current gain. Common base is probably the least used configuration but can be very useful for voltage level translation and does not invert the signal.
This schematic shows the difference, and includes the additional resistor(s) that should have been included.
[attach=1]
-
Generous of you to illustrate with schematics, thank you for that.
Emitter follower without R4 connection to ground was my case, so R4 represents the gap in my knowledge. Now I'll just have to figure out why it's needed. Perhaps it suggests that the current through the led driver is too small for reliable operation of the transistor?
The other two configurations didn't occur to me 😅