Connect ESP32 to IoT and send temperature and humidity to ThingSpeak

ESP32 19-01-25
41 0

Tutoriel plan

1- Introducing the ThingSpeak Platform

2- Purpose of connecting ESP32 to IoT to send data to ThingSpeak

3- The necessary components

4- System Wiring

5- Micropython programming of the ESP32 card

 

 

Introducing the ThingSpeak Platform

ThingSpeak is an open-source Internet of Things (IoT) platform designed to collect, analyze, and visualize data from connected devices or sensors. It provides a simple way for IoT devices to send data over the internet and allows users to monitor, analyze, and act upon the collected data in real-time.

How ThingSpeak Works

1. Create a Channel:

A channel is where data is stored. Each channel can have up to 8 fields to store data (e.g., temperature, humidity).

2. Send Data to the Channel:

IoT devices use the API key associated with a channel to send data via HTTP POST or MQTT publish.

3. Visualize Data:

Use built-in tools to visualize data using graphs, charts, or dashboards.

4. Trigger Actions:

Set conditions to trigger actions like sending notifications or integrating with other IoT platforms.

Applications of ThingSpeak

1. Smart Agriculture:

Monitor soil moisture, temperature, and humidity in real-time.

Automate irrigation systems using data-driven insights.

2. Home Automation:

Collect data from temperature, motion, or light sensors for better home control.

3. Environmental Monitoring:

Track air quality, water levels, or weather conditions in specific locations.

4. Industrial IoT:

Monitor machinery performance and generate alerts for maintenance needs.

5. Energy Management:

Analyze energy consumption and optimize usage patterns.

6. Academic and Research Projects:

Ideal for prototyping IoT solutions and conducting small-scale research.

 

Purpose of connecting ESP32 to IoT to send data to ThingSpeak

This project demonstrates how to connect an ESP32 microcontroller to the ThingSpeak IoT platform and send real-time temperature and humidity data collected from a DHT11 sensor.

System Workflow

1. DHT11 Sensor:

The sensor measures temperature and humidity.

2. ESP32:

Reads data from the DHT11 sensor.

Connects to Wi-Fi and sends the sensor data to ThingSpeak using HTTP POST requests.

4. ThingSpeak:

Stores the received data in a channel.

Visualizes the data using charts.

 

The necessary components

ESP32 Development Board:

ESP32 card

A microcontroller with built-in Wi-Fi capability to connect to ThingSpeak.

DHT11 Sensor:

A basic sensor that measures temperature and humidity.

Jumper Wires:

Fils de connexion

For connecting the DHT11 sensor to the ESP32.

Breadboard:

plaque d'essai

For assembling the circuit.

 

System Wiring

Schéma de câblage de la carte ESP32 avec le capteur DHT11Schéma de câblage de la carte ESP32 avec le capteur DHT11

For the DTH11 sensor, we connect:

- DATA pin to pin D23 of the ESP32 board

- VCC pin to the 3.3V pin of the ESP32 board

- GND pin to the GND pin of the ESP32 board

 

Micropython programming of the ESP32 carde ESP32

1. Setting Up ThingSpeak

1- Sign Up: Create a free account on ThingSpeak.

2- Create a New Channel: Add a new channel with two fields:

Field 1: Temperature

Field 2: Humidity

3- Get the Write API Key: Copy the Write API Key from the channel settings. This key is required to send data to ThingSpeak.

2. Micropyton program

Here is the complete code for reading data from the DHT11 sensor and sending it to ThingSpeak.

3. Testing and Output

1. Upload Code: Connect your ESP32 to the computer and upload the code using the Arduino IDE.

2. Monitor Serial Output:

Open the serial monitor to check temperature and humidity readings.

Ensure the Wi-Fi connection is successful and the data is sent to ThingSpeak.

3. View Data on ThingSpeak:

Log in to your ThingSpeak account.

Open your channel to see the real-time graphs of temperature and humidity.

The humidity values sent by the ESP32 card to the thinkspeak.com site 

The temperature values sent by the ESP32 card to the thinkspeak.com site 

0 comment

Leave a comment

Veuillez noter s'il vous plaît*

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Purpose of this website

Educational robotics refers to the use of robots and robotics technology to promote learning in educational settings. It involves the integration of technology, engineering, and computer science into the classroom, allowing students to engage in hands-on, project-based learning experiences.
In this context, our website represents an excellent resource for parents, teachers and children who wish to discover robotics.

Contact details

Zaouiet Kontech-Jemmel-Monastir-Tunisia

+216 92 886 231

medaliprof@gmail.com

Pictures of the articles

Robotic site created by MedAli-Teacher info