Electronic – Logic Level Converter (3.3v <-> 5.0v) returning HIGH for Low Volt. & High Volt. sides when nothing is plugged in. [Raspberry Pi]

digital-logicmotorraspberry pivoltage

The Goal

I have a Raspberry Pi that I'd like to control my treadmill with. The Pi's GPIO ports output 3.3v and the treadmill's motor control board only takes 5v signals. Because of that, I bought a bi-directional logic level converter.

The Problem

You can imagine how bad it would be if I hooked up my Pi to the treadmill, and off-the-bat, the treadmill is receiving a solid 5v to the speed wire. I want to avoid that.

I've hooked up the LV to 3.3v and HV to 5v and attached grounds on both sides of the logic level converter. Now, right off the bat, touching my multimeter to Ground + LV1 shows 3.3v. Worse, touching HV1 shows 5v (meaning the nightmare scenario would have happened if this was plugged in.)

I recorded a video of me touching different parts of the converter and saying the results.

Things I've gathered this far.

If the Raspberry Pi's GPIO is not explicitly programmed to output a HIGH or LOW signal, it becomes like an "antenna". I've learned luckily that setting a pin explicitly to LOW and plugging it into LV1 will output 0v on HV1. The problem is that the Pi takes time to boot and launch my program, so I fear if a restart were to occur, the treadmill would receive full 5v to speed for 30 seconds while it booted.

Extra details

For this project, I have four wires I'm connecting from my Pi to the Treadmill: Incline Up, Incline Down (both take a solid 5v signal to activate), Speed (PWM 5v signal), and a tachometer(?) wire (diagram said it could be used to track footsteps.) Of these 4 wires, 3 of them are outputs and 1 of them are inputs.


Any advice is appreciated, thank you for reading this far!

Best Answer

Add a pulldown resistor (a 1k or so resistor to ground) to each input of the level shifter that you need to protect from erroneous activation. As a result, when the Pi is not driving the line, it defaults to logic low, and the level shifter outputs will only be high when the Pi is actively driving the corresponding inputs high. When high, about 3.3mA will be drawn from GPIO pins to overcome the pulldown, which is within recommended limits.

Note: The level shifter includes its own pullups (which cause the output to default to high), with value 10k. When the signal is low, both pullups on each channel need to be overcome (the LV pullup directly, and the HV pullup because the FET will conduct). Your pulldown resistor should have a value that is small enough to be able to overcome these pullups.