
This course includes our updated coding exercises so you can practice your skills as you learn.
See a demo
Learn how to transmit temperature sensor data across Arduino Uno, ESP LoLin, and Raspberry Pi using DHT22 and MQTT, with hands-on setup and firmware workflows.
Connects a DHT22 temperature sensor to an Arduino Uno and LoLin NodeMCU via breadboard rails, establishing ground and supply connections, and wiring data pins for serial communication.
Install and configure the Arduino desktop IDE for Arduino Uno and NodeMCU LoLin, install essential libraries, and set up Raspberry Pi with mqtt broker and remote access.
flash the Raspberry Pi OS onto a micro SD, configure Wi‑Fi, enable SSH and VNC, and install a Mosquitto MQTT broker and client for subscribing to topics from ESP node.
Install and configure Visual Studio Code, add the Remote - SSH extension, and connect to a Raspberry Pi from within the IDE to run commands and browse files.
Read temperature data from a DHT sensor using Arduino Uno and transmit it to LoLin; configure libraries, use software serial on pins 2 and 3, and format data for transmission.
View the temperature data output in the serial monitor after selecting the Arduino Uno and its correct port. Compile and upload the firmware, or upload directly with auto-compile.
Program the NodeMCU LoLin to receive temperature data from an Arduino, timestamp with NTP, and publish a JSON payload via MQTT to a Raspberry Pi broker.
Access the Raspberry Pi remotely and subscribe to mqtt messages, as the Arduino Uno is powered up and data starts coming.
Learn to connect and power hardware, install the Raspberry Pi operating system, use Arduino IDE for Uno and NodeMCU, read temperature data, and publish via MQTT to Raspberry Pi.
Explore GPIO to pin mapping, software serial and digital pins, and secure MQTT with MQTTS; build FTP access, cloud integration, dashboards, and predictive analytics for temperature data.
IOT practice with temperature sensor data
Reading and visualization of temperature data is a good example to help us understand the world of IoT. It is easy to implement and you can find out more interesting user scenarios anytime if you want.
Since the NodeMCU LoLin supports multiple Wi-Fi modes, we can publish temperature data to a remote server. This means that by the end of this course, you will be able to send temperature data anywhere you want.
Additionally, since the IoT hardware in this course is battery-powered, you can collect temperature data from anywhere. All you need is a Wi-Fi hotspot (or a smartphone).
We can just connect NodeMCU LoLin directly to temperature sensor DHT22, get temperature data from it, and then publish it to a remote Raspberry Pi. But in this course, I just wanna show you how to use an Arduino UNO in between. One reason is that with this solution, you have more free pins. For the future, if you wanna connect more IoT hardware to NodeMCU LoLin, the IoT infrastructure has already been well prepared by this project.
Through this IoT project, you will learn:
Hardware
Connect IoT hardware components so that they can work together.
Power up IoT hardware.
Software
How to get temperature data from a temperature sensor DHT22.
How to forward temperature data from the sensor to Arduino UNO.
How to connect Arduino UNO and NodeMCU LoLin by using Breadboard.
How to forward temperature data from Arduino UNO to NodeMCU LoLin.
How to transmit temperature data from NodeMCU LoLin to remote Raspberry Pi via MQTT Message.
Development Environment
Set up a Development environment using Arduino IDE and Visual Studio Code.
Programming and Upload code from laptop to Arduino Uno and NodeMCU LoLin.
Production Environment
Use Battery supply for IoT Hardware so that you can take your IoT Hardware everywhere.