Monday , 25 September 2023
Breaking News
Home > Tutorials > Arduino Tutorials > Live Temperature Chart in Arduino with DHT11 Sensor

Live Temperature Chart in Arduino with DHT11 Sensor

Hello Friends! Hope you will be fine. Today we are going to learn something interesting. Yes offcourse, really interesting. We are going to make a live graph that will show us Temperature of our home or device in a live graph. For this, we will use HighCharts jQuery library that will generate chart on the screen for us. So let’s start our work.

Note: You should continue with our previous tutorials based on Arduino, I am giving links to those tutorials below:

Tutorial 1 : How to save DHT11 Temperature Data into Database with Wemos D1 Mini

Tutorial 2 : How to use the DHT11 Temperature and Humidity Sensor with Arduino!

So now, what we need, we need some PHP and Javascript files. Open your favorite text editor and paste below code into and save it in “temperature” folder that you created in previous tutorials and name it as  index.php:

one thing more, as you can see in this code at line no 22 “live-server-data.php”. This is the file that responsible for fetching data from the database and generate data in json format. Now let’s look at that file:

You can see in above code that we are fetching data from the database that we created in previous tutorials and then encode it in json format and then get on the chart with the help of HighCharts Jquery Plugin. You cand change line no.4 to 8 that matches your database server. After all open your URL like this [YourHostName]/[FolderName]/ and see it live, but remember that your have to run Arduino software and attach sensor as in previous tutorial.

I am giving you required files along with Javascript files just put it into your server where you placed the folder for this tutorial.

Hope you enjoy this tutorial. If you have any question or facing problem, please feel free to comment. Thanks.

About Muhammad Faryad

Muhammad Faryad is a professional web application developer. He has been working for 5 years in ICE786 Technologies Pvt. Ltd as a Senior Programmer and Developer. You can contact him on facebook at www.facebook.com/tolamangali

One comment

  1. its very helping.
    thanks a lot

Leave a Reply

Ad Test

%d bloggers like this: