Dealing with unreliable BeagleBone pin levels during boot

beaglebone black

I have a BeagleBone application that needs to interface with some 5V components. Unfortunately, some of the "5V components" that need to be interfaced are LEDs, so they draw appreciable current. As a result, I can't use a level shifter with a pull-up resistor (like BOB-12009) because the voltage drop over that resistor is too high when I try to light the LED (so the LED ends up being way too dim).

I've simulated a NPN -> PNP transistor setup that seems to work OK, but here's my problem:

On boot, the pin levels on the beaglebone can be anything (though they mostly hover in the middle of the 0-3.3V range). Since I'm connecting the BB output to a 5V relay that powers a pump, it's not OK for the pump to turn on while the BB is booting. How do people deal with this sort of thing?

Best Answer

I presume based on the "mostly in the middle" remark, that this means the pins power up as inputs (rather than outputs), so they are basically high impedance and will float.

The solution is to use a level shifter (one which has a strong push-pull output) with a pull-down resistor (or pull-up if it is inverting) on the input of the level shifter, not the output. This will keep the output of the level shifter driven to a known state when the beaglebone I/O pins are inputs.


What level shifter you use is up to you. In fact if you are driving LEDs, you can make a level shifter with a single N-Channel logic level MOSFET (or NPN BJT with base resistor). The LED anode is connected via its current limit resistor to +5V, and then the cathode is connected to the drain of the MOSFET. The source of the MOSFET connected to GND. The gate is connected to the BB with a pull-down resistor.

schematic

simulate this circuit – Schematic created using CircuitLab

You can do the same thing for a relay (put the relay in place of the LED in the above).