Introduction: Plotly + Arduino Data Visualization

Picture of Plotly + Arduino Data Visualization + Arduino Data Visualization

I've been a fan of Arduino for years now, and have used it for building everything from MIDI controllers to simple LED flashers. One thing that has always intrigued me has been visualizing some of the data that I read off of the Arduino Pins. makes this simple. Really simple.

The purpose of this instructable is to demonstrate how to hook up an Arduino + Ethernet Shield and send data to's Servers and create beautiful graphs. We will be using a dual temperature+humidity sensor (DHT22), and sending the results directly to Plotly.

Step 1: What You Will Need:

Picture of What You Will Need:

(We will explain how to install the libraries in a later step)

  • Two pieces of (2 1/2" x 3 1/2" ) wood (1/4" thick)
  • Four (10-32x2in) Machine Screws
  • 12 Hex Nuts (10-32 Diameter)

Step 2: Hardware Setup

Picture of Hardware Setup
Step 1:
Connect your Arduino to your Ethernet shield

Step 2:
Connect the DHT sensor:
  • DHTpin1 -> 5v
  • DHTpin2 -> digitalpin2
  • DHTpin3 -> not used
  • DHTpin4 -> gnd

Step 3: Uploading the Sketch to Your Arduino

Picture of Uploading the Sketch to Your Arduino

Step 1:

  1. Download the Arduino IDE if you haven't already (We're using 1.0.5, but if you're using a WIFI shield, you'll have to use 1.0.3)
  2. Install Arduino onto your system

