Measure Temperature With Arduino Ethernet + DS18B20 + Thingspeak

28,164

68

18

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

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

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

Share

    Recommendations

    • Paper Contest

      Paper Contest
    • Sweet Treats Challenge

      Sweet Treats Challenge
    • Remix Contest

      Remix Contest

    18 Discussions

    0
    None
    mohamantAhmedE456

    Reply 1 year ago

    Dear Ahmed,

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

    0
    None
    sloba88

    2 years ago

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

    0
    None
    BallscrewBob

    2 years ago

    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
    0
    None
    mohamantBallscrewBob

    Reply 2 years ago

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

    0
    None
    BallscrewBobmohamant

    Reply 2 years ago

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

    0
    None
    JasonS11AlvinL5

    Reply 3 years ago on Introduction

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

    0
    None
    funinalaska

    3 years ago on Introduction

    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
    0
    None
    mohamantfuninalaska

    Reply 3 years ago on Introduction

    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.

    0
    None
    funinalaskamohamant

    Reply 3 years ago on Introduction

    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>

    0
    None
    mohamantfuninalaska

    Reply 3 years ago on Introduction

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

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

    0
    None
    VU2IIAM

    3 years ago on Introduction

    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
    0
    None
    mohamantVU2IIAM

    Reply 3 years ago on Introduction

    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.

    Capture.PNG