# 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

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$.