Author Topic: LED backlighting suggestions (4 in CC config, 3.2-3.4V 20mA)  (Read 10997 times)

0 Members and 2 Guests are viewing this topic.

Offline Nominal AnimalTopic starter

  • Super Contributor
  • ***
  • Posts: 6715
  • Country: fi
    • My home page and email address
Re: LED backlighting suggestions (4 in CC config, 3.2-3.4V 20mA)
« Reply #25 on: July 10, 2022, 11:32:44 pm »
Here's what I cobbled together in EasyEDA:


This uses one BC847C,235 and four Nexperia BC857C,235 transistors, just because they're cheap, (well under USD $1 for 20 at LCSC, about 1€ for 10 at Mouser), QUCS has a simulation model for them, and I can handle the SOT-23 SMD footprint fine.

I did check the datasheets that they ought to handle what I'm asking for them without getting anywhere near their limits: even if dropping all of 5V at 20mA, that'd be 100mW, and the maximum total power dissipation allowed at 25°C is 250mW according to the datasheet.

I used 1k (R5) and 2k (R6) resistors based on simulations and anticipating simplifying the BOM, and because the BC8x7C,235 have somewhat better DC current gain (hFE between 420 and 800 at VCE=5V, IC=2mA) than the other BC8x7 variants.
The 20 Ohm resistors should then set the LED currents at about 16.5mA, but I expect I will tune these a bit further.  I listed some of the other options in the schematic.

TI REF3333 provides both the 3.3V reference voltage for the DAC (and therefore the current regulation for the LEDs), but also its supply.  It can provide up to 5 mA, and this circuit should need less than 1mA.  The 1µF cap on the output of REF3333 is required, but it also acts as a bypass cap for the DAC.  I did the selection based on availability and price, after comparing datasheets on the various available parts.  Seemed a good fit here, including price ($2 at LCSC, 2.5€ at Mouser), but I have no practical experience with this part either.