Step 2:
Download Libraries: (If you haven't already done so!)

You'll want to drop the library folders into your Arduino application folder. Ours is in: '/user/Documents/Arduino/libraries'. You can always check your Arduino preferences to find out where yours is if you cannot find it.

Once you find your Arduino folder, it should look like this:

  • Arduino/
    • hardware/
    • libraries/
      • plotly_ethernet/
        • plotly_ethernet.cpp
        • plotly_ethernet.h
      • DHT/
        • DHT.cpp
        • DHT.h

Once you've put the libraries in the correct place, restart the Arduino IDE.

Step 3:

  1. Download the Arduino/Plotly sketch for Temperature and Humidity visualization
  2. Open the sketch and change "username" and "api_key" to your plotly credentials.
  3. Make sure to change the "Stream Tokens" as well!
  4. Upload the sketch to your Arduino!

Step 4: Building the Enclosures

Picture of Building the Enclosures

We were inspired by this Instructable, and wanted to create something similar for this project. Simplicity would be key, as we wanted to have an aesthetically pleasing, yet still minimal and low-cost, finished product.

This design is so simple and wonderful, we'll leave it up to you! Its just drilling 8 holes, and assembling!

Remember to be accurate with your holes, as they have to match up. Measure twice, drill once! :D

Step 5: Wrapping It All Up!

Picture of Wrapping It All Up!

By now, you should be all set up and ready to go! You should have:

  • an Arduino that is programmed (not plugged into your router yet!)
  • an Arduino that is nicely bundled up into some kind of enclosure

Final Steps

  1. Plug in your Arduino to your router with the Ethernet cable
  2. Plug in your Arduino to power with the 9V Wall adapter
  3. After a few minutes, check your filewell on Plotly, and you will see your data stream in!

Happy Plotting!

Click here to check out an example using data taken from our living room in Montréal!


snoop911 (author)2016-05-29

Gave this a try, but didn't have much luck..

I'm using an arduino with a TI CC3100 , but while the Plotly server reports All Streams Go!, it doesn't plot any subsequent data that I send.

I verified that I'm sending it a properly formatted string, so I think the problem is somewhere between the TCP connection and the first data sent.

I tried re-establishing the tcp connection after I get the All Streams Go, then sending the data, but that still didn't work..

Anyone have any idea what could be the problem:

GyulaG made it! (author)2015-09-26

THX a lot!

GyulaG (author)2015-09-26

snoop911 (author)2015-08-11

What kind of data thruput could one reasonably expect using an arduino and a cc3100 wifi shield?

From the networking programming side, is there anything that can be done to maximize the data rate? For example, first establishing a connection with the api and servers, then sending the arduino data to the server using udp?

isenguard14 (author)2015-06-28

i thought i'm not gonna make it I built the code

VanchinathanV (author)2015-06-16


When I try my streaming URL for getting the data in json format, it gives the following output:


"data": [


"stream": {

"token": "your_stream_token_here",

"maxpoints": 100


"type": "scatter"



"stream": {

"token": "your_stream_token_here",

"maxpoints": 100


"type": "scatter"




Do you know how I can get the data is json format?

yeti9 (author)2015-05-11


Thanks for this instructable. Everithing works fine but I get a drift of Time stamp on Do you know what should I do to correct this drift ?


UbaidI (author)2015-05-06

Everything connects fine but I can't find the stream when I go to my filewell. I keep getting the following error even after re-trying several times. Can you help me?

JohnS81 (author)2015-04-26

How to configure the Arduino to work with through a router ?
I used ADSL router and thus IP changes frequently . In the sketch Arduino, in this article , you need to specify a constant external (White ) IP. But it is constantly changing for me, and the DHCP function for some reason does not work in Arduino . How to set up a job with the service Arduino using a router and assigning Arduino local IP type
Thank you in advance for your help !!
Igor .

BharathK9 (author)JohnS812015-04-27

Try allocating a Static IP for your Arduino Device.

1. Login to your Router ( from a browser

2. Learn to assign static IP lease (varies for every router).

It usually asks for your device's MAC address(mentioned on a sticker attached with the Ethernet shield) and for an IP to be allocated for the corresponding device.

Now the particular IP is always assigned only to the Arduino and never to other device even when the Shield is disconnected.

Image shows how-to for my router ( local brand ).

JohnS81 (author)BharathK92015-04-27


Thank you very much! I set up the router for your advice. Everything works!

BharathK9 (author)JohnS812015-04-27

Always happy to help.

Good luck,


arunkannu007 (author)2015-03-27

plotly_streaming_ethernet library is not detected by arduino .. please help !

rumanahmed.iub (author)2015-02-24

I am facing an error....

plotly graph= plotly ("user name", "api", "1st token","2 nd token", "which file name", "what");

would you tell me?

JoshuaA2 (author)2015-01-18

I try running the sample code but I keep getting this error:

'plotly' does not have a name type

Any help/suggestions would be appreciated.

erenecass (author)2015-01-15

PLEASE HELP. been having this problem

erenecass (author)2015-01-13

Hi! I would like to monitor two sensor data & plot them on two separate graphs. I have edited the "simple_cc3000.ino" in the example folder foundhere --> BUT the data from the two sensors are plotted on the same graph. how do i separate them?

jwei2014 (author)2014-12-22

Hi everyone,

May I ask if it is possible to put multiple temperature sensors into one set of Arduino equipment? I have many temperature sensors (up to 24) and I am looking for a way to streamline the data and plot the measurement of each in real time.

Thanks so much in advance!

vintesh made it! (author)2014-11-02

Hi Five.

MichaelJ2 (author)2014-09-04

Hi - this is amazing ... the ability to stream to Plotly is fantastic ... but I can't get it to work - is there anybody that can assist and maybe look over my code. I just can;t see where I'm going wrong! It's so frustrating,

AlejandroB1 (author)MichaelJ22014-09-14

Hi Michael,

Have you solved? If not, describe your problem and I will try to help.



MichaelJ2 (author)AlejandroB12014-09-15

Hi Alejandro, thank you for the response.

No it does still not work. My graph gets created but no data is logged at all. I can see data flowing to and I have triple checked my username, code and token details. I connect to Plotly, data streams but nothing is ever graphed.

I can email you the code and the screenshots etc. if it will help.

I've not heard back form the team recently - it's been a month that I've been trying to get some support from them so any help you can provide I'll be very grateful for.

AlejandroB1 (author)MichaelJ22014-09-20

Hi Michael,

I sent you my email address, please send your code and I will have a look.



MichaelJ2 (author)AlejandroB12014-09-25

Hi Alejandro

Thanks you so much for your offer to help - very much appreciated!

I managed to get in contact with the Plotly team and they were able to assist me - it's working now :)

Thanks again!

AlejandroB1 (author)MichaelJ22014-09-27

Hi Michael

Great to know that it is working now.

Best regards


mba7 (author)2014-09-21

I made an equivalent tool in python that print real time data from ADXL345 accelerometer.

may be it will be helpful for someone

joeybab3 (author)2014-09-07

is there a way to store this in a flat file (.txt or somethingrather) and than upload it to plotly? this would be useful on a quadracopter.

AlejandroB1 (author)2014-08-07

Thank you very much for this Instructable. I followed every step and now I am streaming PM2.5 and WBGT data from an Arduino.

I can visualize the values that are sent from the remotely unit, without being at that place.



plotlygraphs (author)AlejandroB12014-08-08


zuljin (author)2014-07-06

Could somebody upload the sketch modification for ENC28j60 please? I can't find it anywhere :S

Shirk27 (author)2014-04-08

Been having a problem with the programming side of this, getting an error that seems to be from the IDE not including the libraries correctly.

plotlyethernettemphumid:13: error: no matching function for call to 'plotly::plotly()'

Shirk27 (author)Shirk272014-04-08

Here is the console

Nook1 (author)Shirk272014-04-16

I'm having the same problem.

As mentioned in the site the libraries should be placed like:

  • Arduino/

    • hardware/
    • libraries/

      • plotly_ethernet/

        • plotly_ethernet.cpp
        • plotly_ethernet.h
      • DHT/

        • DHT.cpp
        • DHT.h

But after downloading the libraries , I'm getting:
I think that's the problem.

focamonca (author)Nook12014-04-24

did u solved?

plotlygraphs (author)focamonca2014-04-24

Hi all! So sorry for the broken pieces. We updated the Arduino library (https:// but forgot to update the instructable examples. I just updated the example code with the new library, so give a try now!

focamonca (author)Nook12014-04-24

WOW plotly great support to who has problems!

Nook1 (author)focamonca2014-04-24

Yeah, this problem was solved by me. All you have to do is update the libraries with the files plotly_ethernet.cpp and plotly_ethernet.h you will get them here:

The link given at this site are updated libraries as they are for streaming purposes so when you download you will get "plotly_streaming_ethernet.cpp" and "plotly_streaming_ethernet.h" but in given code we have used "plotly_ethernet.cpp and plotly_ethernet.h", so use the libraries from gist.github.

If you want to use the updated libraries and use streaming tokens and get the graph, use this sample sketch:

use these libraries for the sketch:

(before all this make sure that your network has DHCP enabled, otherwise plotly's servers won't be to communicate with the shield).

plotlygraphs (author)Shirk272014-04-24

Thanks for reporting! We updated the Arduino library ( so that the graphs update in real-time (here is an example: but forgot to point this instructable to the new code. I just updated the example code, so give it another try now! So sorry for the inconvienence.

focamonca (author)2014-04-24


plotlygraphs (author)focamonca2014-04-24

hey dude! Check out the post up above, and e-mail me at if you're having problems with the new library. I'll update this 'ible ASAP.

Thank you for your patience

plotlygraphs (author)2014-04-24

Hey guys!

Sorry about the issues you've been having. We recently updated our Libraries to include streaming!

I'll make sure to fix this 'ible ASAP, but for now if you want to check out:
There is a new script and library there, you can read all about it!

Let me know if you have any issues, feel free to email me:


focamonca (author)2014-04-24

PLEASE plotly help us with problems

drmpf (author)2014-04-10

If you want to do something similar but plot and save the data on your Android phone via bluetooth or wifi check out

"Simple Remote Data Plotting using Android / Arduino / pfodApp"

and "Arduino for Beginners, now with data plotting, controlled by Android"

TSJWang (author)2014-01-11

Hey nice project!

What about using Processing to sketch out data sent to the serial port? Would that decrease the delay?

Armandur (author)TSJWang2014-01-12 does this with very little delay, imperceptible from realtime plotting.

plotlygraphs (author)Armandur2014-03-15

Woah, that's awesome! We just made a "real-time" version of our plotting available, and plotted data with that hear-rate sensor. Here is the video:

TSJWang (author)TSJWang2014-01-12

I guess it is a LOT cooler to have data online.

It depends on the purpose: quick testing that does not need to be recorded [processing]

data collection to be shared and displayed [plotlygraphs]

long term data collection, portable [analogRead values stored in SD card, then excel]

plotlygraphs (author)TSJWang2014-01-12

Hey! Thanks for checking out our Instructable. Our goal for the Plotly project is to let you send data right into the browser. Then, you can edit, share, and analyze your data and graph all in one place. So, here is our humidity and temperature graph you could share and edit with others:

kerimil (author)2014-03-15

can't get the library to work... I follow the instructions and I can't even install it properly

amcdawes (author)2014-01-14

Great example for One tip for making cases like this is to hold the top and bottom together when you drill... that way you only drill four holes and they automatically align.

About This Instructable




Add instructable to: