Measure Temperature With Arduino Ethernet + DS18B20 + Thingspeak





Introduction: 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:

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:

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

Follow the photo (sketch) for wiring your Arduino Ethernet with the temperature sensor. The sketch was prepared by Hans ( . 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

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

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 :)

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".



    • Water Contest

      Water Contest
    • Clocks Contest

      Clocks Contest
    • Creative Misuse Contest

      Creative Misuse Contest

    18 Discussions

    Dear Ahmed,

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

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

    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

    4 replies

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

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

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


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


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

    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.

    3 replies

    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.

    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};


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


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

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

    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.

    2 replies


    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.