-->
Page 1 of 6

Connecting the GPIOs to a Relay

PostPosted: Mon Jan 05, 2015 11:28 am
by JannikJung0
Hello everybody,
I'm currently developing a unit foy my home automation project using the ESP8266.
I got a tiny little step-down converter, which outputs 3.3v with 600mA from the mains 230v.
I can power the ESP8266 ( -01 ) without any problems, and I can talk to it via tcp (I got a custom firmware which starts the tcp server on bootup and lets me control the gpios)

Now the problem is, when I try to connect the relay:
Because the relay itself would draw way too much current from the gpio, I used a transistor.
Once the relay with the transistor is connected to any of the gpios, it doesn't boot up properly..

When I connect the relay to GPIO 0, the blue led blinks once, but it doesn't start.
Whereas when I connect it to GPIO 2, the blue light stays on all the time!

I can fix it by connecting the GPIO to VCC, and then power the ESP8266 on. Once it is bootet up, I can disconnect the gpio from vcc and everything works as expected.
So I thought, maybe my circuit is pulling the GPIO to ground, which causes this mibehaviour. Therefore I tried to add a diode, but actually it didn't help.

So does any one have an idea ?

Kind Reagrds,
Jannik Jung

Re: Connecting the GPIOs to a Relay

PostPosted: Mon Jan 05, 2015 12:20 pm
by alonewolfx2
Did you tried pull up gpio to vcc?

Re: Connecting the GPIOs to a Relay

PostPosted: Mon Jan 05, 2015 12:29 pm
by martinayotte
Maybe you should show us how did you hooked up your transistor and relay, and tell us which kind of transistor ...
Maybe a MOTFET would be better ...
Of course, you need pullups too.

Re: Connecting the GPIOs to a Relay

PostPosted: Mon Jan 05, 2015 12:35 pm
by spants
I'm thinking of doing something similar.
What 230v to 3.3v converter did you find? I'm looking for something that fits in a small case and can be driven from central heating circuit.