Home Automation WiFi Light Switch With ESP-01

by thamidi in Circuits > Arduino

2333 Views, 4 Favorites, 0 Comments

Home Automation WiFi Light Switch With ESP-01

light switch - before.png
light switch - after.png

With this indestructible, I will walk you through steps of making your first wifi light switch.

Next we will do sensors and eventually go to the Home Assistant setup and configurations.

Start Programming the ESP-01

DSC01467.JPG

In this series, I will try to walk you through the steps I completed in order to create my own home automation system.

I think everyone can do this if I was able to do it. I had to read and find the answers to many of the questions and I am hoping this instruction can help someone and you don't have to wonder around trying to find your answers therefore, I will try to be detailed about it.

Please leave me a note if you wish to get details on anything that I might have missed in my instructions. It will be helpful to me since this is the first time I am trying this.

The Programmer

programmer.JPG

So, you can buy one of these (ESP-01 Programmer)

It helps a lot since you can just flip a switch, put the ESP-01 in programming mode.

The flip the switch after finished programming it and start configuration on the ESP module.

Download the following. This is the software for flashing the ESP module with the Tasmota software.

ESP Home Flasher

Pick the operating system you have and install it. You will also need to download the payload for Tasmota.

Here is the link to Tasmota site. Tasmota GitHub Site

You can pick and language or for the ease of making a decision, I am using Tasmota.bin

Start Programming 1

programmer switch.JPG

After the Flasher is installed and you have the Tasmota payload,

  • Insert the ESP-01 into the programmer
  • Change the switch on the program and insert the card into a USB drive

Start Programming 2

flashing the ESP.JPG
  • Choose the Serial port for the programmer
  • Navigate to the directory for the Tasmota.bin payload and insert it into the flasher software.
  • Click "Flash ESP" and wait until it is completed.

Start Programming 3

completed flashing.JPG

After the programming is completed.

  • Remove the card from the USB port
  • Change the switch to UART
  • Re-Insert the card back into the USB port

Start Programming 4

programmed and ready.JPG

Now refresh the ESP Flasher and click on the View Log.

  • Make note of the IP address of the ESP web server.
  • Using a wifi enabled PC or a cell phone.
  • Connect to the tasmota-xxxx (xxxx is a unique number for every ESP)
  • it does not have a password
  • once connected to AP (Access Point) the use your browser and go to the following URL
  • http://192.168.4.1

Start Programming 5

t1.JPG
t2.JPG

Now click on the link "Scan for wifi networks"

Click and choose the SSID for your home

Enter the password for your SSID and click save.

Start Programming 6

t3.JPG
t4.JPG
t5.JPG

Now the ESP is ready to be programmed.

I am going to continue from here to creating a relay switch

It will be capable of turning a light on or off

The instruction up to here is common for creating a:

  • light switch
  • sensor (ie. Humidity, temperature, ...)
  • Motion detector
  • Water sensor
  • Gas and Particle detectors
  • Load Sensors
  • Proximity Sensor and Many more.

So lets start with the simple wifi light switch.

You can go to the next step for this instructions here