Friday, December 9, 2022

0000 0000 1011 0011

Shifting voltages (3.3V to 5V)

Shamed by PileOfStuff into finally upgrading my Christmas lights, I ran into an all too familiar problem.

Kent sensibly acquired and continues to use the ESPixelStick as his hardware/software for his lights, but due to my laziness and disorganisation I would not be able to get one into the country in time for the current festive season.

Also - due to a late night buying spree, I happen to have a lot of ESP8266 (ESP-01s versions).

Furthermore, I have in the past desoldered the paltry 1Mb flash and upgraded the memory to 4Mb so a LED loving webserver should be possible (more on this in a later post).

Amazingly - I managed to get all of the hardware and software sorted and then...major disappointment! The data output from the ESP8266 (3.3V) is insufficient for the WS2811 chip (5V) to be happy.

A few fizzly lights later and a bit of looking about on the interwebs and I was down the "level shift" rabbithole.

This blog post and video is about the first part of this journey. I started with a CMOS chip (the CD4081) with the intention of using it to level up the signal voltage to 5V.


It didn't work as expected! A really big rabbithole later I found out that CMOS chips usually need a 3.5V minimum for "High" to be registered, and we have 3.3V coming out of the ESP8266 - whoops!

Therefore, halfway through the attempt I swapped out the CD4081 CMOS IC for a TTL chip, the SN74HCT14N which is a hex inverter.

TTL chips (at least this one) describe a minimum voltage for registering a "HIGH" as 2.7V, well under the 3.3V that is arriving at the GPIO. 

A hex inverter! Hex as in "evil curse" because I've had to use these inverters so many times now - they just keep haunting me.


Wiring the whole thing up worked a treat - and the level shifting was done. I was able to start with a pulse from a 3.3V source and output a 5V signal.

Part Two of this blog and video will be using this new found level shifting knowledge to connect a 3.3V data line to the 5V LEDs and trying out a few options. Stay tuned!


 




No comments:

Post a Comment