Remote visualization of real-time sensor data.

This tutorial describes in detail how to use the free SensorMonkey service to push real-time sensor data from an Arduino to a webpage for visualization using Processing.js. No server-side coding or Ethernet shield is required. A standard, run of the mill Arduino will work perfectly. You'll also need a sensor to sample some values. I use an accelerometer, but anything will work (a potentiometer, a gyroscope, a tilt sensor, a temperature sensor, a light sensor etc.). If you don't have a sensor, it's still possible to follow the tutorial by sampling the floating input voltages on the Arduino's analog pins as a (somewhat) crude substitute.

After configuring the Arduino to sample sensor values, I use SensorMonkey to publish the data live over the Internet in real-time (Disclosure: I co-founded the company developing SensorMonkey). Using SensorMonkey, I can access the data from any device connected to the Internet and use it to drive a real-time webpage. Proxies, firewalls and NATs can all be traversed. Best of all, it works with standard Arduino boards (Unos, Duemilanoves etc.) and does not require an Ethernet shield. Instead, I use free software called Bloom to network-enable the Arduino and connect it to SensorMonkey. In this tutorial, I visualize the data using Processing.js.

UPDATE 26-06-2012: Non-Windows Users
As an alternative to Bloom for non-Windows users, I have uploaded a Processing sketch, named SensorMonkeySerialNet, to our GitHub account. This sketch is a serial-to-network proxy that also serves Flash Socket Policy files inline. It can be used instead of Bloom in Step 3 for users running Mac OS or Linux.

Step 1: Gathering Materials

The following combination of hardware and software is required to complete this tutorial:


- Arduino (I use an Uno but older boards such as a Duemilanove will work fine)
- USB cable to connect Arduino to host computer
- Analog sensor (I use a ADXL335 accelerometer)
- Assorted wires to connect your sensor to the Arduino


- Arduino development environment (http://www.arduino.cc)
- Free account on SensorMonkey.com (login with your existing Facebook account)
- Bloom (serial port to TCP/IP socket redirector for Microsoft Windows)
- Processing.js
<p>I know it is a simple circuit, but I have just got to say: That's a great photo of a nice, clean breadboard and workspace. Well done.</p>
<p>Im doing a project similar to your description, But Im using android cam as webcam, usin Droid cam app. and Im not usin Pan and tilt, It is just stationary.</p><p>Now in my project I have to turn on the webcam depending on PIR sensor output which is interfaced with arduino UNO. Im also using sensor monkey, bloom and justin.TV , how can I achieve it. Please do help me .<br><br>prajjujan@gmail.com</p>
Hi I'm a total beginner and I'm trying to follow along with the tutorial, I just have one question, how would the tutorial differ if I'm using an arduino YUN, what steps would I leave out?
You we're right, it is a Frontpage problem. I had a problem with where the processing.js file was located, apparently I needed to have the whole URL in there. Once I did that the connection error went away. <br> <br>I am now getting the same problem as the user below that was only getting the outline of the graphs. I can view it on Sensor Monkey as a remote sensor without any problems, so I know it is streaming. I assume it is a problem with my HTML code then. I have entered my name and public key in the right place, all the text, and without quotation marks. I am new to HTML, and not sure why I am seeing nothing as a result. I can send you the code I have here if it will help. Thanks for your quick response. I hope I can get this thing working.
Hi, <br> <br>If you're still having problems you can send me the code and I can take a look through it for you. It could be one of a number of things. <br> <br>Either send me a private message through Instructables or mail it to sensor.monkeys@gmail.com if you can. <br> <br>Sincere apologies for the delay in getting back to you.
I have the same problem. I am using Microsoft Frontpage and when doing the preview mode, it continually gives me the error &quot;'Processing' is undefined.&quot; I have downloaded the processing-1.4.1.js file and have it referenced in my program the same way as demonstrated above. Any idea why I keep getting this same error?
I'm not familiar with Microsoft Frontpage so it may be an issue to do with its 'preview' mode. <br> <br>I would suggest uploading your files to a webserver (one running on your local machine will do) and testing it out to see if the error message persists.
I only get the outline of the graphs not the data on the web page? any ideas
Hi, <br> <br>Can you check that you are not receiving any JavaScript errors inside your browser? Can you also verify that you can see your stream in the 'Remote Sensors' tab in the SensorMonkey Control Panel (this will tell you whether your data is being streamed correctly). <br> <br>If you're not receiving any errors and your data is being streamed correctly then double check that you have entered the correct namespace/streamname details in your HTML viewer page (as described in Step 6). These are unique for every user.
I signed up an account with Sensor Monkey. I'm having no success in graphing data from a picaxe sending decimal numbers with the serial port. Such as &quot;72&quot; for 72 <br> degrees. I got Bloom to connect, baud rate is correct, its just the graph is all missed up. How do I set up the Format Description File to receive decimal numbers from the Picaxe?
Hi, <br> <br>SensorMonkey only supports binary data encodings. So, when sending the decimal number 72, for example, you can't send it as two separate characters, i.e. &quot;72&quot; where '7' and '2' are the characters. Instead, you have to encode it as an 8-bit binary number, i.e. a single byte containing a bit sequence of 01001000. You do this by writing the raw value to the serial port directly. <br> <br>Basically, if you are using the PICAXE function sertxd, make sure you DO NOT put a # symbol in front of the variable or value that you are trying to send. Then, in your format description file, you can use an unsigned 8-bit integer (i.e. u8) to read and graph the data in the SensorMonkey control panel.
Yes, that does work. Thank you.
This is an intriguing idea. I have a couple of suggestions to <br>make this more accessible. <br> <br>1) It should be possible to create an account on SensorMonkey.com <br>without Facebook. Facebook-centric is a definite disadvantage. <br> <br>2) Linux support would be extremely helpful. Bloom or equivalent <br>is probably not necessary on a Linux machine.
Hi Grendel,<br> <br> Thanks for the comments and apologies for the belated reply.<br> <br> In response to point (1), we are currently assessing alternatives to Facebook for user logins.<br> <br> As regards point (2), I have uploaded a Processing sketch to our GitHub account. The sketch is named <a href="https://github.com/sensormonkey/SensorMonkeySerialNet" rel="nofollow">SensorMonkeySerialNet</a> and runs on Mac OS and Linux. It's not as full-featured as Bloom, but should enable users to connect their Arduinos to SensorMonkey without needing Windows.
<br> <br>Yeah NO facebook <br> <br> <br>And of course anything Linux is good, mayb it;ll work with wine? <br>HANKIENSTIEN <br>rduino.com
this would work pretty well with the <a href="https://www.instructables.com/id/Twittering-office-toilet/" rel="nofollow">twittering toilet</a> idea...&nbsp;&nbsp; ;)

About This Instructable




More by amccoy6:Remote controlled webcam using Arduino, SensorMonkey, jQuery and Justin.tv Drive a webpage in real-time using Arduino, SensorMonkey and Processing.js 
Add instructable to: