3.3v vs 5v

A project log for The Blinking Computer

An educational 16-bit CPU made from < 1024 transistors with lots of LEDs that anyone can build and learn from

tony-robinsonTony Robinson 01/27/2017 at 19:1714 Comments

Right now my #1 question to sort out is should I run this at 3.3v or 5v? 3.3v has the advantage that transistors switch faster, and I'm an optimiser so I would like this. However I love blue LEDs and have just bought a thousand of them, these are on max current when wired 3.3v -> LED -> NPN -> ground without a current limiting resistor. Should I worry that the LED might short and so blow the lot? (yes I think so). Also my new carry logic uses a diodes ladder which would like 5v much more than 3.3v (at a pinch I could use 5v just for this). So what should it be, 3.3v or 5v - I have yet to decide.

[ I've been out of the country on a work trip so haven't had any time for this in the last week and a bit - some new Schottky diodes have arrived and I need to stress test my new memory cell - time to take a day's holiday I think ]

P.S. it seems that there is a maximum thread depth which is stopping me replying directly below some of the comments. As a result they are appearing above which does confuse the flow.


Tony Robinson wrote 01/29/2017 at 12:08 point

@Ted Yapo - thanks - that makes a lot of sense.   So for "best practice" I want a resistor in there.  Picking 47ohm (fairly randomly) reduces the current to 5.8mA as measured.   The resistor limits the current to 70mA (3.3v/47ohm) which is just below the 0.25W the resistor is rated at.   So this seems like a good value, it's still bright enough I think, the visibility is limited more by angular resolution with distance than it is by luminosity.

So I didn't think I could do blue LEDs and 3.3v it seems that I can - many thanks!

  Are you sure? yes | no

Ted Yapo wrote 01/29/2017 at 15:57 point

Your LEDs will thank you :-)

Just for kicks, here's a quick LTspice sim using a white LED from the default library (it's a blue LED with a phosphor):

at 25C, without the R, it measures around 16 mA (yellow curve).  With the resistor, 5.6 mA (cyan).  These are close to what you're seeing.  If the die temperature of the LED rises to 100C, the resistor version still only draws 18mA, while the non-resistor version is approaching 100mA.

  Are you sure? yes | no

Tony Robinson wrote 01/29/2017 at 16:15 point

Wow - that's really great - thanks.   I've looked at SPICE simulators and settled on (as it does PCB layout and purchase) but haven't had time to really make anything work yet.   So much to learn.

  Are you sure? yes | no

Tony Robinson wrote 01/28/2017 at 18:08 point

[ Seems like there's a max thread depth so I have to post one level up]


That's encouraging, thanks.   I could still do with 5v for my diode carry chain, but I'm planning to use an old computer PSU so I'll have 3.3v, 5v and 12v available.

I've done quite a lot of lecturing in my time, and I'd like to travel to schools/universities with this.   So it needs to be small enough to travel with but big enough and bright enough to see from the back of the class.   I didn't know about "straw hat" LEDs until I found them on ebay, they are wonderful as wherever people are seated they can see them.   And yes, I'm planning on using at least 256 of them so it'll be bright.   But I'm old enough to regard blue LEDs as really cool still (red and green were fairly easy, blue meant that we could make white and so cut our carbon footprint for lighting massively).

I'm not trying to ignore state of the art - I'm trying to learn as fast as I can but I don't get a lot of time for this.

  Are you sure? yes | no

Eric Hertz wrote 01/29/2017 at 10:32 point

"and so cut our carbon footprint for lighting massively"


  Are you sure? yes | no

Eric Hertz wrote 01/30/2017 at 00:10 point

sorry... was on the white-LED/energy-usage bandwagon, too, long before the blues came around... now I see 'em increasing the carbon footprint by shear numbers of poorly-implemented designs that end up as waste.

You might be grateful I didn't submit the 3 page essay I wrote, here ;)

  Are you sure? yes | no

Yann Guidon / YGDES wrote 01/31/2017 at 18:21 point

@esot.eric go ahead and publish it on your profile :-)

  Are you sure? yes | no

Eric Hertz wrote 01/31/2017 at 19:53 point

@Yann Guidon / YGDES, thing is, I think I already did... many months ago... Oh, that one was about high-efficiency washing-machines... it probably meandered to LEDs and hybrid/electric cars, as well...

Don't want too many rants on my profile. And has nothing to do with this thread nor Tony's project. I can send you the latest, or countless other (and probably repetative) writings on the matter as a private-message if you're interested ;)

  Are you sure? yes | no

Yann Guidon / YGDES wrote 01/31/2017 at 19:58 point

Please share for the public good ;-)

  Are you sure? yes | no

