Getting sensor data from an Arduino and sending it over the Internet to display the data in a graph can be a rather challenging task. This task is made extremely easy when using a IoT (Internet of Things) web service instead of setting up the Arduino to host a web page that contains the sensor data graph. Any Arduino board that has Ethernet on it or any Arduino board with an Ethernet shield can be used to make an Arduino Internet graph.
Arduino Internet Graph
An Arduino Internet graph can easily be made by using the ThingSpeak platform to do all the hard work like capturing the sensor data and plotting it to a graph. The image below shows Arduino analog pin A0 voltage plotted on a graph that is displayed in an account on the ThingSpeak website.
Arduino Internet Graph
How it Works
A ThingSpeak library is installed in the Arduino IDE using the Arduino library manager. The library provides functions that can be used to communicate with the ThingSpeak web server.
A free account can be opened on the ThingSpeak website which allows channels to be created. Data from the Arduino, which can be sensor data, voltage, or any other data, can then be sent to the channel and plotted on a graph at the website. Each channel can have up to eight fields, enabling data from up to eight sensors to be sent over one channel.
When using ThingSpeak, no SD card is needed and the Arduino and Ethernet shield or other Arduino board that has Internet capabilities is set up as a client rather than a server. No special Internet router settings need to be made when the Arduino is used as an Internet client, making setup and use very easy.
Arduino Internet Graph Plotting Tutorial
A full tutorial on how to plot sensor data over the Internet with Arduino is available in the article Logging Data and Displaying Graphs over the Internet with Arduino.
The tutorial on how to send text from a web page to an Arduino LCD sets the Arduino, Ethernet shield and micro SD card up as a web server with LCD attached. Two HTML text inputs allow text to be sent to each line of the LCD from the web page hosted by the Arduino.
The image below shows the web page in a web browser that has sent text to the LCD.
Sending Text from a Web Page to Arduino LCD
Text is sent to the Arduino from the web browser over the network with an HTTP GET request when the button on the web page is clicked.
Go to the tutorial now →
In this tutorial, an Arduino MEGA 2560 and Ethernet shield are used to make a web server that hosts a web page that allows 24 outputs to be controlled using checkboxes. The tutorial on the Arduino MEGA web server contains the circuit diagram and all of the source code for the project.
This tutorial was written to answer a question on the blog about the Arduino web server tutorial.
An image of the web server with the web page used to control 24 LEDs is shown below.
24 Output Arduino MEGA Web Server using the Ethernet Shield
Arduino boards such as the Arduino Uno have a serial port that is linked to the USB port on the board. When data is sent out of the serial port in an Arduino sketch using a function such as Serial.print(), then the data goes out of the Atmel AVR microcontrollers (which is the main Arduino microcontroller) serial port to the small Atmel microcontroller on the board that handles the USB communications. This small microcontroller then sends the serial data out of the USB port.
The data that is sent out of the Arduino USB port can be displayed in the Serial Monitor window of the Arduino IDE as shown in the image below.
Opening the Arduino Serial Monitor window.
Data can also be sent from the Arduino IDE Serial Monitor window into the Arduino. Part 19 of the Arduino programming course shows how to send a character, string and number from the Arduino Serial Monitor window to the Arduino board.
A single character is easy enough to receive and process in an Arduino sketch. A string requires a bit more work because it must be assembled from the characters received via the serial port. A number is captured as a string and then must be converted from a series of characters into an actual number.
Go to the tutorial (part 19 of the Arduino programming course) to learn how to handle Arduino serial input →
The Arduino programming course continues with arrays and strings as the next two parts of the course. Part 17 of the course shows how arrays work in Arduino sketches. Using strings and the two type of strings in Arduino programming are covered in part 18 of the course.