Monitor my home environmental parameters remotely is one of the most desirable things I have ever wanted to make. It’s not about purchasing such a system that can get the job done for me. But, passion to create it myself. So, today, I am going to connect the popular DHT sensor to an online MQTT broker “server”. The sensor will publish its temperature and humidity readings to the broker. Then, from even outside the home, I can get these readings on my smartphone.
As another tutorial of this continuous IoT Blog Series, I will use this sensor with Arduino and IoT Shield from 1Sheeld to get its readings over the internet. I will make an Arduino Temperature Humidity System that I can monitor anywhere, anytime on my smartphone using IoT.
In this Arduino Temperature Humidity System tutorial, I am going to connect 2 devices to an online MQTT server “broker”, the sensor, which is just an Arduino with a DHT11 sensor and the smartphone. The sensor will publish its humidity and temperature readings to certain topics. And the phone will subscribe to the same topics. Hence, it gets all the sensor readings as messages and visualizes them on the screen.
Since the broker is online, then you need to connect the Arduino to the Internet, then connect it to the broker.
But Arduino alone can’t do that, so I will use the IoT Shield from 1Sheeld+ board that will be plugged into the Arduino and connect it to the online MQTT broker.
Also, you will need an iPhone “since IoT Shield works with iOS only” to be connected to the 1Sheeld via Bluetooth. And another one “iPhone or Android” that will act as the controller device where you will use it to publish “close” and “open” message through an IoT app.
You will find all the software and Apps required for this tutorial linked in the software components section.
If this is your first time to deal with 1Sheeld or you want to learn more about it, then I recommend checking this quick and easy getting started tutorial.
Furthermore, if this your first time reading about MQTT broker, then I recommend you go through this MQTT before going into this tutorial.
I will use the DHT11 sensor, so you can go through this tutorial to get familiar with it. Also, you will find the sensor library. You should download it and copy it to the same folder of your Arduino sketch of this project.
Now, after you’ve become a little bit familiar with 1Sheeld and MQTT broker, let’s start!
Step 1: Hardware components:
Arduino USB cable.
Male-to-female jumper wires.
iOS phone with 1Sheeld App installed on it.
Android/iOS phone with the IoT MQTT Panel Pro installed on it.
Connect the DHT sensor with the Arduino as illustrated below:
Switch the 1Sheeld power to operate on 5v (Not the 3.3v):
1Sheeld have 2 modes: Uploading mode and Operating mode. You can switch between them using the switch close to the Digital pins and is called “UART SWITCH” on 1Sheeld and “SERIAL SWITCH” on 1Sheeld+.
Firstly, you slide the switch towards the “SWITCH” notation which turns the 1Sheeld board into the Uploading mode to let you upload the Arduino code.
Then, after you finish uploading the code, slide the switch towards the “UART” notation (or “SERIAL” at 1Sheeld+ board) which turns the 1Sheeld board into the Operating mode to communicate with your smartphone 1Sheeld App.
Finally, connect the Arduino via your PC using Arduino USB cable.
Step 4: Code:
I would recommend checking the Arduino IoT Shield documentation to know more about the Arduino IoT Shield functionalities and how to use them.
Arduino keeps standing out from the crowd of all-around development boards due too its ease of use and budget price. As a result, this has enabled almost anyone to get his own idea into life no matter how crazy or even useless to the whole world it was, except for its maker! Also, it has …
Arduino robots are always funny and definitely more enjoyable when combined with robotic arm! And today, I will walk you through the making of a simple Arduino Robot Arm that’s made of cardboard and how you can attach it over your Arduino Bluetooth RC Car / Robot that you have made so far through this series. …
Arduino Line Following Robot is one of the easiest and most well-known projects that anyone can make to learn the basics of programming, electronics, and mechanics all in one project. It’s known that this project is common for most of the makers and tech students and today I am going to give it a revisit …
Back again with another Arduino Bluetooth RC Car tutorial but with an advanced feature that makes your car autonomous by adding ultrasonic sensors to the RC Car you have made before!. Yeah, I know that you may have seen other tutorials using ultrasonic to make the car/robot avoid obstacles ahead, but I am going to …
Cardboard crafts are one of the most popular and easy to make DIY stuff. Mixing this with the unmatchable enjoyment of RC Cars and the ease of using Arduino, I am going to show you how to make a Cardboard Arduino Bluetooth RC car that you can control via Bluetooth from your smartphone. …
Arduino Security Camera Have you ever wanted to check your home in real time? Afraid that maybe someone has stormed in, don’t remember if you shut the door or not or maybe wanna check if your Hyper-energetic dog has broken any of your dishes AGAIN!! 🙂 Then this is the perfect place for you cause today …