# Driving an LED from an 1.8V GPIO pin that defaults to “IN”

I have an EspressoBIN board, which has 1.8V GPIO pins with a max current of 8mA.

I'm attempting to drive some status LEDs from them, and a 5V fan, so I'm using 2N2222s with 220 Ohm base resistors connected to the GPIO pins, emitters on ground, and between 0 and a few hundred ohms connecting collectors, load and +5V. (220 Ohm so I'm not losing much voltage to drive the fan)

This works fine, except during boot. Turns out the EspressoBIN, by default, sets the GPIO pins to "IN". In that state they are at 1.8V with about 10kOhm internal impedance. This is enough to turn on the transistors so the LEDs and the fan come on (on half speed).

I can only turn the GPIOs to "OUT" once the board has fully booted (about 60 seconds later).

What's the simplest-possible circuit you can think of that keeps my loads off during boot, and lets me have them switch 5V on/off once the GPIO is set to "OUT"? Note that per vendor, 8mA is the max current I may draw.

• Can you use pull-down resistors on the base of the transistors? – Ron Beyer Dec 4 '17 at 19:52

Add a resistor to ground on each GPIO, say about 2K. When it is booting you will have about 0.3V and after you set the GPIO to OUT then the pull down will draw 0.9 mA when the GPIO is high.

If your design isn't yet set in stone, there are pre-biased parts that save board space using EE_socal's solution of a pull-down resistor, such as the DDTC122LU. Here, R1 (base resistor) is $220\Omega$ and R2 (pull-down resistor) is $10k\Omega$.

• I haven't figured out how to solder surface mount stuff, so I'd rather stay away from that :-) But thanks anyway. – Johannes Ernst Dec 4 '17 at 21:58
• @JohannesErnst ONSemi still makes pre-biased transistors in TO-92 packages; the one with 4.7 kΩ/10 kΩ would be the FJN3305R. – CL. Dec 5 '17 at 9:43