Monitor temperature and humidity with MQTT

Tell us the story of your project: 

MQTT is an easy to use protocol that enables IoT devices to pass messages. In this project, I used the integrated WiFi capability of the RTL8195 Ameba-1 development board together with a DHT temperature and humidity sensor to send and receive MQTT messages containing the sensor readings.

How-to: 

In this project I am using the Ameba-1 development board from Realtek, based on the RTL8195/RTL8710 soc, part of its AmebaIoT ecosystem. This board can be programmed using the Arduino IDE and is pin compatible with many sensors and expansion boards. It also has WiFi, NFC, and USB Host functionality as well, making it suitable for many IoT applications. Any other development boards capable of a WiFi connection can also be used, but the code will need to be changed.

 

To begin with, ensure that you have the Arduino IDE installed and configured for programming the Ameba-1 board. Instructions to do this can be found at https://www.amebaiot.com/en/ameba-arduino-getting-started/

 

Next, connect the DHT11 sensor module to the board by following the wiring diagram in the youtube video here

 

Once the wiring is done, connect the board to the computer. Download the code provided at this GitHub link and open it in the Arduino IDE. Before you upload the code to the board, there are a few changes that need to be made to the code. Please make the following changes:

  1. Line 16 - enter the name of the WiFi network the board will connect to
  2. Line 17 - enter the corresponding password of the WiFi network
  3. Line 20 - enter the URL or IP address of the MQTT server to use. If you do not have your own server to use, you can choose to use the free server at test.mosquitto.org

Upload the code to the board once these changes are made.

 

On your Android/iOS mobile device, download and install a MQTT client from the app store if you do not have one already. Configure the app to use the same MQTT server, and subscribe to the topic "ameba_xxx" shown on line 12 of the code. The Ameba-1 board will send a MQTT message with the updated sensor readings every 10 seconds. Blow on the sensor or heat it up, and you can see the published sensor readings change on your phone.

Difficulty: 
Duration: 
Share a "Show & Tell" video.: 
https://www.youtube.com/watch?v=d8Tzw9wZxBE
Collaborators: 
wyy170592
Number of Forks: 
0
Tools: 
Name: 
Arduino IDE
Quantity: 
1
Materials: 
Name: 
Connecting wires
Quantity or amount: 
1
Name: 
DHT11 Temperature and Humidity Sensor Module
Quantity or amount: 
1
Boards & Kits: 
Name: 
Realtek AM8195
Quantity: 
1
Team Members: 
Team member name: 
wyy170592
What role did this person play on the project?: 
Project Lead
Public
Sort Order: 
0
Teaser: 
Use the MQTT protocol to monitor the temperature and humidity of a location constantly.
Show & Tell video as default: 
Creation Date: 
Monday, March 23, 2020 - 11:33