MOSFET logic-level-shift question.

Thread Starter

water_y

Joined Aug 16, 2023
7
I try use these 2 circuits for WS2812 LED logic-level-shift,
circuit 1:
MOSFET use BSS138 (BSS138 datasheet), measure the WS2812-DIN(MOSFET - D pin) signal just about 3V level.
neopixel-level-shift.jpg

circuit 2:
MOSFET use BSS138 (BSS138 datasheet), the WS2812 data signal rate use 400KHz or 800KHz, CH1 (WS2812 - DIN) signal not correct, I guess the BSS138 has not sufficient electrical characteristics, some one can give recommend MOSFET model? or other reason?
s2.jpgs1.jpg
 

crutschow

Joined Mar 14, 2008
33,358
Since you show two different circuits, and didn't label what's in the oscilloscope picture, how can I know what the problem is?
 

Thread Starter

water_y

Joined Aug 16, 2023
7
Since you show two different circuits, and didn't label what's in the oscilloscope picture, how can I know what the problem is?
The oscilloscope picture measure from circuit 2, Channel 1 is WS2812 - DIN.
s2.jpgs1.jpg

Or can you recommend a similar simple circuit?
 

crutschow

Joined Mar 14, 2008
33,358
The problem appears to be the stray capacitances in the circuit are giving a slow rise-time to your output signal.
Do you really need such a high frequency to the LED driver?

Below is the sim of a circuit using two high switching speed BJTs with one acting as an emitter-follower output to give a faster switching speed;
Note that a common general purpose NPN such as an 2N3904 is not fast enough for this purpose.

Alternately you should be able to use a CMOS level-shifting IC such as the CD4504B or the CD40109B.

1692203986778.png
 

Thread Starter

water_y

Joined Aug 16, 2023
7
Do you really need such a high frequency to the LED driver?

Below is the sim of a circuit using two high switching speed BJTs with one acting as an emitter-follower output to give a faster switching speed;
Note that a common general purpose NPN such as an 2N3904 is not fast enough for this purpose.
Yes, WS2812 using a typical data transmission frequency of 800 Kbps.
Which parameter of transistor is the major factor to effect rise-time/switching speed?
 
I suggest you once test the channel 1 without connection to WS2812. When you have still the same problem, then you should modify your MOSFET Driver Circuit. For it you can use the ready chip high speed MOSFET driver, or make it yourself.
When without connection to WS2812 the signal is OK, then you can decrease the 10K to e.g 1K. Otherwise also in this case you better modify the MOSFET Driver part.
 

Thread Starter

water_y

Joined Aug 16, 2023
7
I suggest you once test the channel 1 without connection to WS2812. When you have still the same problem, then you should modify your MOSFET Driver Circuit. For it you can use the ready chip high speed MOSFET driver, or make it yourself.
When without connection to WS2812 the signal is OK, then you can decrease the 10K to e.g 1K. Otherwise also in this case you better modify the MOSFET Driver part.
Yes, I already tested without connect WS2812.
 

BobTPH

Joined Jun 5, 2013
8,112
I had exactly the same problem.

I originally drove the WS2812 from a 3.3V micro directly, and it worked 99% of time.

I tried to make a level translator from transistors but could not get the needed rise time.

I eventually solved the problem by using a line driver / buffer that had a logic level of 3V with a 5V supply. See post #4 in this thread for a link to the chip that worked for me.

https://forum.allaboutcircuits.com/threads/revisiting-problem-with-driving-ws2815b-strips.190337/
 

Ian0

Joined Aug 7, 2020
8,947
I had exactly the same problem.

I originally drove the WS2812 from a 3.3V micro directly, and it worked 99% of time.

I tried to make a level translator from transistors but could not get the needed rise time.

I eventually solved the problem by using a line driver / buffer that had a logic level of 3V with a 5V supply. See post #4 in this thread for a link to the chip that worked for me.

https://forum.allaboutcircuits.com/threads/revisiting-problem-with-driving-ws2815b-strips.190337/
74LVC1G17 is a good choice, because the LVC series have more accurately defined thresholds.
I suggested 74HCT because the maximum upper threshold is 2.4V.
Either way, it’s a one component solution rather than some of the complicated ideas I’ve seen in this thread.
 

BobTPH

Joined Jun 5, 2013
8,112
Ah, HCT = HC with TTL input levels. Wish I had known at the time, I like that the level is even lower than the one I used.
 

crutschow

Joined Mar 14, 2008
33,358
Which parameter of transistor is the major factor to effect rise-time/switching speed?
For a BJT, storage time, which may not always be given in the data sheet.

The clips from the data sheets below show how much slower switching a general purpose transistor is, such as the 2N3904, compared to one designed for saturated switching, such as the 2N2369A:

2N3904--
1692283077566.png

2N2369A---
1692284663962.png
 

Attachments

Top