Yann Guidon / YGDES wrote 01/27/2017 at 20:48 point

I'd say 3.3V. Or maybe even 3V : that's 2×AA batteries, and you might find adustable power supplies (some "open frame" units come with a trim pot) to power the blue LEDs directly.

I'm curious why using LEDs instead of resistors seems to accelerate the circuit, according to your experiments (or did I misread ?)

  Are you sure? yes | no

Tony Robinson wrote 01/28/2017 at 17:34 point

Thanks @Yann Guidon / YGDES.   Let's split this into two:

On blue LEDs, I can wire 3.3v -> LED -> NPN -> ground and the LED takes 15mA (I drop about 0.1V across the NPN and 3.1v across the blue LED, the PSU is giving 3.2v).   I guess the max is 20mA (these came from ebay so I'm not sure).    Anyway 15mA is fine for brightness, but if I decrease the voltage then it would be too dim.   If I increase the voltage then I need to limit the current through the LED, which has the advantage that if the LED "shorts" (I really don't know if this is likely or indeed possible, I just read it on the internet) then the current is limited by the resistor.   I'll be drawing about 10A anyway, so I need a PSU but that can't blow at 10A so that's quite a lot of current to do damage.   I'm also quite dependent on the voltage stability of the PSU, a small increase would increase the current through the LEDs quite a bit.    Every circuit I've see (except the LED flashlight ones that use the internal resistance of a button battery to limit the LED current) has a current limiting resistor and this is supposed to be an educational project so I don't want bad practice here.

On the use of LEDs in my previous (broken) memory cell design, it did definitely run faster with LEDs than resistors.  I was using white super bright LEDs and what I think was happening is that there was always about 2v drop across them, whether they were drawing much current or very little.   So my voltage swing at the junction of the NPN and LED was from about 0.1v (current into the base of the NPN switching it on) to 1.3v (no current into base, transistor off, but still a voltage drop across the LED).   This limited the charge stored in the other NPN of the flip flop, so decreasing the time it took to turn off (I've learned that it's turning transistors off that is the slow bit).   That's my theory anyway.   The ALU is much slower than the memory cell so I'm not worrying about speed too much right now.  I did find this YouTube video that claimes a 4 bit transistor CPU running over 1GHz, I hope they put more details up.

  Are you sure? yes | no

Yann Guidon / YGDES wrote 01/28/2017 at 17:54 point

don't freak out too much about failed LEDs. I have never seen one short.

Furthermore, driving a recent blue LED at 15mA is called "lighting", not "signaling" :-D You're going to light up the room with the computer !

Your diode flip-flop is something to investigate. You see ? Doing something while ignoring "the state of the art" can still yield surprises, even today. I'm sure @Ted Yapo, @esot.eric, @matseng and others would love to investigate this !

  Are you sure? yes | no

Ted Yapo wrote 01/28/2017 at 23:11 point

Hi Tony

I like what you're working on here :-)

One important function of a resistor in driving LEDs is temperature stability.  The forward voltage of the LED drops with increasing temperature, and the current vs voltage curve is very steep, so without a series resistor, the LED current can grow quickly as temperature increases.  This can lead to a phenomenon called thermal runaway - the LED heats a little so the forward voltage drops, causing it to draw more current, and this further heats the LED.  This is a positive feedback loop which can cause the LED to burn out.  This is why you don't typically see LEDs driven directly from voltage sources.  A series resistor turns the voltage source into a quasi current source which has much less dependence on the LED forward voltage.  You can see this behavior with some quick algebra or a SPICE simulation.

The other thing that series resistors help with is the manufacturing spread of LED forward voltage.  For a given applied voltage, the current drawn will vary from LED to LED, even for "identical" LEDs.  So, without a limiting resistor, some LEDs will draw more current (and maybe burn out more quickly).

As Yann mentions, 5mm LED shorts are typically not an issue.  The bond wires make decent fuses, so they fail open.

  Are you sure? yes | no

Eric Hertz wrote 01/31/2017 at 20:11 point

Haven't got much to contribute... I'd agree that most-likely failure of an LED is open-circuit rather than short-circuit (Imagine if it were, and all those strings of LED "holiday festive" lights connected directly to 120!)

However, I have definitely seen failed BJTs shorted.

And, in talking about educational/best-practice, I'd definitely say use a resistor, but it could be a pretty small value, and 3.3V might still work for yah.

Interesting regarding the LED's biasing(?) of the transistor. It's been running in the back of the mind since Yann linked to this, Great theory, and does  indeed sound a bit like Ted's CBJT logic running at 0.8V, where the base-emitter voltage of the next stage replaces that of the LED, in this design. Educational, for sure!

  Are you sure? yes | no