ESP8266 Wi-Fi module interfacing with Arduino: In this project you will learn how to interface esp8266 wi-fi module with arduino and how to send data from arduino to a server using esp8266 wi-fi module? In today’s tutorial we will learn how to interface Wi-Fi module with Arduino board? We will see how Wi-Fi works? We will transmit data to a serve from real world and display it in the form of graph. We will transmit temperature and humidity of atmosphere to server using DHT11 sensor and ESP8266 Wi-Fi module.
Introduction to ESP8266 Wi-Fi module
Wireless Fidelity is a term used for products which uses any type of 802.11 technologies. Wi-Fi network operate with 11 Mbps or 54 Mbps data rate in the unlicensed 2.4 GHz and 5GHz radio frequency band. Devices which have Wi-Fi enabled can sent and receive data wirelessly from locations which are equipped with wireless access. Access points which are located in a Wi-Fi location transmit RF signal for the Wi-Fi enabled devices. These Wi-Fi enabled devices can receive the signal if they are located within access point range. The speed of data transmission depends upon the speed of pipeline fed into the access point.
Working Principle of ESP8266 Wi-Fi module
Radio signal is the base of operation of Wi-Fi. It is made up of three elements which are essential for its working.
The radio signals are transmitted by antenna and routers and they are received by Wi-Fi receiver such as computers.
ESP8266 Wi-Fi module
Wi-Fi module has 8 pin outs which are arranged in 2 rows. Keeping the integrated side facing you and pins closer to your end. Lower row from left to right is
- Tx - Transmitting pin
- CH-DO – Channel Down pin
- RST – Reset
- Vcc – 3.3V power supply
Upper row from left to right has
DHT module is provided with 3 output pins.
ESP8266 Wi-Fi module interfacing with Arduino
Connect the circuit as follows:
- Tx pin of ESP8266 module with D2 of Arduino
- CH-DO pin of ESP8266 module with 3V of Arduino through 10k resistor.
- Rx pin of ESP8266 module with D3 of Arduino through voltage divider as shown.
- RST pin of ESP8266 module with 3V of Arduino (not shown in diagram).
- VCC pin of ESP8266 module with 3V of Arduino.
- GND pin of ESP8266 module with Ground of Arduino.
Connect DHT11 with Arduino as follows:
- Data pin of dht11 with pin13 of Arduino. (make sure you connect with pin13 not with pin2 as shown in diagram.)
- Vcc pin of dht11 with 5V of Arduino.
- GND pin of dht11 with GND of Arduino.
Complete circuit will be combination of both of these.
After completing the circuits follow as given. It is necessary to view results on server. You will see the results in “Public preview ”tab of site.
Procedure to connect ESP8266 Wi-Fi module with Arduino
- First of all, user needs to create an account on ThingSpeak.com, then Sign In and click on Get Started.
- Now go to the ‘Channels’ menu and click on New Channel option on the same page for further process.
- Now you will see a form for creating the channel, fill in the Name and Description as per your choice. Then fill ‘Humidity’ and ‘Temperature’ in Field 1 and Field 2 labels, tick the checkboxes for both Fields. Also tick the check box for ‘Make Public’ option below in the form and finally Save the Channel. Now your new channel has been created.
- Now click on ‘API keys’ tab and save the Write and Read API keys, here we are only using Write key. You need to Copy this key in char *api_key in the Code.
Code is given for LCD interfacing which is optional. You may connect LCD as given in code and have all results visible on LCD also which are being displayed on the serial monitor.
- Wi-Fi is used in mobile applications.
- Wi-Fi is used in business applications
- Wi-Fi is used in home applications
- Wi-Fi is used in computerized application.
- Wi-Fi is used in automotive segment.
- Wi-Fi is used in browsing internet.
- Wi-Fi is used in video conference.
- Wireless laptop can be moved from one place to another place
- Wi-Fi network communication devices without wire can reduce the cost of wires.
- Wi-Fi setup and configuration is easy than cabling process
- It is completely safe and it will not interfere with any network
- We can also connect internet via hot spots
- We can connect internet wirelessly
- Wi-Fi generates radiations that can harm the human health
- We must disconnect the Wi-Fi connection whenever we are not using the server
- There are some limits to transfer the data, we cant able transfer the data for long-distance.
- Wi-Fi implementation is very expensive when compared to the wired connection
- HTTP GET using ESP32 and Arduino IDE (OpenWeatherMap.org and ThingSpeak)
- MicroPython: OpenWeatherMap API with ESP32/ESP8266 – Sensorless Weather Station
- ESP32 HTTP POST using Arduino IDE (ThingSpeak and IFTTT)
- MicroPython: Send Sensor Readings via Email (IFTTT) with ESP32 and ESP8266
- IoT Based Temperature Data Logger Using ESP8266 and pic microcontroller