For the DAC, I chose TI DAC5571.  Small, volatile (I didn't want to deal with nonvolatile stuff), low power (so I can power it from the reference voltage), low noise, stable, cheap (no stock at Mouser, but LCSC does, at under $1 apiece).  The address is either 0x98 (0x4C) or 0x9A (0x4D) depending on whether A0 is tied low or high; I will be pulling it low to minimise noise.  Instead of pulling the SCL and SDA lines to the reference voltage, they're pulled to 3.3V provided by the host, to limit the load on the reference, and to avoid problems when the host 3.3V does not exactly match the 3.3V reference voltage from the REF3333.

Instead of the DAC, one can also use a plain old 10k linear potentiometer (say, a thumbwheel) instead.  The additional 10k resistor then limits the range of the voltage divider to 1.65 V to 3.3 V, and thus nicely covers the practical range of the VLED input.  That is, there isn't much dead space on the low end of the pot range.  I like this option too.  I guess one could even combine both by using a voltage divider; the current to the base of the BC847C,235 is in the microamp range, so a 10k linear pot ought to work just fine.

(I'm tempted to experiment with a Pi filter using a P-channel MOSFET to replace the DAC with a PWM+low pass filter (pi filter, maybe, PWM'ing the reference voltage at ultrasonic frequencies – I'll probably run my Teensy 4 at 600 MHz, so no problem there), just to see if that too would work here.  It'd be a darn nice backlight circuit if that works as well.)

Comments?  Suggestions?
« Last Edit: July 11, 2022, 03:50:22 pm by Nominal Animal »
 
The following users thanked this post: MK14

Offline MikeK

  • Super Contributor
  • ***
  • Posts: 1314
  • Country: us
Re: LED backlighting suggestions (4 in CC config, 3.2-3.4V 20mA)
« Reply #26 on: July 10, 2022, 11:41:13 pm »
If you want all the LED's to have the same current, does it make sense to use a current mirror?...With one transistor as the "master", or whatever you call it, and all the others will mirror that?  Of course they have to be matched, but transistors in the same batch may be.  Is that any better, or worse?
 

Offline Nominal AnimalTopic starter

  • Super Contributor
  • ***
  • Posts: 6715
  • Country: fi
    • My home page and email address
Re: LED backlighting suggestions (4 in CC config, 3.2-3.4V 20mA)
« Reply #27 on: July 10, 2022, 11:53:25 pm »
If you want all the LED's to have the same current
Well, no, not really: the 20 Ohm resistors can be tuned for each LED individually; that's the point.  Call me paranoid; I want to be able to adjust them if necessary, even though I may not need to.  Even the dimming is just a niceness I'd like, not a necessity.  (But I do hate flicker, and high-frequency/near-ultrasonic buzzing PWMing often causes.  I can hear up to at least 20kHz myself.)

The four LEDs in this backlight are in common cathode arrangement, and quite well matched in the units I have.  I bet most gadgets using this display panel just parallel them and use a single, 77mA or so, constant current source.

(I won't go as far as planning to use multi-turn 50 or 100 ohm pots for this, though.  Those things cost $1.5 apiece, but moreover, are far too bulky, really.  Maybe 50 Ohm Bourns SMD trimpots...  ::))
« Last Edit: July 10, 2022, 11:59:47 pm by Nominal Animal »
 

Online MK14

  • Super Contributor
  • ***
  • Posts: 4835
  • Country: gb
Re: LED backlighting suggestions (4 in CC config, 3.2-3.4V 20mA)
« Reply #28 on: July 11, 2022, 11:40:30 am »
I bet most gadgets using this display panel just parallel them and use a single, 77mA or so, constant current source.

I'm wondering if you might be better off, starting with a simple resistor, with a value calculated to give perhaps 70mA (so 10mA worth of safety margin), so voltage variations on the 5V rail and resistor tolerances, don't exceed the LED's maximum of 80mA (all 4 combined, 4 x 20mA).
Hopefully that will work out just fine, and you can check the current with a multimeter.

Later, you can PWM that 5V rail bit, with a transistor (or similar), to modulate the brightness level, if necessary.
Or simply use a three way switch (other numbers of ways, possible), which selects between high, medium and low brightness levels, via three suitably valued resistors.  Assuming that doesn't affect the colour gamet, significantly.

There is quite a lot to learn, to design your own decent transistor circuits.  Especially ones which will control the current well, and cope with what can be quite wild (big), variations in Hfe and other transistor parameters.
What you seem to have drawn out, looks like you are somewhat nearer the beginning of such a journey, rather than being close to the end of such a journey.

I might get torn to pieces, for saying this, on the forum.  But I have been led to understand, that even if you design transistor circuits, every day, for a living, and have done so, successfully for the last five or ten years (which was much more common in the 1960s and 70s).  You still have much to learn about electronics and transistors.

If you're determined for precise/individual current control, and designing it yourself.  You could either go the op-amp route, or the various integrated circuits, specifically designed for driving LEDs, at precise currents.  But I don't think those are necessarily/usually used in relatively simple backlight schemes, which your display, seems to have/need.
« Last Edit: July 11, 2022, 12:21:03 pm by MK14 »
 
The following users thanked this post: Nominal Animal

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19796
  • Country: gb
  • 0999
Re: LED backlighting suggestions (4 in CC config, 3.2-3.4V 20mA)
« Reply #29 on: July 11, 2022, 12:11:49 pm »
Here's what I cobbled together in EasyEDA:


This uses one BC847C,235 and four Nexperia BC857C,235 transistors, just because they're cheap, (well under USD $1 for 20 at LCSC, about 1€ for 10 at Mouser), QUCS has a simulation model for them, and I can handle the SOT-23 SMD footprint fine.

I did check the datasheets that they ought to handle what I'm asking for them without getting anywhere near their limits: even if dropping all of 5V at 20mA, that'd be 100mW, and the total power dissipation at 25°C is 250mW.

I used 1k (R5) and 2k (R6) resistors based on simulations and anticipating simplifying the BOM, and because the BC8x7C,235 have somewhat better DC current gain (hFE between 420 and 800 at VCE=5V, IC=2mA) than the other BC8x7 variants.
The 20 Ohm resistors should then set the LED currents at about 16.5mA, but I expect I will tune these a bit further.  I listed some of the other options in the schematic.

TI REF3333 provides both the 3.3V reference voltage for the DAC (and therefore the current regulation for the LEDs), but also its supply.  It can provide up to 5 mA, and this circuit should need less than 1mA.  The 1µF cap on the output of REF3333 is required, but it also acts as a bypass cap for the DAC.  I did the selection based on availability and price, after comparing datasheets on the various available parts.  Seemed a good fit here, including price ($2 at LCSC, 2.5€ at Mouser), but I have no practical experience with this part either.

For the DAC, I chose TI DAC5571.  Small, volatile (I didn't want to deal with nonvolatile stuff), low power (so I can power it from the reference voltage), low noise, stable, cheap (no stock at Mouser, but LCSC does, at under $1 apiece).  The address is either 0x98 (0x4C) or 0x9A (0x4D) depending on whether A0 is tied low or high; I will be pulling it low to minimise noise.  Instead of pulling the SCL and SDA lines to the reference voltage, they're pulled to 3.3V provided by the host, to limit the load on the reference, and to avoid problems when the reference differs slightly from the MCU 3.3V.

Instead of the DAC, one can also use a plain old 10k linear potentiometer (say, a thumbwheel) instead.  The additional 10k resistor then limits the range of the voltage divider to 1.65 V to 3.3 V, and thus nicely covers the practical range of the VLED input.  That is, there isn't much dead space on the low end of the pot range.  I like this option too.  I guess one could even combine both by using a voltage divider; the current to the base of the BC847C,235 is in the microamp range, so a 10k linear pot ought to work just fine.

(I'm tempted to experiment with a Pi filter using a P-channel MOSFET to replace the DAC with a PWM+low pass filter (pi filter, maybe, PWM'ing the reference voltage at ultrasonic frequencies – I'll probably run my Teensy 4 at 600 MHz, so no problem there), just to see if that too would work here.  It'd be a darn nice backlight circuit if that works as well.)

Comments?  Suggestions?
How constant is the temperature?

As mentioned by Benta the diodes have a temperature compensating effect. The base-emitter voltage of the transistors has a negative temperature coefficient, so your circuit and the one I posted here have a positive current temperature coefficient. As the temperature rises, the base-emitter voltages fall, causing the voltage drop across the emitter, resistors thus the current through them to increase.

The circuit shown below should be reasonably temperature stable. The current through D1 and D2 is fairly stable and the voltage across them will fall, as the temperature rises. It will probably have a slightly negative temperature coefficient, as there are two diodes and only one base-emitter voltage drop on the driver transistors. It should be possible to reduce the temperature coefficient, perhaps by replacing on of the diodes with a resistor, or replace both diodes with at BJT, preferably thermally coupled to the driver transistors.


How accurate does the current need to be? If it needs to be well-regulated, then the only sane way is with an op-amp and voltage reference.
« Last Edit: July 11, 2022, 12:30:01 pm by Zero999 »
 
The following users thanked this post: MK14, Nominal Animal

Offline Nominal AnimalTopic starter

  • Super Contributor
  • ***
  • Posts: 6715
  • Country: fi
    • My home page and email address
Re: LED backlighting suggestions (4 in CC config, 3.2-3.4V 20mA)
« Reply #30 on: July 11, 2022, 06:35:51 pm »
I'm wondering if you might be better off, starting with a simple resistor, with a value calculated to give perhaps 70mA (so 10mA worth of safety margin), so voltage variations on the 5V rail and resistor tolerances, don't exceed the LED's maximum of 80mA (all 4 combined, 4 x 20mA).
Hopefully that will work out just fine, and you can check the current with a multimeter.
Well, that's what I have now.

Later, you can PWM that 5V rail bit, with a transistor (or similar), to modulate the brightness level, if necessary.
This is to be a display for an LTE modem/firewall (based on Mikrotik RBM33G with a 4G/LTE modem), in a remote cottage, only used to show the connectivity and other information in an user-friendly way.  (Instead of just a simple OLED or similar display, I wanted a nice display so I could use Tux or similar mascots: I've got some artists in my family that can do stuff to make it not only informative and intuitive, but funny and personally relevant.)

Essentially, the optimum brightness of the display will vary on the environment it will be placed in.  If in a dark corner somewhere, a dimmer display is better, otherwise I might need the maximum brightness.  But the dimming (PWM or DAC-controlled) is mostly to make the display turn on and off smoothly, especially if I choose to let it turn on automatically for a few minutes if connection drops or reconnection is made.  Having something flicker on/off too suddenly can be distracting; hence, the popularity of "breathing" indicator LEDs.

There is quite a lot to learn, to design your own decent transistor circuits.  Especially ones which will control the current well, and cope with what can be quite wild (big), variations in Hfe and other transistor parameters.
What you seem to have drawn out, looks like you are somewhat nearer the beginning of such a journey, rather than being close to the end of such a journey.
I am, absolutely!  I am a complete Uncle Bumblefuck in the early Suck-Hard-and-Fail-Often part of the learning curve in electronics circuits, definitely!  Especially so when it comes to current control.  I've played with sensors and voltage-based stuff, but not much with current-controlled/dependent things like LEDs.  I do have done electronics courses (but I focused on digital logic!), so I know how to read and draw circuit diagrams (badly that, I admit!); I just have almost no experience with practical circuits and especially known good approaches.  Which is why I asked, and am very grateful for everyones support in this thread, yours definitely included.

I might get torn to pieces, for saying this, on the forum.  But I have been led to understand, that even if you design transistor circuits, every day, for a living, and have done so, successfully for the last five or ten years (which was much more common in the 1960s and 70s).  You still have much to learn about electronics and transistors.
Bah (to being torn to pieces); the same applies to software development as well.  Even though I've been paid to write code in half a dozen different programming languages off and on during the last three decades, I still learn more just about every day.  And I still have much to learn about programming.

If you're determined for precise/individual current control, and designing it yourself.  You could either go the op-amp route, or the various integrated circuits, specifically designed for driving LEDs, at precise currents.  But I don't think those are necessarily/usually used in relatively simple backlight schemes, which your display, seems to have/need.
True, and I agree: this is quite over the top.

Perhaps a better way to look at this project of mine is to consider it a tool for hobbyists like me using this display (with Teensy 4 or similar microcontrollers –– I do intend to use parallel I/O for this), with lots of options on tuning it.  The component count (7 SOT-23 packages and 10 passives in 0805, 14 passives if I double the positions for the current setting resistors) may seem high, but I find it acceptable due to adjustability it gives me.

How constant is the temperature?
Ambient will be between +15° and +40°C, and I do not care if the display brightness changes a bit (say, current varies by 5% within this range) depending on the ambient temperature.

How accurate does the current need to be? If it needs to be well-regulated, then the only sane way is with an op-amp and voltage reference.
Only accurate enough to not yield visible artefacts.  Say, 1% peak-to-peak maximum noise.

The reason for using REF3333 is that there might be some step-like fluctuations on the 3.3V rail from the MCU.  It is quite true that a couple of capacitors or a Pi filter would probably stabilize it just fine, but considering how easy and cheap it is to just throw a reference and a couple of capacitors there to be sure, I'm, uh, happier with the latter.

Something like MCP6009 (quad RRIO op-amp) could drive the LEDs directly, is cheap (Mouser has stock, <0.5€ apiece), and if driven from +5V, should be able to drive up to 20mA per channel, in Howland current pump configuration –– but I don't see how to have the pumps share resistors, so that makes for 16 of them.  To allow adjusting the maximum current for each LED individually, I could just use a voltage divider between the reference and the positive input of each quad op-amp (or one in serial for global physical brightness knob, followed by one per op-amp positive input for tuning the per-LED maximum brightness).  Thing is, I don't have the experience to have an opinion how this would compare to the schematic I showed above.
« Last Edit: July 11, 2022, 06:39:37 pm by Nominal Animal »
 
The following users thanked this post: MK14

Offline Benta

  • Super Contributor
  • ***
  • Posts: 6124
  • Country: de
Re: LED backlighting suggestions (4 in CC config, 3.2-3.4V 20mA)
« Reply #31 on: July 11, 2022, 06:41:58 pm »
I'm not convinced by some parts of that circuit, and don't want to spend time extensively analyzing/simulating it, to make sure by criticisms are solid/valid.  But anyway.

RB, 15k, at 2.5V drive (from your schematic), would only attempt to give D1 and D2, 0.166mA.  My understanding is that if you want to use diodes like that, for a somewhat stable reference voltage.  It needs a reasonable amount of current, of perhaps a milliamp.  Otherwise, in some cases, the diodes, will have a significantly lower voltage, than intended.

Secondly, RC, 620 Ohms.  Is going to potentially have significant amounts of the current, stolen by the 4 transistors (bases), Q1 through to Q4, as they will tend to lose Hfe, because the 15mA to 20mA per transistor, is perhaps a safe value of maybe 50 to 100 (Hfe), depending on how you interpret the graphs and safety margins.  They seem to be specified for a minimum of 125 at 2mA.

https://assets.nexperia.com/documents/data-sheet/BC856_BC857_BC858.pdf

So for arguments sake, let's say it happened to be exactly 100 (Hfe) at 20mA (typical values would give a higher Hfe, but less device to device safety margin).  Then 4 x 0.2mA per transistor = 0.8mA, which would tend to leave RC with around 1.2mA (in this example), potentially leading to inaccurate current levels.

In the typical case, the diodes would tend to work with the values shown, and the transistors would probably have a more generous Hfe in practice.  I.e. It would tend to work in a 1-off situation, but not be a good idea for production or if high reliability was desired.

So, you don't want to do the calculations, but still stand on Speaker's Corner? Right.

To your first point: I'm not using 1N4007 diodes, but small-signal diodes for this. They'll operate fine a low currents, but will only exhibite a VF of 0.55...0.6 V. Compare this to the VBE of the BC847, where the current will be even lower.

Second, your "current stealing" scenario. There's nothing "significant" about it, in fact it's negligible. The worst case HFE for a BC857B is 220, so taking (15 mA x 4) / 220, the maximum current that will be "stolen" is 0.27 mA. That, by the way, is the reason that the resistor is 620 ohms and not 600 ohms as might be expected.
But if it's an issue, increase the collector current of the BC847 (just reduce the 300 and 620 ohm resistors).

Please keep in mind that the main goal of this circuit is to ensure good and stable current matching between the LED strings, not absolute precision (that can be fixed with PWM or trimming the 300 or 620 ohm resistors).
 

Online MK14

  • Super Contributor
  • ***
  • Posts: 4835
  • Country: gb
Re: LED backlighting suggestions (4 in CC config, 3.2-3.4V 20mA)
« Reply #32 on: July 11, 2022, 06:50:24 pm »
So, you don't want to do the calculations, but still stand on Speaker's Corner? Right.

To your first point: I'm not using 1N4007 diodes, but small-signal diodes for this. They'll operate fine a low currents, but will only exhibite a VF of 0.55...0.6 V. Compare this to the VBE of the BC847, where the current will be even lower.

Second, your "current stealing" scenario. There's nothing "significant" about it, in fact it's negligible. The worst case HFE for a BC857B is 220, so taking (15 mA x 4) / 220, the maximum current that will be "stolen" is 0.27 mA. That, by the way, is the reason that the resistor is 620 ohms and not 600 ohms as might be expected.
But if it's an issue, increase the collector current of the BC847 (just reduce the 300 and 620 ohm resistors).

Please keep in mind that the main goal of this circuit is to ensure good and stable current matching between the LED strings, not absolute precision (that can be fixed with PWM or trimming the 300 or 620 ohm resistors).

Well I DON'T agree with you.  But we can agree to disagree if you like.
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 6124
  • Country: de
Re: LED backlighting suggestions (4 in CC config, 3.2-3.4V 20mA)
« Reply #33 on: July 11, 2022, 06:57:19 pm »
Well I DON'T agree with you.  But we can agree to disagree if you like.

I'm fine with that. But please argue with facts and maths, not postulates and feelings. Then this discussion is fruitful.
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 6124
  • Country: de
Re: LED backlighting suggestions (4 in CC config, 3.2-3.4V 20mA)
« Reply #34 on: July 11, 2022, 07:07:16 pm »
Here's what I cobbled together in EasyEDA:

Comments?  Suggestions?

I have a problem with the 20 ohm resistors. Did you really simulate the current in the LEDs?

For a 3.3 V VLED input, I get a collector current of around 1.35 mA through Q1. This will give around -1.35 V over R5 as base voltage for the PNPs.
This again gives a voltage of around -0.7 V at the PNP emitters. 0.7 V / 20 ohms = 35 mA.

 

Offline Nominal AnimalTopic starter

  • Super Contributor
  • ***
  • Posts: 6715
  • Country: fi
    • My home page and email address
Re: LED backlighting suggestions (4 in CC config, 3.2-3.4V 20mA)
« Reply #35 on: July 11, 2022, 07:54:35 pm »
I have a problem with the 20 ohm resistors. Did you really simulate the current in the LEDs?
Yes, in QUCS 0.0.20 (using qucsator) and its (Diodes Inc.) built-in models of BC847C and BC857C.  But, apparently used 3.0V instead of 3.3V for the maximum DAC voltage.  Oops; at 20 Ohms, 3.0V gives 17mA, but 3.3V gives almost 22mA, so that will need to be fixed (22 Ohm resistors are more easily available anyway); but I don't see the source of error.

For a 3.3 V VLED input, I do get the same collector current, 1.35mA, through Q1, but -1.12 over R5, and V_BE = -0.76V at Q2 with a 20 Ohm resistor, with an additional drop of -0.36V in that resistor.  Yet, a current probe in series with the LED (using blue LED model, 3.3V forward voltage) does show 22mA.

Dammit, I should've used KiCad (since it uses ngspice), with proper spice models of the components I'm using.  Will switch.
 

Online MK14

  • Super Contributor
  • ***
  • Posts: 4835
  • Country: gb
Re: LED backlighting suggestions (4 in CC config, 3.2-3.4V 20mA)
« Reply #36 on: July 11, 2022, 08:13:17 pm »
Now that I better understand what the problem (goal) is.

I'm thinking on the lines of an ambient light sensor.  There are a number of somewhat low cost, specialist ones (often intended to be put into mobile phones or monitors), that can tell you the ambient light level.  Then, (forget precision current control).  Just set the PWM to always be, perhaps 500Hz or 1,000 Hz, and write software which varies the PWM on duty cycle, depending on the ambient light sensor readings.
Cheaper alternatives would just be to use a phototransistor, but then you would have to do more work to use it.

You can then just use a simple transistor or mosfet, to do the actual switching of the backlight LEDs, via the MCUs PWM output pin.

I don't think there is any need to attempt to precisely control the current level, assuming the 500Hz or 1,000Hz PWM, does not cause you any issues.

Then, it would be able to automatically keep the displays brightness in check, throughout the day (assuming windows) and/or when lights are switched on and off.

EDIT: But just to be clear.  To alternatively, precisely control the current, rather than PWM'ing it.  To completely eliminate possible flicker and/or resolution issues, is also a perfectly valid design decision/goal.  The solution I presented above, is just one of millions of possible ways, of sorting this project of yours out.
I.e. I'm NOT saying current control, is necessarily bad or wrong, just that PWM, when a viable option, is often cheaper, easier and quicker, in many cases.
« Last Edit: July 11, 2022, 08:21:49 pm by MK14 »
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 6124
  • Country: de
Re: LED backlighting suggestions (4 in CC config, 3.2-3.4V 20mA)
« Reply #37 on: July 11, 2022, 08:40:28 pm »
Yes, in QUCS 0.0.20 (using qucsator) and its (Diodes Inc.) built-in models of BC847C and BC857C.  But, apparently used 3.0V instead of 3.3V for the maximum DAC voltage.  Oops; at 20 Ohms, 3.0V gives 17mA, but 3.3V gives almost 22mA, so that will need to be fixed (22 Ohm resistors are more easily available anyway); but I don't see the source of error.

For a 3.3 V VLED input, I do get the same collector current, 1.35mA, through Q1, but -1.12 over R5, and V_BE = -0.76V at Q2 with a 20 Ohm resistor, with an additional drop of -0.36V in that resistor.  Yet, a current probe in series with the LED (using blue LED model, 3.3V forward voltage) does show 22mA.
Two things stick out:
1: your Q1 collector current is too low. 2 mA is absolute minimum, try to set it around 4 mA just for testing (R6 680 ohms, R5 330 ohms). This gives an R5 voltage of around -1.25 V.
2: Your BC857C model sucks. VBE should be around -0.6 V, leaving 0.65 V for the emitter resistors. For 15 mA, this gives around 40 (43) ohms.
And the hFE in the model is apparently also far too low.
Get a good SPICE model from Nexperia or other reputable sources.

EDIT: just had an idea: I don't know the QUCS simulator, but in ngspice you have to be hellishly careful about the pin number sequencing. Could it be that collector and emitter are swapped in your simulation? In ngspice, the BC8x7 pinout does not conform to standard. That might explain the odd VBE and low hFE.
« Last Edit: July 11, 2022, 09:09:41 pm by Benta »
 
The following users thanked this post: MK14, Nominal Animal

Offline Benta

  • Super Contributor
  • ***
  • Posts: 6124
  • Country: de
Re: LED backlighting suggestions (4 in CC config, 3.2-3.4V 20mA)
« Reply #38 on: July 11, 2022, 08:49:59 pm »
Dammit, I should've used KiCad (since it uses ngspice), with proper spice models of the components I'm using.  Will switch.
Be careful what you wish for.
EEschematic: good
PCB layout: good
ERC: good
ngspice: Gaaaah!

Cheers.
« Last Edit: July 11, 2022, 09:08:14 pm by Benta »
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19796
  • Country: gb
  • 0999
Re: LED backlighting suggestions (4 in CC config, 3.2-3.4V 20mA)
« Reply #39 on: July 11, 2022, 09:24:27 pm »
I'm wondering if you might be better off, starting with a simple resistor, with a value calculated to give perhaps 70mA (so 10mA worth of safety margin), so voltage variations on the 5V rail and resistor tolerances, don't exceed the LED's maximum of 80mA (all 4 combined, 4 x 20mA).
Hopefully that will work out just fine, and you can check the current with a multimeter.

Well, that's what I have now.

Later, you can PWM that 5V rail bit, with a transistor (or similar), to modulate the brightness level, if necessary.

This is to be a display for an LTE modem/firewall (based on Mikrotik RBM33G with a 4G/LTE modem), in a remote cottage, only used to show the connectivity and other information in an user-friendly way.  (Instead of just a simple OLED or similar display, I wanted a nice display so I could use Tux or similar mascots: I've got some artists in my family that can do stuff to make it not only informative and intuitive, but funny and personally relevant.)

Essentially, the optimum brightness of the display will vary on the environment it will be placed in.  If in a dark corner somewhere, a dimmer display is better, otherwise I might need the maximum brightness.  But the dimming (PWM or DAC-controlled) is mostly to make the display turn on and off smoothly, especially if I choose to let it turn on automatically for a few minutes if connection drops or reconnection is made.  Having something flicker on/off too suddenly can be distracting; hence, the popularity of "breathing" indicator LEDs.

There is quite a lot to learn, to design your own decent transistor circuits.  Especially ones which will control the current well, and cope with what can be quite wild (big), variations in Hfe and other transistor parameters.
What you seem to have drawn out, looks like you are somewhat nearer the beginning of such a journey, rather than being close to the end of such a journey.

I am, absolutely!  I am a complete Uncle Bumblefuck in the early Suck-Hard-and-Fail-Often part of the learning curve in electronics circuits, definitely!  Especially so when it comes to current control.  I've played with sensors and voltage-based stuff, but not much with current-controlled/dependent things like LEDs.  I do have done electronics courses (but I focused on digital logic!), so I know how to read and draw circuit diagrams (badly that, I admit!); I just have almost no experience with practical circuits and especially known good approaches.  Which is why I asked, and am very grateful for everyones support in this thread, yours definitely included.

I might get torn to pieces, for saying this, on the forum.  But I have been led to understand, that even if you design transistor circuits, every day, for a living, and have done so, successfully for the last five or ten years (which was much more common in the 1960s and 70s).  You still have much to learn about electronics and transistors.

Bah (to being torn to pieces); the same applies to software development as well.  Even though I've been paid to write code in half a dozen different programming languages off and on during the last three decades, I still learn more just about every day.  And I still have much to learn about programming.

If you're determined for precise/individual current control, and designing it yourself.  You could either go the op-amp route, or the various integrated circuits, specifically designed for driving LEDs, at precise currents.  But I don't think those are necessarily/usually used in relatively simple backlight schemes, which your display, seems to have/need.

True, and I agree: this is quite over the top.

Perhaps a better way to look at this project of mine is to consider it a tool for hobbyists like me using this display (with Teensy 4 or similar microcontrollers –– I do intend to use parallel I/O for this), with lots of options on tuning it.  The component count (7 SOT-23 packages and 10 passives in 0805, 14 passives if I double the positions for the current setting resistors) may seem high, but I find it acceptable due to adjustability it gives me.

How constant is the temperature?

Ambient will be between +15° and +40°C, and I do not care if the display brightness changes a bit (say, current varies by 5% within this range) depending on the ambient temperature.

How accurate does the current need to be? If it needs to be well-regulated, then the only sane way is with an op-amp and voltage reference.

Only accurate enough to not yield visible artefacts.  Say, 1% peak-to-peak maximum noise.

The reason for using REF3333 is that there might be some step-like fluctuations on the 3.3V rail from the MCU.  It is quite true that a couple of capacitors or a Pi filter would probably stabilize it just fine, but considering how easy and cheap it is to just throw a reference and a couple of capacitors there to be sure, I'm, uh, happier with the latter.

Something like MCP6009 (quad RRIO op-amp) could drive the LEDs directly, is cheap (Mouser has stock, <0.5€ apiece), and if driven from +5V, should be able to drive up to 20mA per channel, in Howland current pump configuration –– but I don't see how to have the pumps share resistors, so that makes for 16 of them.  To allow adjusting the maximum current for each LED individually, I could just use a voltage divider between the reference and the positive input of each quad op-amp (or one in serial for global physical brightness knob, followed by one per op-amp positive input for tuning the per-LED maximum brightness).  Thing is, I don't have the experience to have an opinion how this would compare to the schematic I showed above.
The problem is the transistors will heat up. Here's a sweep of the temperature from 15oC to 60oC.
 
The following users thanked this post: MK14, Benta, Nominal Animal

Offline Benta

  • Super Contributor
  • ***
  • Posts: 6124
  • Country: de
Re: LED backlighting suggestions (4 in CC config, 3.2-3.4V 20mA)
« Reply #40 on: July 11, 2022, 09:33:15 pm »
@Zero999, Thanks, nice sim.
Since you already have the circuit and sim set up, I'd be really interested to see the result with the two diodes on the base of Q1 (plus series resistor) as in reply #23
 

Online MK14

  • Super Contributor
  • ***
  • Posts: 4835
  • Country: gb
Re: LED backlighting suggestions (4 in CC config, 3.2-3.4V 20mA)
« Reply #41 on: July 11, 2022, 09:35:50 pm »
The problem is the transistors will heat up. Here's a sweep of the temperature from 15oC to 60oC.

It doesn't look anyway nearly as bad, as I was expecting, from that circuit.  I thought the error, would be much worse than that.

The great thing about just PWM'ing it, on and off, is there is then no need to worry about the actual current level, either measuring it, or trying to control it.  The PWM ratio, will deal with it, all by itself.  You only need to choose the 0 to 100% of full brightness, job done.
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 6124
  • Country: de
Re: LED backlighting suggestions (4 in CC config, 3.2-3.4V 20mA)
« Reply #42 on: July 11, 2022, 09:42:03 pm »
Once again:
this is about Backlighting, meaning priority #1 is current matching. Not precision.
And I agree, a 10% current increase over 15...40 degrees is fully OK to my mind. The resistors are probably 5% anyway.
« Last Edit: July 11, 2022, 09:46:36 pm by Benta »
 

Online MK14

  • Super Contributor
  • ***
  • Posts: 4835
  • Country: gb
Re: LED backlighting suggestions (4 in CC config, 3.2-3.4V 20mA)
« Reply #43 on: July 11, 2022, 09:56:35 pm »
The problem is the transistors will heat up. Here's a sweep of the temperature from 15oC to 60oC.

What about very low brightness levels, for dark situations.  Would a very low backlight current, of perhaps 0.5mA per LED, increase to (perhaps) 5mA per LED (+1000% error), at low current levels, as the ambient temperature changes ?
 

Online MK14

  • Super Contributor
  • ***
  • Posts: 4835
  • Country: gb
Re: LED backlighting suggestions (4 in CC config, 3.2-3.4V 20mA)
« Reply #44 on: July 11, 2022, 10:14:58 pm »
Once again:
this is about Backlighting, meaning priority #1 is current matching. Not precision.
And I agree, a 10% current increase over 15...40 degrees is fully OK to my mind. The resistors are probably 5% anyway.

I'd prefer to know for definite, if the LED current affects the colour gamit, for their display, in a noticeable/problematic way.  If it does, then PWM would probably be the best way forward.

If that means the display noticeably increases in brightness, all by itself, as it self heats, over time.  Some people, might find that annoying/distracting.
I have a display which does that sometimes, and it somewhat annoys me when it does it.  I don't think it is because of heating effects, it probably is because its ambient light sensor, sometimes decides to move the brightness level around (probably because of an ambient light sensor, that sometimes gets covered by a finger or something).

EDIT:  In all fairness.  You're basically right in what you just said, and the temperature changes are probably small and slow enough, to probably NOT be noticeable anyway.  Also I have a sneaking suspicion the LEDs colour gamat will be just fine, at lower currents.
« Last Edit: July 11, 2022, 10:22:21 pm by MK14 »
 

Offline Nominal AnimalTopic starter

  • Super Contributor
  • ***
  • Posts: 6715
  • Country: fi
    • My home page and email address
Re: LED backlighting suggestions (4 in CC config, 3.2-3.4V 20mA)
« Reply #45 on: July 12, 2022, 01:24:33 am »
(In QUCS, if I use 330 and 680 ohm resistors, with 17 Ohm current set resistor, I do get ~ 37mA or so LED current.)

I'm also really liking the belt-and-suspenders approach where I can use resistors (footprints for at least two in parallel per LED) to control the maximum current per LED; an I2C DAC controlled by MCU to ramp brightness up and down; and a physical potentiometer that controls the overall/maximum brightness (as a voltage divider following the DAC); and a P-channel MOSFET to turn the entire backlight subsystem off when not needed by cutting off +5V LED supply.
The benefit of a physical potentiometer instead of MCU control is that I don't need to store the state in nonvolatile memory (EEPROM, Flash).

Be careful what you wish for.
True.  I duplicated the schematic and got garbage results (attoamp currents).  I then made a simple voltage divider, but couldn't get that to work properly either; the voltage supplies stay at zero.  I don't care which one of us (me or KiCad) is at fault, but that workflow doesn't work for me, that's for sure.

Caneda passed the same test, and it supports defining transistor SPICE models, using ngspice.  Nexperia does have spice subcircuit models for both BC847C and BC857C, with B=1 C=2 E=3 pinning, so I think I'll play safe, and create the proper symbols too.  (The BC847C,235 and BC857C,235 in SOT-23 I intend to use are from Nexperia.)
And then, I'll simulate the base-emitter voltage as a function of collector current and DC current gain, and compare to the datasheet curves.
It'll take a bit of extra effort, but hey, then I know.

I'd prefer to know for definite, if the LED current affects the colour gamit, for their display, in a noticeable/problematic way.  If it does, then PWM would probably be the best way forward.
I don't have suitable measurement hardware, and I don't trust my eyes alone for time-dependent data.  (I cannot right now compare two side by side.)

My personal opinion in this case is that I care less about the color reproduction – I mean, these are pictograms and illustrations and not photographs –, and more about flicker (low PWM frequencies) and avoiding possible PWM whine.  If photographs or video were to be displayed, then I'd probably feel differently.

If that means the display noticeably increases in brightness, all by itself, as it self heats, over time.  Some people, might find that annoying/distracting.
I have a display which does that sometimes, and it somewhat annoys me when it does it.  I don't think it is because of heating effects, it probably is because its ambient light sensor, sometimes decides to move the brightness level around (probably because of an ambient light sensor, that sometimes gets covered by a finger or something).
True; I find brightness pumping very annoying.  Hmm.. Perhaps I should switch to two diodes in place of R5 in my schematic.

Any suggestions on a suitable SOT-23 diode pair to use here?  Nexperia BAV99,215 is dirt cheap, available, and according to its datasheet, its forward voltage per diode at 1mA current is 0.35V (150°C ambient) / 0.5V (85°C) / 0.6V (25°C) / 0.75V (-40°C ambient), at 0.1mA 0.20V/0.35V/0.5V/0.75V correspondingly; and it can handle 125mA across both diodes.  So, seems like a good fit here (and I also found its spice model)?
 
The following users thanked this post: MK14

Online MK14

  • Super Contributor
  • ***
  • Posts: 4835
  • Country: gb
Re: LED backlighting suggestions (4 in CC config, 3.2-3.4V 20mA)
« Reply #46 on: July 12, 2022, 02:00:08 am »
You might find this article interesting.  It seems to include details on how to use an op-amp and resistor, with optional DAC brightness control, for LED backlight dimming.

https://www.allaboutcircuits.com/technical-articles/the-basics-behind-constant-current-led-drive-circuitry/

So, you'd need at least a quad pack op-amp IC and 4 resistors to detect/set the current levels.  Plus your DAC chip, or PWM to voltage circuit, to control the brightness level (current demands).
« Last Edit: July 12, 2022, 02:02:06 am by MK14 »
 

Offline Nominal AnimalTopic starter

  • Super Contributor
  • ***
  • Posts: 6715
  • Country: fi
    • My home page and email address
Re: LED backlighting suggestions (4 in CC config, 3.2-3.4V 20mA)
« Reply #47 on: July 12, 2022, 02:44:57 am »
You might find this article interesting.  It seems to include details on how to use an op-amp and resistor, with optional DAC brightness control, for LED backlight dimming.
I've read that.  The circuit shown – LED between inverting input and output of the op-amp, with resistor from LED cathode to ground – only works for separate LEDs; mine share a common cathode.

If I understand correctly, the Howland current pump op-amp configuration would work (I mentioned this in #30) with e.g. MCP6009, but I don't see any way of reducing the number of resistors down from 16 for the opamps alone: four per opamp, all the same resistance.

(Interestingly, there are small I2C and SPI DACs available with an internal 1.2 V to 1.24 V reference, often with a ×2 optional gain, so if one had completely independent LEDs, one could use such a DAC and a 60Ω/62Ω or 120Ω/124Ω resistors for the maximum 20mA current. I.e. DAC → global dimming voltage divider → optional divider to adjust max. current per LED → op-amp per LED.)
 
The following users thanked this post: MK14

Online MK14

  • Super Contributor
  • ***
  • Posts: 4835
  • Country: gb
Re: LED backlighting suggestions (4 in CC config, 3.2-3.4V 20mA)
« Reply #48 on: July 12, 2022, 03:48:54 am »
You're right.  I failed to appreciate how hard it would be, with the complication of NOT having separate access to BOTH LED leads.  It was only when I finished drawing the schematic, I found out, the difficulty.

There are LED driving ICs available, but the ones I saw use PWM, at around 32kHz or 65kHz, but I remembered you don't want any PWM, so I haven't posted about them.

I'm surprised, to see transistor circuits, beating op-amps here, because of the common connection LED issue.

You could use a single op-amp, to control the current through all 4 LEDs, using an external pass transistor.  But you don't seem to want to, because of concerns over possible inter-LED brightness variation.

EDIT:  I suspect it can be done, by using an additional transistor, for each op-amp.  But I was trying to offer a simpler alternative, and failed to do that.
« Last Edit: July 12, 2022, 04:02:40 am by MK14 »
 
The following users thanked this post: Nominal Animal

Offline Nominal AnimalTopic starter

  • Super Contributor
  • ***
  • Posts: 6715
  • Country: fi
    • My home page and email address
Re: LED backlighting suggestions (4 in CC config, 3.2-3.4V 20mA)
« Reply #49 on: July 12, 2022, 04:53:01 am »
It was only when I finished drawing the schematic, I found out, the difficulty.
This happens to me all the time –– so much so that I need to sketch out or test my suggestions first, before posting it (wrt. programming advice; hence the archive of test cases I have). ;)

There are LED driving ICs available, but the ones I saw use PWM, at around 32kHz or 65kHz, but I remembered you don't want any PWM, so I haven't posted about them.
PWM over 30kHz is okay, since it's inaudible even to me.  The diode-compensated one seemed (simulated using QUCS, using models I now suspect are bad) to be limited to sub-kHz PWM frequencies, as otherwise I'd lose the low end; I'd like to be able to get under 1% PWM duty cycle (in the LED current).

The common cathode ones like TI LM27951 seem to be difficult to obtain, that's all.  Do you know of any suitable parts that are still available?

I suspect it can be done, by using an additional transistor, for each op-amp.
Yes; negative input to emitter of an NPN transistor, base to output, positive input gets control voltage. Load is between collector and ground, and sense resistor from positive supply to emitter.  Very similar to what we have here, just more stable (due to feedback) and somewhat more complicated, replacing the common BC847C NPN transistor with per-LED op-amp.

I do believe MCP6009 (quad op-amp I have spice model for) would work, and is cheap enough, so it would be feasible, especially with a DAC that has an internal voltage reference, say MCP47FVB01, so one could omit the reference voltage (again, absolute accuracy is not as important as stability is, and temperature range is rather limited).  So, DAC from 3.3V supply with internal bandgap reference at 2.44V, followed by a potentiometer in a voltage divider configuration for physical brightness control, followed by quad opamp with PNP FET or P-channel MOSFET each.

So much to try and experiment, so much to learn! ^-^
 
The following users thanked this post: MK14


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf