Is it possible to use 1N4004 rectifier diode to drop forward voltage?

Hi, In previous thread I was figuring out why my leds wouldn't light up or act weird and saw that my esp8266 controller does not like the power I was providing to it (~5.2V). Then I started looking into a way to drop voltage by a bit to keep it under 5V.
Yesterday I saw some advice on internet to use diode to drop voltage by 0.7. So to this schematics:

I added 1N4004 diode(and later when it worked not as expected, I also added a pull up resistor(because I saw in some example on internet, but I think I misunderstood that example)

I am missing some knowledge of how diode/electricity works, cause the result I got was:
When I added only diode:
Controller was powered with 4.8V, but LED strip was having 1.3V.
When I additionally added 22ohm pullup resistor, led stripe voltage increased to 1.7 and controller voltage dropped to around 4.3V.

Am I doing something crazy here? Would that change things if I'd use schottky diode instead?
Should the schematics be revired in some other way?

Any other approach you could recommend?
given that I'd like to stick with this power supply and voltage dividers I saw usually require higher input voltage

Thanks

Hi,
Please double check your wiring, it sound like something is in the wrong place.
In your diagram, you do not need the 22R resistor.
Where are you measuring the 1.3V then 1.7V?

With the resistor removed and the strip connected to the Vcc, what voltage do you get between gnd and Vcc AT the LED STRIP connector.
What voltage do you get from gnd to Vu or the cathode of the diode D1?

Thanks.. Tom.. :slight_smile:

5.2V is perfectly fine to drive this or any other 5V device, the problem must be that the LED stripe
wants a 5V signal level, so a level shifter on the data line is the way to fix this, surely?

MarkT:
5.2V is perfectly fine to drive this or any other 5V device, the problem must be that the LED stripe
wants a 5V signal level, so a level shifter on the data line is the way to fix this, surely?

I am using MeanWell 5v source(actual output 5.2V) to power both esp8266 and ws2812b(see 1st pic). I was having weird behavior. LED's lighting up and freezing after working couple of seconds or glitching, etc.

Eventually what I did:
Connected a lab power supply, started with 4.9V and gradually increased voltage, when it got to 5.2 LED's started glitching again.
Dropped down to 4.9 - was working just fine again.

So I figured it's a controller that does not like 5.2V.
One mistake that people pointed me out in this forum was that I was feeding it to VIN, because it uses volt divider. Now I am using VU to power up arduino.

Also I am not sure what level shifter is. Do not get many hits on internet about it.

TomGeorge:
Hi,
Please double check your wiring, it sound like something is in the wrong place.
In your diagram, you do not need the 22R resistor.

I will remove it, thanks.

TomGeorge:
Where are you measuring the 1.3V then 1.7V?

With the resistor removed and the strip connected to the Vcc, what voltage do you get between gnd and Vcc AT the LED STRIP connector.
What voltage do you get from gnd to Vu or the cathode of the diode D1?

Thanks.. Tom.. :slight_smile:

With diode, without 22ohm resistor here are the readings:
gnd and Vcc AT the LED STRIP connector: 1.3V
gnd to VU: ~4.8V
gnd to cathode: 5.2V
When I disconnect controller, then voltage at gnd and Vcc at led strip becomes 5.2V.

So something starts happening with the voltage at led strips once current starts flowing to VU.
I did double check wiring couple of times.

Hi,
Can you post some pictures of your project so we can see your component layout please?

The cathode of D1 and VU should be the same, look at your circuit diagram.
The cathode of the 1N4001 is the end with the strip around it.
download.png
Vcc at the Strip connector should be the same as Vcc, look at your circuit diagram.

Thanks.. Tom.. :slight_smile:

simisimis:
I am using MeanWell 5v source(actual output 5.2V) to power both esp8266 and ws2812b(see 1st pic). I was having weird behavior. LED's lighting up and freezing after working couple of seconds or glitching, etc.

Eventually what I did:
Connected a lab power supply, started with 4.9V and gradually increased voltage, when it got to 5.2 LED's started glitching again.
Dropped down to 4.9 - was working just fine again.

So I figured it's a controller that does not like 5.2V.

5V devices are commonly specced at +/-0.5V.

Have you tried controlling the LED strip with a 5V logic signal with the strip powered at 5.2V?
My strong intuition is it would be fine. By increasing the LED voltage, you are increasing the
logic threshold voltages of its input signal.

Yep, those pixels don't work very reliable with 3v3. As you noticed by increasing/decreasing the voltage you're working right on the threshold of the data. Insert a level shifter and you'll be fine :slight_smile:

Few questions. How many LEDs are you using?
Could you provide a picture of your project?
Something sounds like it’s not connected correctly but can’t tell from your description

TomGeorge:
Hi,
Can you post some pictures of your project so we can see your component layout please?

The cathode of D1 and VU should be the same, look at your circuit diagram.
The cathode of the 1N4001 is the end with the strip around it.
download.png
Vcc at the Strip connector should be the same as Vcc, look at your circuit diagram.

Thanks.. Tom.. :slight_smile:

Sorry, I must have checked some wrong google image pic. Thought by cathode you meant anode.
Cathode is at the same voltage as VU: ~4.8. Anode(before current gets to diode) is at 5.2.

MarkT:
5V devices are commonly specced at +/-0.5V.

Have you tried controlling the LED strip with a 5V logic signal with the strip powered at 5.2V?
My strong intuition is it would be fine. By increasing the LED voltage, you are increasing the
logic threshold voltages of its input signal.

I tried connecting this 5.2V to led strip only while powering nodemcu esp8266(esp-12E) through usb. It worked fine.
it only stops working when I power esp8266 with 5.2V.

About level shifter I am not so sure, if you guys have any url or some code of a level shifter that would work I could google what that is and how it is used.
I guess I was wrong thinking that it should be real easy to split voltage into 2 "channels", leaving 1st one untouched and feed led strip as 5.2V, and make 2nd with added resistor or diode or voltage divider and make it as 4.9V or 3.3V and feed controller

wolframore:
Few questions. How many LEDs are you using?
Could you provide a picture of your project?
Something sounds like it’s not connected correctly but can’t tell from your description

Currently testing with 10leds and I am able to reproduce the problem.
Using neopixel library with strandtest example. The only thing I altered in that example other than change pin number and led count is reduced brightness to 32.
Eventually I will be using 128LEDs.

I do not have a picture atm of that thing. But physically it's a very primitive little prototype board with soldered contacts allowing me to screw in psu wires, push controller into it and plug in LED strip.

simisimis:
I guess I was wrong thinking that it should be real easy to split voltage into 2 "channels", leaving 1st one untouched and feed led strip as 5.2V, and make 2nd with added resistor or diode or voltage divider and make it as 4.9V or 3.3V and feed controller

The problem is not the ESP getting 4,9 or 5,2V, but it's the strip. It's threshold of a logical 0 or a logical 1 depends on the supply voltage. And the strip just isn't designed to get 3,3V data. So you're just balancing between a 0 and a 1 even when supplied with 3,3V.

Simple level shifter. I expect that to work fine even with the high data rate of the Neopixels.

I am missing something here. In which part of my schematics I am providing 3.3V?
Cause I am trying to feed ESP with 5V and I am feeding led strips with 5V.
Do you mean that data line then provides 3.3V to the strip?

found this post. explained a lot
It does seem like a level shifter is a way to go here

simisimis:
I am missing something here. In which part of my schematics I am providing 3.3V?

First post, right from D7. An ESP is a 3V3 device. When powered from 5V all the board does is drop that to 3V3 for the ESP. Digital outputs are still 3V3!

And, although a lot of peoples suggest an ESP is 5V tolerant, officially it's not and you should not provide more then 3V3 on an input either.

thank you guys. glad I finally got an idea of what is happening there. Ordered lever shifter.
Should I also get some volt divider and convert 5v to 3.3V to feed ESP?
It feels like it won't add much of benefit since this controller has voltage divider on board and converts voltage internally anyway
By the way, I am using lolin v3 nodemcu esp-12e module and not esp8266 alone.

I don't have a lolin v3 nodemcu but did a quick Google. It seems like the GPIO is just straight from the ESP. Some claim the ESP is 5V tolerant but officially it's not. So yeah, to stay in spec you need a voltage divider or a level shifter if you want to interface something 5V. But for a lot of stuff you don't need it. For example buttons and open collector outputs of chips.

The power input to the board does not need (and must not have) voltage divider. The board has a regulator powered by Vin and outputting the 3.3 to power the chip. Never use voltage divider to supply power, only for data lines.

Voltage divider is generally necessary if interfacing output of 5v to an i/o pin of 3.3v chip. But the esp8266 is 5v tolerant; manufacturer has said as much, albeit not in the excuse for a datasheet, and hobbyists have confirmed this experimentally.

You do need to either levelshift voltage of data line for the leds up, or power leds with 5.0 volts - as noted above, the threshold for determining whether the data line is a 1 or 0 is based on the voltage supplied to the led strip, while the data line is always 3.3v logic levels. Level shifting is probably better.

Note that you do not need any exotic "level shifter", and especially not one that contains resistors!

A 74HCT14 with two gates in series is perfect (and you have four other gates spare), a 74HC14 will likely work as well. :grinning:

DrAzzy:
The power input to the board does not need (and must not have) voltage divider. The board has a regulator powered by Vin and outputting the 3.3 to power the chip. Never use voltage divider to supply power, only for data lines.

sorry I meant voltage regulator. I am new to this electronic world and its terms.

Paul__B:
Note that you do not need any exotic "level shifter", and especially not one that contains resistors!

A 74HCT14 with two gates in series is perfect (and you have four other gates spare), a 74HC14 will likely work as well. :grinning:

looked into those too, this is what I've found locally available. hope they serve the same purpose. I get often lost in all these code markings
SN74AHCT125N

simisimis:
I get often lost in all these code markings
SN74AHCT125N

The "HCT" means that it will work at 5 V supply with a 3.3 V logic input. Any IC so marked will do so by definition; there is nothing special about that particular one. :grinning:

in the end logic level shifter is what did the trick. Added SN74AHCT125N, removed added diode/resistor and now thing is working with 5.2V flawlessly. Thank you all for the input