Electronics > Projects, Designs, and Technical Stuff
One MCU port pin state(low, high, Hi-Z), 3 LEDs Design Challenge
<< < (3/3)
Ian.M:
As I said earlier my solution is tweakable:

--- Code: ---l_id1: i(d1)=-1.68828e-008 at 0.5
l_id2: i(d2)=0.00210069 at 0.5
l_id3: i(d3)=9.20373e-007 at 0.5
h_id1: i(d1)=0.00208944 at 1.5
h_id2: i(d2)=-1.68424e-008 at 1.5
h_id3: i(d3)=9.00493e-007 at 1.5
t_id1: i(d1)=8.98131e-010 at 2.5
t_id2: i(d2)=-8.52647e-010 at 2.5
t_id3: i(d3)=0.00210052 at 2.5

--- End code ---
so that's an almost exact 2.1mA for  all the  LEDs will all off  state currents under 1uA, just by fine  tuning the (E24) resistor values, still at  10  'ebcl cost' units.   Also due to my chosen topology, lower voltage  LEDs (all same type) can be  used without risk of 'shootthrough' increasing the off state current, simply retune the  resistors to get  back to the current  performance.

Interesting 'torture tests' for any design to check its real world practicality, are to check the effect of supply voltage  variation  e.g. +/-5% or +/-10% or to inject  a  +/-1uA leakage current when the  I/O is tristate, or to override the LED models and inject a +/-0.1V Vf  variation between LEDs, and see how badly our carefuly polished results degrade.  Unfortunately setting up LTspice to Monte-Carlo  passive  tolerances is quite  complicated, but  I'm sure that would also be educational.  >:D
Someone:

--- Quote from: eblc1388 on May 06, 2020, 12:47:25 pm ---
--- Quote from: Someone on May 06, 2020, 12:06:58 pm ---You can drop the diode if there is scope to carefully select the Vf of the LEDs
--- End quote ---
Thanks for taken up the challenge.

Current in the third LED is only half that of the other two and there are still 0.2~0.5mA flowing which will light up the LED, with or without the diode.

--- End quote ---
Depends on the LED and, the diode, and if your models match the real world (they don't).

In that configuration, with identical Vf LEDs, you end up with 1uA or less flowing in the bypassed junction(s). Compare your theoretical result with the actually measured 20nA. Even in a dark room its not visible unless you cover over/hide the other LEDs. Selecting a suitable Vf makes all the difference when you're specifying a fixed voltage supply.
Someone:

--- Quote from: MK14 on May 07, 2020, 12:23:18 am ---Starting with your Red Led model.
I seem to get about 1.3ma (on one Led), and around 1.7ma on the others.
I'm happy with this (and want to minimise the component count), as I expect it would look ok, for indicator use leds.
But, if anyone insists on it being closer to the OP's stated puzzle requirements.
--- End quote ---
Stated requirements are a suitably vague "All LEDs same type, drive current around 2mA" I would have thought that less than a factor of 2 would be well within "around". Hence a proposed 1.3mA/2.8mA solution.

Indicator LEDs are really non-critical for any more precision, just look at the binning ranges of typical LEDs used.
Ian.M:

--- Quote from: Someone on May 07, 2020, 05:47:47 am ---In that configuration, with identical Vf LEDs, you end up with 1uA or less flowing in the bypassed junction(s). Compare your theoretical result with the actually measured 20nA. Even in a dark room its not visible unless you cover over/hide the other LEDs.
--- End quote ---
Light leakage within the case from an adjacent LED that's on is far more likely to be objectionable, unless there's an opaque separator between them gasketed to the board.  All-in-one multiple moulded light-pipes *SUCK* in this respect!

--- Quote ---Selecting a suitable Vf makes all the difference when you're specifying a fixed voltage supply.

--- End quote ---
Yes. Vf vs  Vcc can be rather critical - which is why I suggested sweeping the supply voltage, as most real-life 5V supplies wont be better  than +/-5% and many at the cheap end of the market are significantly worse once you've factored in variation with load, and unit to unit.

To do the Vcc sweep, mod my sim (or sims based on my template)  to make the value of source Vsupply {VCC} and add the command .step param Vcc 4.5 5.5 0.02, (for 51 runs, enough to get reasonably smooth curves over a +/-10% Vcc range) then in the SPICE error log right-click and select 'plot .stepped .meas data'.  You then have to add all the traces you  want, one at a time from the right-click add trace dialog.  You'll need multiple  plot panes, one for On state, one for low leakage Off state, and  probably another for Off state compromises, as its impossible to see the variations between traces three orders of magnitude down on the ones setting the  plot scale.  As its a PITA to set up, don't forget to save the plot settings of the resultingSimName.log.raw plot window so it remembers the selected traces and their panes next time you run the sim and re-select 'plot .stepped .meas data'.



As you can see, my  tweaked TriLED sim is reasonably good over a +/-5% Vcc range, but certainly wouldn't tolerate +/-10% variation.   That's mostly down to my choice of MOSFETs as I initially selected ones with relatively high threshold voltages  for  no good reason so LED D3 is current starved at low Vcc s the MOSFETs only have Vcc/2 gate voltage.  If I pick different MOSFETs, (e.g. PMOS Si1013, NMOS BSS123, chosen for low Vto in their SPICE models), it can tolerate over +/-10% Vcc variation, with a drastic improvement at the low end.
MK14:

--- Quote from: Someone on May 06, 2020, 12:06:58 pm ---You can drop the diode if there is scope to carefully select the Vf of the LEDs

--- End quote ---

I like your circuit. But, can we do better ?
(Strictly speaking, it is against the 'all leds must be the same' rule).

Just have 3 Leds and 2 resistors, ONLY. In your circuit.
Make the third led a high(er) Vf one, such as white (and some/all blues). E.g. Vf around 3.6V.
Leave out (short) the signal diode.
Then use lower Vf leds (e.g. Vf 1.9V Red) for the other 2. Such as Red, Green, Yellow etc.

EDIT:
CORRECTION. You had already said similar/same in your description. I had mainly concentrated on the circuit diagram.  :palm: :palm:
Navigation
Message Index
Previous page
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod