-->
Page 1 of 3

ESP8266 GPIOs can be used to turn lights/fans on/off?

PostPosted: Thu Jan 29, 2015 4:52 pm
by pkh
Does this come with GPIOs, to turn say lights/fans on/off? or would we need to hook this up to external microcontroller?

Re: ESP8266 GPIOs can be used to turn lights/fans on/off?

PostPosted: Fri Jan 30, 2015 1:17 am
by lethe
GPIOs work like on any microcontroller, so as long as your ESP module has enough GPIOs you don't need an external uC for simple on/off switching applications. For loads that need more than 12mA or voltages other than 3.3V, you need additional components like transistors or relais (but you will also need those if you use an external uC).
But what exactly do you mean with "lights/fans"? I would strongly advise you not to touch anything that's running at mains voltage, unless you know exactly what you are doing.
If you need to switch mains voltage, don't do it directly. There are cheap wireless remote switches available, you can use those and hook the remote to the ESP without risking to electrocute yourself.

Re: ESP8266 GPIOs can be used to turn lights/fans on/off?

PostPosted: Fri Jan 30, 2015 2:03 am
by pkh
I successfully used Arduino Yun to wirelessly turn on/off appliances (lighs/fans) in a home using relays. So was just wondering if ESP8266 could prove to be a much cheaper alternative to say Arduino Yun, without having to use an external uC to hook up to these appliances.

Re: ESP8266 GPIOs can be used to turn lights/fans on/off?

PostPosted: Fri Jan 30, 2015 3:33 pm
by rubensm
Of course, there is no difference between pins on Arduino Yun and ESP8266.

I don't know Yun's voltage supply, but if it is 5V instead of 3.3V, you will only need a buffer to convert ESP 3.3V output into 5V to turn on the relay.

This buffer can be build in several ways:
1.- Buying a buffer.
2.- Using a transistor in saturation:
Image

Where it says Arduino input, it should appear relay input.

I think option 2 is better and cheaper than first one.

Hope it is helpful!

R