Introduction: Measure Temperature With Arduino Ethernet + DS18B20 + Thingspeak

Picture of Measure Temperature With Arduino Ethernet + DS18B20 + Thingspeak

Hi all,

Here I will let you know how to read temperature using DS180B20 sensor and Arduino Ethernet, and send the data to Thingspeak. You can access my Thingspeak page here:

https://thingspeak.com/channels/25037

I have utilized my old instructable arduino with the same temperature sensor, and I could read the temperature by accessing the arduino web. You may refer to my old instructable at the following link:

https://www.instructables.com/id/Measure-temperatur...

Now I have integrated my Arduino Ethernet board with thingspeak so it can transmit the temperature data to my thingspeak account and chart the data as well. Moreover, I changed the way of displaying the temperature from number to a google gauge (as you see in the picture).

So lets explain how to do that.

Step 1: Arduino+Temperature Sensor Wiring

Picture of Arduino+Temperature Sensor Wiring

Follow the photo (sketch) for wiring your Arduino Ethernet with the temperature sensor. The sketch was prepared by Hans (http://www.tweaking4all.com/hardware/arduino/arduino-ds18b20-temperature-sensor/) . You can see the other two photos are for my breadboard during the test and my arduino ethernet board.

Step 2: Setting Up Thinkspeak Account

Picture of Setting Up Thinkspeak Account

First you need to sign up for a new account. It is very easy process.

Then, go the channel page and click on new channel. Here you can customize your Y-axis labeling and other information. But the most important thing is to know your channel ID number.

After noting down your channel ID, go to the API key column and write down you key. I will let you know where to put those details in the next step.

Step 3: Add a Google Gauge Plugins

Picture of Add a Google Gauge Plugins

To add a google gauge plugins to your Thingspeak page. Click on Plugins tap as shown in the picture. Next, click on New plugins.

Then you will be entered to a coding page. Go to Javascript coding (the last one).

First few lines, you will see a place where you can put your channel ID and API key which you noted down in the previous step. Save the changes.

You need to add the plugin window to your channel page. You will find a grey tap in the main channel page, and you will be able to add a new window for charts or plugins.

Step 4: Preparing Your Sketch and Upload It to Arduino

You may refer to the attached sketch for your arduino. Edit the code and put your Arduino address, API code ... etc.

Once done, upload the code and power up your board.

Step 5: Here We Go :)

Picture of Here We Go :)

Now, power up your arduino and establish an ethernet connection. Thingspeak will be updated periodically.

Any questions or suggestion for improvement you are welcome. But, sorry to tell you this "I am not a programmer".

Comments

AhmedE456 (author)2017-02-19

Dear mohamant

How you can extend this code to multiple ds18b20 measurments . many thanks

mohamant (author)AhmedE4562017-02-22

Dear Ahmed,

It should be possible. But, I cannot help you now. You may consult a programmer. Sorry Ahmed.

sloba88 (author)2016-08-23

"Connection to ThingSpeak Failed (1)" ???

BallscrewBob (author)2016-05-31

How did you get your guage on your public channel.?

I don't get the same screens that you show and can only display on a private channel

mohamant (author)BallscrewBob2016-06-02

I think you need just to add the same gauge in the public channel.

BallscrewBob (author)mohamant2016-06-02

I have tried many methods but it wont let me use them in public.

mohamant (author)BallscrewBob2016-06-03

That is strange... Sorry I don't know

mohamant (author)BallscrewBob2016-06-03

That is strange... Sorry I don't know

AlvinL5 (author)2015-08-14

Hello, how do we position the gauge to sit in the center of the channel view screen?

JasonS11 (author)AlvinL52015-08-25

Edit the gauge and change the CSS width to match the JavaScripts width.

Java:

options = {min: 60, max: 110, width: 240, height: 240....}

CSS:

#gauge_div { width: 240px; margin: 0 auto; }

mohamant (author)AlvinL52015-08-17

I tried to center mine, but did not succeed. Sorry, I dont know how..

funinalaska (author)2015-08-14

I need assistance with the plugin. I have a DS18B20 and am using an ESP8266 Wifi module. I have communications and data and the graphs look great, but I can't seem to manage to change the gauge to do what I need. I need the gauge to show from -20 degrees to 100 degrees This is for an outdoor thermometer in the USA. Any help would be greatly appreciated. Thank you in advance.

mohamant (author)funinalaska2015-08-17

Hi,
I understood from your comment that you want to adjust the gauge range, isn't it?

If yes, please refer to my reply to VU2IIAM below.

funinalaska (author)mohamant2015-08-17

For some reason the script in my gauge is very different

There is no option for max and min there. The max has a setting up near the top of the script but there is nowhere to change the min.

chart = new google.visualization.Gauge(document.getElementById('gauge_div'));
options = {width: 220, height: 220, redFrom: 100, redTo: 100, yellowFrom:100, yellowTo: 100, minorTicks: 5};

loadData();

// load new data every 15 seconds
setInterval('loadData()', 15000);
}

</script>

mohamant (author)funinalaska2015-08-18

Try to write down the min and max in your script:

options = {min: -10, max: 100, width: 220, height: 220,.........

VU2IIAM (author)2015-06-01

Hi, how did you get full scale gauge set to 50. In my case full scale gauge is showing up to 100. Please guide. Thanks in advance.

mohamant (author)VU2IIAM2015-06-03

Hi

Go to Plugins page in your Thingspeak account. Then, in the edit page of your gauge, just scroll down till you see the line highlighted in the picture below. Just edit the max value with the value want. That's it.

VU2IIAM (author)mohamant2015-06-05

Thank you.

About This Instructable

25,379views

68favorites

License:

More by mohamant:Measure Temperature with Arduino Ethernet + DS18B20 + ThingspeakMeasure temperature on the web with Arduino Ethernet and DS18B20 sensor
Add instructable to: