Go Down

Topic: [SOLVED] Logic Level Shifter with 2N7000 not working (Read 2770 times) previous topic - next topic

PaulRB

I have been using one of the commonly available 4-channel logic level shifter boards between a Wemos Mini and a string of 50 ws2811 leds. Works great, all leds animating as desired, but I don't have any use for the other 3 channels in this circuit, so a bit of a waste.

Instead, I have attempted to level shift with a 2N7000 mosfet. The leds are resolutely dark. If I swap back to the 4-channel level shifter, everything works as before.

I am using a 5A 5V external PSU.

I don't have a 'scope, but I probed around a bit with my multimeter:

The mosfet gate is at 3.3V. Good.
The 5V supply reads 5.15V. Fine.
The mosfet source is around 0.58~0.60V. Obviously I am reading the average of a data stream.
The mosfet drain is at around 0.62~0.64V. Again, the average of a data stream. Higher than the source, but I expected something higher still, maybe around 0.85~0.90V, i.e. higher than the source by 5/3.3 = ~150%.



So, can anyone suggest what I'm doing wrong?

Thanks!

PS. I swapped the 2N7000 for a couple of others, in case the original was duff. No change. I suppose I could have an batch of 20 duff ones...

PaulRB

#1
Aug 19, 2018, 06:44 pm Last Edit: Aug 19, 2018, 06:48 pm by PaulRB
Here is another question that just came to me.

The 4-channel logic level shifter seems to contain only 4 mosfets (I assume that's what they are, labels say "J1Y" with the "Y" written sideways) and a few 10K resistors.

The board has ground pins in addition to pins for the 3V3 and 5V supplies. If it uses a similar circuit to the above, why does it need ground pins?


larryd

I have not seen a schematic of that board.
The GNDs on both sides of the board, would be convenient soldering pads to connect the commons between circuits.


No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

larryd

Are you using TO92s?

Maybe recheck pin out.

No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

PaulRB

I have not seen a schematic of that board.
The GNDs on both sides of the board, would be convenient soldering pads to connect the commons between circuits.
Thanks for replying Larry. I haven't seen a schematic of them either. I suppose the ground pins might be there for the sole purpose of grounding the ground plane, for safety reasons or for interference prevention at higher frequencies.

Anyway, the important question is why my 2N7000 shifter is not working!

PaulRB

#5
Aug 19, 2018, 07:32 pm Last Edit: Aug 19, 2018, 07:33 pm by PaulRB
Are you using TO92s?

Maybe recheck pin out.

Yes. And I did!

I even tried reversing the to92 just in case. I didn't measure with the multimeter with it like that, though.


larryd

Bad transistor?

Ground plain, maybe, probably just convenient soldering pads for connecting circuits.

Link to PDF level conversion board from Sparkfun:
https://media.digikey.com/pdf/Data%20Sheets/Sparkfun%20PDFs/Bi-Directional-Logic-Level_HookupGuide.pdf   

Let us check you wiring image.




No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

larryd

Hook up the 2N7000 as a simple inverter driving a LED to see if that works.


No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

PaulRB

#8
Aug 19, 2018, 07:47 pm Last Edit: Aug 19, 2018, 07:56 pm by PaulRB
Bad transistor?
I tried replacing with a couple of others. I could, of course, have 20 bad ones! Purchased x20 from eBay...

Let us check you wiring image.
I will re-build and photograph soon, maybe tomorrow evening.

Here is the circuit with the 4-channel board.

allanhurst

Your average voltage measurements are pretty meaningless.
Get a scope.

Or write a solid '0' and '1' to D5 and see what you get.

Allan.

larryd

#10
Aug 19, 2018, 10:08 pm Last Edit: Aug 19, 2018, 10:09 pm by larryd
I tried replacing with a couple of others. I could, of course, have 20 bad ones! Purchased x20 from eBay...
I will re-build and photograph soon, maybe tomorrow evening.

Here is the circuit with the 4-channel board.

I  do not see a wire connecting the two black GND busbars.   :o

No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

Grumpy_Mike

#11
Aug 19, 2018, 10:25 pm Last Edit: Aug 19, 2018, 10:30 pm by Grumpy_Mike
Quote
So, can anyone suggest what I'm doing wrong?
That circuit is based on level shifters for I2C buses.
See the attached application note.

Now what happens with an I2C bus is that the active device pulls down the bus line. However what you have here is that the pull down signal has the 300R resistor in series with it. I would try removing that for the time being.

The only time I use a FET for a WS2812 LED strip was in the Magnetic Bounce article in MagPi 69, but that was in a conventional configuration. It was successful in that the LEDs were turned on but I wasn't impressed with the waveform it produced. I used the option of an inverted clock the the Adafruit library gives you.


I think the problem with the 2N7000 is that the gate threshold can be anywhere between 0.8 and 3V, with a typical value of 2.1V with a drain current of 1mA. So I don't think that the FET you used is up to the job.

Video of project here:-
https://www.youtube.com/watch?v=-Bqg_NlfEyM&t=2s

PaulRB

#12
Aug 19, 2018, 11:12 pm Last Edit: Aug 19, 2018, 11:12 pm by PaulRB
Here's the circuit with the 2n7000


PaulRB

#13
Aug 19, 2018, 11:19 pm Last Edit: Aug 19, 2018, 11:41 pm by PaulRB
Your average voltage measurements are pretty meaningless.
Agreed, in absolute voltage terms, but I would imagine that with the same data signal going in and out, the logic level shifter should give a rise in the average voltage corresponding to 3V3 vs 5V.
Get a scope.
Well, I have one on my Amazon wish list...
Or write a solid '0' and '1' to D5 and see what you get.
Good suggestion, will try that asap.
I  do not see a wire connecting the two black GND busbars.
The red busbar has a gap which needs a wire link to bridge it, but the black one is continuous.

PaulRB

That circuit is based on level shifters for I2C buses.
See the attached application note.
Will study that. Thanks Mike.

...the 300R resistor... try removing that
Unfortunately, no difference.

I don't think that the FET you used is up to the job
Can you suggest something in to-92? Can you identify the mosfets on the 4-channel board? They seem to work OK. Perhaps they are available in to-92.

Go Up