LED On/Off Control Server
In this demo we will see our first real IoT control application, here we are controlling on board LED of ESP-01 Module using web server. Basically internet of thing is used to monitor and control the devices, this is our basic control application it can be extended to control multiple home appliances and monitor temperatures and various parameters of house. code is kept as simple as possible to make it useful for many applications and understanding.
Step 1: Hardware Setup
1. ESP-01 Module (you can use ESP-12 also)
2. 3.3V Power Supply for ESP-01 Module
3. Programming setup (USB to Serial Converter)
Step 2: Programming
Design your web page as per your requirements.
HTML Webpage Code stored as header file mainPage.h:
Save this as mainPage.h
ESP-01 Code LEDControl.C:
Step 3: Uploading Code
1. To upload code on ESP-01 Press GPIO0 Switch to make it Low during power on or reset. to put it in programming mode.
2. During programming you will see the Blue LED Blinking.
Step 4: Testing
1. Turn on WiFi on phone or Laptop
2. Connect to LEDServer Network that is from ESP-01
3. Open Web Browser enter IP: 192.168.4.1
4. Press On/Off button on webpage you see
Now you have clear concept of IOT possibilities, this code is made such a way that you can have bidirectional communication from browser to ESP-01.