We don't neeed no steeenkin level shifters! Hey there fellow enthusiasts,

We don’t neeed no steeenkin level shifters!

Hey there fellow enthusiasts, thought I’d post a method I’m using to drive 5v WS2812s from 3.3v ESP8266s from a single 5v supply, without the need for level shifters or voltage regulators.

Super simple circuit, cheap, and super reliable (I’ve built over a dozen of these with zero hassles).

Hope it helps!

Check out: https://www.youtube.com/channel/UCkomrWJWXxF2rSE4lJ8KrKA

Electrical engineering is sorcery.

What are the limits to this technique? You have to measure the voltage drop over the particular diodes you’re using; but does this ever change? I guess those diodes will have to dissipate some power depending on how much current whatever they’re driving draws, is the forward voltage drop stable with temperature changes?

THIS is pretty genius! Seriously, probably the smartest solution I’ve seen so far. And so simple.
Unfortunately it’s limited to controllers without analog in. At least you can’t use them anymore because analog is measured against gnd.
Well maybe the teensy is an exception here because of the analog gnd pin. But it’s a question if this really works.

@Robert_Atkins
Hi - well, keeping in mind that the diodes only need to support the ESP (which uses only a tiny amount of power), then as long as you use the diodes within spec (and even though I’m using ‘rectifier’ diodes in DC mode…), I’d have to say that there are no ‘limits’ to this technique. Using diodes for voltage offset is quite common (I’ve just never seen it used in this particular way, though that’s not saying much).

Every type of diode has a specified voltage drop range, and this is pretty consistent regardless of voltage or current across the device (of course, as long as these stay within specified limits).

For example, onsemi state (http://www.onsemi.com/pub/Collateral/1N4001-D.PDF) Maximum Full−Cycle Average Forward Voltage Drop, (IO = 1.0 Amp, TL = 75°C, 1 inch leads) as 0.8v – which is very close to the 0.77 / 0.78 I measured.

Rough measurements show that an ESP draws approx peak 320mA @3.3V on startup (generally only a few seconds), normal operation connected to an AP: 35mA average, as an AP: approx 80ma, with peaks of 290+mA during packet operations.

Since these diodes can carry considerably more current (relative to the pretty miniscule draw of an ESP) – Average Rectified Forward Current (single phase, resistive load, 60 Hz, TA = 75°C) of 1A – and are rated at pretty extreme temps (−65 to +175 degrees C), I’ve never ever had an issue with stability, power dissipation (never even noticed the diodes getting warm), or voltage drop behaviour.

The only thing I do is measure forward voltage drop whenever I get a new batch just to be sure (you can never be too careful with Aliexpress etc components).

@Sven_Eric_Nielsen
Thanks! Can’t really take a lot of credit though as I’ve seen this sort of technique used many times before (with diodes, transistor vregs, and package vregs) – just not in this specific application, so thought it might be fun to share.

Re using the analog in – wellllll… it depends… If your input voltage never drops below the ESP’s 0V then you’re fine, otherwise you can always use a simple bias circuit to compensate. Mind you, if you’re using the ADC then you probably need to condition the input anyway, and circuit complexity starts to go up regardless, at which point this technique might not be appropriate / necessary / relevant as the ‘cost’ of using a ‘proper’ level shift is relatively much less.

I think this technique is best for when you’re trying to keep the overall design as simple and cheap as possible and, for some people, using a couple of diodes is significantly easier & more do-able than using level shifters.

Cheers!

Cool solution. this will work until it doesn’t :wink: Like Rob said “Electrical engineering is sorcery” sometimes its easier to spend the extra $1 to use something like a sn74hct245 ( http://www.ti.com/lit/ds/symlink/sn74hct245.pdf ) or spend the 10c on a spare pixel and use it as your booster(null pixel). This is a cool solution but its not a catch all. I agree its a great idea if you want to keep your parts count and price low.

Great idea and very well explained. The beauty is that almost everybody has 1N400x or 1N4148 Diodes laying around.
Thank you very much for sharing.

@Juergen_Bruegl
Cheers!

@Leon_Yuhanov
Thanks - I would be really curious to know what failure modes you envisage. Whilst it’s worked really well for me so far (over a dozen implementations, some running literally months at a time), I’m always happy to learn more.

Re using something like sn74hct245 – I agree that there are many “better” solutions than what I propose, but I think it depends on circumstance. Horses for courses. A lot of people find it much easier to wire a couple of diodes in line with power leads than to use a multi pin DIP/DIL/etc package with possibly additional support components.

Just out of interest – I originally created this solution as I was helping out my local scout group. They were looking for a cheap and simple kit of parts to make something cool for group camps, as well as to earn badges. USB power brick, some cables, a couple of diodes, a Wemos D1 mini, some heatshrink, a plastic systema box, some gommets & cable ties, and a couple of WS2812 strips. All up cost $10-$15 per unit. Easy to solder together even for younger kids.

With basic firmware already loaded, the kids spend about an hour assembling and voila, a very cool dynamic coloured LED string. Also forms the basis for a pretty much unlimited expansion and innovation. I’ve helped kids attach switches & sensors; set up the Wemos as a wifi access point serving pages to control effects in real time (with colour/brightness sliders working in realtime using websockets); instant OTA firmware updates; created pong & snake type games; set up a mesh of 10 sets all working & displaying effects together, etc etc etc. Quite a bit of fun really, and totally blew a few minds when the kids started really getting into the programming and creating. Especially when the parents realise that the kids have ‘built’ it themselves!

Re the null pixel – this actually addresses a different issue - which is driving longer lines and/or ‘cleaning up’ the signal. I’ve had many issues trying to drive undervolted WS2812s (ie from 3.3v), as well as overvolted ESPs, or just trying to drive a 5v WS with a 3.3v ESP without offset, whereas this design works flawlessly even over longer runs (up to a point - at which stage you also throw in a null pixel).

Anyway, thanks for the feedback!!

@LED_Head I get your solution, its perfect for what you described. The null pixel is by far the simplest for pretty much any set up though. Especially when you start using APA102/SK9822 pixels

I was once like you till last week when I brew out a ESP8266 ESP-12 and some pixels after a simple static discharge moving a strip. Found out how fragile these things really are.
A simply capacitor really does help.
The level shiftier thing is still new to me, but I like the concept so bought some from Jason.

I’ve never bothered level shifting. The WS28xx seem to trigger just fine off 3.3V signals, even while running at 5v and once you’ve sent the data to the first one, it repeats the signal at the operating voltage to the rest - 5V in my case.

I also power a small number (24led ring, for example or a 16led matrix) from the WeMos D1 just fine, at 5V.

The only thing I add is a smoothing capacitor.

But, I use the WeMos D1 almost exclusively and always run my LEDs at 5v and have no problem with long, long strings (250+ WS2812s) so I’m not sure what you are showing here… once you’ve got past the first chip, for WorldSemi chips, at least, your theory is not applicable. The signal line runs at whatever voltage your supply is at.