Page 1 of 6

How to switch on a electric bulb with ESP8266 board?

Posted: Thu May 09, 2019 6:29 am
by RajaRamesh
Hi Team,

I am new to Micropython and started learning from https://docs.micropython.org/en/latest/. currently i started with ESP8266 board and i am able to blink inbuilt LED's on the board. while googling i got to know we can use ESP8266 board for home automation(IOT). Now i am trying to switch on electric bulb with the help of ESP8266 board. can someone help me how to do this (or) share a link where i can find the details.

Thanks in advance,
Raja

Re: How to switch on a electric bulb with ESP8266 board?

Posted: Thu May 09, 2019 5:03 pm
by ThomasChr

Re: How to switch on a electric bulb with ESP8266 board?

Posted: Thu May 09, 2019 9:38 pm
by OutoftheBOTS_
You can buy little boards that have all needed components on the board like this 1 https://www.aliexpress.com/item/ESP8266 ... st=ae803_5

It has the ESP8266 and the relay for switching mains power and also the buck conveter to convert main power to the voltage needed to switch the relay and a linear converter to convert the voltage needed to run the ESP8266 as well as the octocuopler needed to protect the ESP8266 from the inductive spikes from the relay :)

Re: How to switch on a electric bulb with ESP8266 board?

Posted: Fri May 10, 2019 2:32 am
by cyberlab
I recommend a solid state relay do not need much current to turn it on, they do not have mechanical parts and there are very small ones

Re: How to switch on a electric bulb with ESP8266 board?

Posted: Fri May 10, 2019 2:55 am
by jimmo
Also just a reminder that in many countries (e.g. Australia) it's illegal to DIY mains electricity.
Make sure you fully understand concepts like galvanic isolation and how to work safely with high voltages.

Re: How to switch on a electric bulb with ESP8266 board?

Posted: Fri May 10, 2019 9:52 am
by RajaRamesh
Thank you all for sharing the details....
currently i have(ESP8266 board) https://www.amazon.in/gp/product/B06XYR ... H3FB&psc=1
which contains micropython firmware.

i will get relay https://www.amazon.in/REES52-Optocouple ... 326&sr=1-3

i gone through the links shared and confused with the code http://robokits.co.in/download/init.zip , no libraries are importing as a standard of python / micropython. it will be helpful if i have code in micropython standards.

Re: How to switch on a electric bulb with ESP8266 board?

Posted: Fri May 10, 2019 9:53 am
by pythoncoder
jimmo wrote:
Fri May 10, 2019 2:55 am
Also just a reminder that in many countries (e.g. Australia) it's illegal to DIY mains electricity...
I never knew that. I wonder how these maniacs manage? ;)

Re: How to switch on a electric bulb with ESP8266 board?

Posted: Fri May 10, 2019 4:23 pm
by jimmo
pythoncoder wrote:
Fri May 10, 2019 9:53 am
I never knew that. I wonder how these maniacs manage? ;)
Haha, lets hope one or more of them are actual sparkies. Interestingly in Australia, an EE degree doesn't count and there is no pathway from EE to sparky. The implications are pretty serious for insurance etc.

There's quite a good video from Jon Oxer about this -- https://youtu.be/3K9QjRDIwuw

Re: How to switch on a electric bulb with ESP8266 board?

Posted: Sat May 11, 2019 6:07 am
by RajaRamesh
hi.....can someone share the code in micropython standard...

Re: How to switch on a electric bulb with ESP8266 board?

Posted: Mon May 13, 2019 9:36 am
by RajaRamesh
hi all....can someone give some idea how to (or) where i can get the details of micropython code to work with relays and sensors...please