Logic Level converter with switch and as LED driver

I’m looking for some advice on what may be an out-of-spec implementation of a logic level converter (eg https://core-electronics.com.au/logic-level-converter-bi-directional.html or https://core-electronics.com.au/logic-level-converter-bidirectional.html).
To start with, here’s schematic of what I’m getting at (I didn’t bother to include current protection resistors on the LEDs, they just complicate the schematic).

image

I’m hoping to use the unit for two purposes:

  1. to drive LEDs and shift between 5v and zero - turning it on and off, by supplying the 3.3v side with 3.3v, or zero,

  2. to level shifting a selection of 5v or 0v on the 5v side, to produce a 3.3v or 0v on the 3.3v side.

so a few more details:

Three output pins from the jetson (right side) are set high (3.3v), or low (0v), I thought the output of the corresponding channel on the 5v side (left side) would then be set to either 5v or 0v, and the LED would illuminate, or not.

The switch on the left side would be open, and therefore at 5v, or closed - and then pulled to ground.

I thought the output of the LLC on the right hand side would correspondingly be set to 3.3v, or 0v and be read by the gpio input pin on the jetson.

The reason I’m emailing is that I’m having difficulty with a LLS, but I suspect it’s flaky and I just want to check that what I’m doing is sane - that it’s the module, not me.
Can someone let me know - is it possible to drive an LED (say, red, or blue, with Vd~3-5V) from the 5v output side of a LLS, with a 3.3v input?

Can I simultaneously input a 0 or 5v input on the 5v side of the LLS and convert that into a 3.3v output to be read by a jetson on the 3.3v side?

Put another way - can three channels be shifting 3.3v → 5v and one be shifting 5v → 3.3v

Many thanks.

1 Like

Hi Emu,

A sanity check is a great idea.
Also thanks for a well-asked question and for including a diagram.
Your circuit should work exactly as described and is a great example of what LLCs do best.
If the Logic Level Converter you chose was not bidirectional then it would only work one way.

EDIT: Also as the LLC is effectively a small MOSFET circuit, there are limits on how much currently they can provide before heat dissipation becomes a problem. These are designed for logic level signals not high power component drivers, an LED on each output should be totally fine… a DC motor probably not.

1 Like

Hi Trent
Look at the circuit closely. Both sides have pull up resistors to their respective voltages.

Consider looking from the 3.3V side. When 3.3V is high the mosfet is OFF, 5V is supplied to that side via 10k pull up. Any current is supplied via this resistor. Too high (10k) to drive anything except a high impedance input to something. When the 3.3V goes low the mosfet is ON and pulls the 5V side low with it.

Now look from the 5V side. When the 5V is high the 3.3V is also high via the pull up and mosfet is off. When the 5V input goes low 3.3V is pulled low via mosfet body diode thus turning the mosfet on and completing the operation.

In short the respective 3.3V and 5V are supplied to each side via the pull up resistors and the mosfet is just pulling each side low as required. Not really carrying any current at all, just sinking a few mA via the pull ups.

In the circuit above the 4k7 pull up is not required as this is already on board.
The 5V would have to supply LED current via 10k which is far to high.
Why not just operate the LEDs from 3V3 and recalculate the current limit resistors to suit the lower voltage. That is if the Jetson device is capable of supplying enough current for the LEDs. I don’t know what that device is.
Cheers Bob

1 Like

Hi Bob,

Thanks for that correction, it’s been a while since I’ve fooled around with MOSFETS.

Thanks bob,
the LEDs arent anything special - literally just indicator LEDs, so I guess they’d pull a few 10s of mA. The LEDs are optimised to run at around 4-5 V but what I didnt tell you is that the distance between the logic converter and the LEDs is about 5m: the LEDs wont illuminate if I supply 3.3v from the jetson along the 5m wire but they do when supplying 5v. I’m actually not using any additional resistance.

If the pullup isnt necessary, that’s good news: I’ll leave it out.

thanks!

Hi Emu

What are these then. You say you didn’t include them on the drawing. Do they exist or not?
The 5m of wire should not be significant unless it is very thin.

20mA Max usually unless they are high power types. Indicators about 10mA

Just what do you mean. Have they got current limiting resistors built in. If so you have a problem, That level converter will not drive them I don’t think. post a photo of one pls.

A bit confusing . A LED will require a current limiting resistor. If you say yours are indicators and are mounted in a bezel they may have this built in. Hence the request for a pic.

A “normal” LED will drop something above about 2V depending on colour. Say 2.3V for illustration.
With a 5V supply you have 5V - 2.3V = 2.7V so 270Ω resistor will drop this 2.7V @ 10mA OK
With 3.3V supply you have 3.3V - 2.3V = 1.0V so 100Ω resistor will drop this 1V @ 10mA. Same result as far as the LED is concerned, 10mA. Unless the 5m of wire is extremely thin it can probably be ignored.

If your Jetson device can supply the 10mA or more current I don’t see why you can’t drive the LEDs directly. The only reason is if you have some more sneaky resistance in there somewhere (like built in).
Cheers Bob

1 Like

Thanks again Bob.

At present I’m using a blue LED, such as the products described here:

The forward voltage drop there is 2.4 - 2.7V. They have no built in resistor.

The output current from the Jetson pins is famously low, ~1 mA on some pins, and 20uA on others, so it’s not really meant for driving anything directly, but just for switching. Since the current is so low, I considered it safe to run the LED off the pin without any additional resistor. I’ll reconsider that if I’m able to use the LLC to drive the LED.

I figured that as long as I kept the LLC close to the jetson, I could switch the LLC and effectively amplify that signal a little, and drive the LEDs from the 5V supply (I wanted to avoid transistors and stick with some modular units like the LLC because the longer term plan is to involve some local community, and people new to soldering will find transistors more fiddly than header pins).

Thanks again.

1 Like

Hi Emu

You are right. That won’t drive anything. It wouldn’t even drive a mosfet. There is a thing on those called gate capacitance which has to be charged and discharged and I doubt if those numbers would do it.

Wrong. Don’t try to drive the LEDs directly with the Jetson 3.3V as there is not enough current to light them and you risk damaging the Jetson.

You won’t be able to drive them from the LLC as they will be supplied via a 10kΩ resistor which to drop 2.5V would only supply 0.25mA. No where near enough.

If you are going to light LEDs using the Jetson you are going to have to use some interfacing device. I would suggest cmos which has a very high input impedance. I don’t know about Darlington transistors. They are available in multiple devices in DIL packages. A check would be needed to ensure the input impedance is high enough.
Cheers Bob

2 Likes

You don’t need a level shifter. A 74HCT04 would do the job. It has a high enough input impedance to handle the Jetson (whatever that is) and switches between 1V and 2V input. The output is inverted so the LEDS are wired to the 5V line and use the outputs of the 74HCT04 as sinks (with current limiting). If the LEDS are limited to drawing 10mA each, won’t overload the chip. Note HCT is not HC - HC input is CMOS levels. If you want to use them 5V to 3.3V check if the 3.3V input has clamp diodes, in which case just a current limiting resistor may be enough. Or 2 resistors in series as a voltage divider if the 3.3V input can’t be overloaded.

2 Likes

Hi Emu,

I get that this might not suit your purposes, but could you use a small microcontroller connected via USB or UART to do your driving for you?

-James