How to switch on a electric bulb with ESP8266 board?

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
RajaRamesh
Posts: 51
Joined: Wed May 08, 2019 10:54 am

How to switch on a electric bulb with ESP8266 board?

Post by RajaRamesh » Thu May 09, 2019 6:29 am

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

ThomasChr
Posts: 121
Joined: Sat Nov 25, 2017 7:50 am

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

Post by ThomasChr » Thu May 09, 2019 5:03 pm


OutoftheBOTS_
Posts: 847
Joined: Mon Nov 20, 2017 10:18 am

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

Post by OutoftheBOTS_ » Thu May 09, 2019 9:38 pm

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 :)

cyberlab
Posts: 56
Joined: Sat Apr 21, 2018 5:02 am

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

Post by cyberlab » Fri May 10, 2019 2:32 am

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

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

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

Post by jimmo » 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.
Make sure you fully understand concepts like galvanic isolation and how to work safely with high voltages.

RajaRamesh
Posts: 51
Joined: Wed May 08, 2019 10:54 am

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

Post by RajaRamesh » Fri May 10, 2019 9:52 am

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.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

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

Post by pythoncoder » Fri May 10, 2019 9:53 am

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? ;)
Peter Hinch
Index to my micropython libraries.

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

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

Post by jimmo » Fri May 10, 2019 4:23 pm

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

RajaRamesh
Posts: 51
Joined: Wed May 08, 2019 10:54 am

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

Post by RajaRamesh » Sat May 11, 2019 6:07 am

hi.....can someone share the code in micropython standard...

RajaRamesh
Posts: 51
Joined: Wed May 08, 2019 10:54 am

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

Post by RajaRamesh » Mon May 13, 2019 9:36 am

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

Post Reply