Rabu, 10 Januari 2024

WIRELESS SWITCHES CONTROL USING WEB SERVER WITH ESP8266








1.       IOT : WIRELESS SWITCHES CONTROL USING WEB SERVER WITH ESP8266

 

About the ESP8266

 

ESP8266 is a low cost Wi-Fi module. It allows you to control

inputs and outputs as you would do with an Arduino, but it comes with Wi-Fi.

It can be program using Arduino IDE. This feature make it easy and great for IOT projects.

 

ESP8266 specifications

 

802.11 b/g/n protocol

Wi-Fi Direct (P2P), soft-AP

Integrated TCP/IP protocol stack

Built-in low-power 32-bit CPU

SDIO 2.0, SPI, UART

 

Installing ESP8266Board

 

To install the ESP8266 board in your Arduino IDE, follow these next

instructions:

 

1. On the Arduino IDE, click ‘’File’’ and select ‘’Preferences’’

2. On the Preference page, enter

http://arduino.esp8266.com/stable/package_esp8266com_index.json

into Additional Board Manager URLs field and press the “OK” button



3. Go to ‘’Tools’’ ,   ‘’Board  Boards Manager’’ ...


4. On Board Manager panel, scroll down, select the ESP8266 board menu and Install    “esp8266 by ESP8266 Community”


5. Then go to ‘’Tools’’ ,  ‘’Board’’ ,  ‘’NodeMCU 1.0 (ESP-12E Module)’’ …


6. Finally, re-open your Arduino IDE to ensure that it launches with the new boards installed.


Project ;


Connections ;

Besides Vcc and Gnd,

D1 – in relay 1 ( GPIO4 )

D2 – in relay 2 ( GPIO5 )

 

Copy code from below link and paste to Arduino IDE

https://docs.google.com/document/d/1ZEN32wqfa0UG5SLgt7rGF-sW1ejVY85n/edit?usp=sharing&ouid=109775515928138353933&rtpof=true&sd=true

 

Next step ;

 

You need to modify the following two variables with your network credentials,

so that your ESP8266 can establish a connection with your router.

 

// Replace with your network credentials

const char* ssid = "REPLACE_WITH_YOUR_SSID";

const char* password = "REPLACE_WITH_YOUR_PASSWORD";

 

Then, upload the code.

After ‘’Done uploading’’ , open the Serial Monitor and press the ESP8266 RESET button. The ESP IP address will be generated on the Serial Monitor.


Open your phone browser, type the ESP IP address, and you’ll see the following page. This page is sent by the ESP8266 when you make a request on the ESP IP address.


With this page, you can turn on/off the relays using the softkeys.

Happy trying :-)

Reference & Credit to ;

Rui Santos & Sara Santos

https://randomnerdtutorials.com/projects-esp8266/













KURSUS - BASIC ARDUINO

Untuk artikel kali ini saya menggunakan bahasa rojak ya. Utamanya bahasa melayu dengan istilah2 teknikal dalam bahasa Inggeris sekiranya leb...