# Level shifting a 5V input down to 3.3V for Teensy 4.0

#### dreck

##### New member
I have a question about how to properly convert a signal to be compatible with the Teensy 4.0 board.

I have an inverted 5V TTL signal coming from this device:

The signal relates to a microscope component turning on, and I need to use it to time the onset of sensor recording from the Teensy. I plan to take a 50 ohm coaxial cable with BNC connector from the output of that device, and then connect it into the Teensy to time the sensor recordings.

Teensy's digital input pins do not tolerate 5V inputs, so I've looked into level shifting the 5V signal down to a 3.3V signal using this board:

However, I'm realizing I have no feasible access to a 5V power source to connect to the HV pin of this board, only the 5V TTL input. What would be the easiest way for me to accomplish what I want to do, without simply buying a new 5V compatible board (like an Arduino)?

Thanks for any advice!

What about a passive voltage divider?

E.g. 1K8Ω & 3K3Ω.

Paul

Last edited:
I was worried that a voltage divider will induce some long timescales into the system. I suppose it's worth implementing and seeing if the delays it adds are too long for what I need, which needs to have at least 30 ms temporal precision, optimally much more precise than that.

Last edited:
I'm curious to hear how much delay you see by just adding this voltage divider...

Paul

This voltage divider will not add significant signal delay.

The delay will be roughly 2 * R * C, where R is the Vout impedance (1.16K if Vin is low impedance) and C is the capacitance of the pin and and PCB trace or other wiring. Between 5pF to 8pF is likely. But even if it ends up relatively high, like 20pF, you're looking at a delay of 2 * 1160 * 20e-12 = 46ns.

<This> website has several approaches to choose from. Personally, I have successfully used the "two cascaded BJT" approach in several projects. I make use of the Adafruit PowerBoost 1000C battery management module with a LiPo in many of my battery-powered portable projects. That particular module provides a low-battery signal (LBO) which is a 5-volt level signal, so I use this (non-inverting) level conversion in order to monitor that signal with the T4.x without risk of over-voltage damage.

Mark J Culross
KD5RXT

I like using TI TXU0n0m unidirectional voltage level shifters. In this case, a TXU0101 would work well. It works at up to 200 Mbit/s rates, with the 5.0V-to-3.3V (or vice versa) propagation delay being 11ns maximum. TI recommends using a 0.1nF supply bypass capacitor on each supply pin. Price at Mouser is about 0.50€ in sets of ten. TXU0101DBV is SOT23-6, so making a small interface board you can piggy-back on pins to Teensy is easy. It is also available in even smaller footprints.

JLCPCB does not currently have TXU0101 in stock for assembly, but they do have TXU0202BQAR (\$0.68, VQFN, an extended part) and TXU0104, both with the same max. 11ns propagation delay between 5.0V and 3.3V logic levels and 200 Mbit/s maximum transfer rate. I've designed a board for TXU0202 and another for TXU0304 in free EasyEDA, with very easy integration to JLCPCB (and others like PCBWay), and I'm just a hobbyist on the electronics side, so I do recommend you consider making your own board, optionally with assembly so you don't even need to solder the parts on them yourself.

For a case like this I'd simply use a diode (e.g. 1n4148) - configure the pin as an input with pull-up, connected to the diode's anode, with the cathode connected to the 5V input signal.

I was worried that a voltage divider will induce some long timescales into the system. I suppose it's worth implementing and seeing if the delays it adds are too long for what I need, which needs to have at least 30 ms temporal precision, optimally much more precise than that.
A 1k : 2k2 divider will work with something like 10ns delay. If 10 nanoseconds counts as long timescales, then perhaps use 74LVCxx family which are 3.3V logic with 5V tolerant inputs, to get more like 3ns.