Arduino Serial Port To Excel
Importing Data from Arduino to Excel (Real Time) Posted on March 24, 2014 by tonyb0y As I have started my Air Quality project I was searching the web, trying to find information hot to calibrate my new Grove Dust Sensor (I would appreciate any information on this), my eye caught this site (Robottini) and I can say that I was excited.
The Arduino Serial Plotter function has been added to the Arduino IDE, allowing you to natively graph serial data from your Arduino to your computer in real time. If you’re tired of seeing your Arduino’s analog sensor input data pour onto your screen like The Matrix, this looks like a prettier way to visualize what’s going on. A Serial plotter is an offline tool allowing you too Visualize data and troubleshoot your code offline without having to use third-party services like Processing or Plotly. Since there is no official documentation on the Arduino website regarding the use & functionality of the Serial Plotter, I decided to documents its uses and features.Features. Plotting of Multiple Graph. Offline. Auto-Resize Graph.
Supports Negative Value graphs. Auto-scroll along X-axis. Different colors for each variableApplications. Offline Data Visualization. Code Troubleshooting. Waveform AnalysisParts RequiredArduino - or Arduino Starter Kit. Now that you have installed the latest version of the Arduino IDE(1.6.7 or above) its time to understand how the Serial Plotter actually works.
The Arduino Serial Plotter takes incoming serial data values over the USB connection and is able to graph the data along the X/Y axis, beyond just seeing numbers being spit out on to the Serial Monitor. The vertical Y-axis auto adjusts itself as the value of the output increases or decreases, and the X-axis is a fixed 500 point axis with each tick of the axis equal to an executed Serial.println command.
In other words the plot is updated along the X-axis every time the Serial.println is updated with a new value.Remember to set the Baud Rate of the Serial Plotter so that it matches that of the code.Multiple PlotsWhen displaying multiple waveforms, every separate variable/value/parameter is displayed using a different colour like shown below.Inorder to plot multiple variables or waveforms simultaneously a 'space' is printed between the two print statements. Serial.print(temperature);Serial.print(' ');Serial.println(humidity);OR Serial.print(temperature);Serial.print('t');Serial.println(humidity);In this case the values of the variables 'temperature & humidity will have separate waveforms plotted on the same graph simultaneously. I used the Arduino Serial Monitor in my Automatic Plant Watering System to visualize & plot Moisture Sensor Data.The main purpose of having the Serial plotter is that you do not need to be connected to the Internet in-order to visualize the data from a sensor or your project. And hence for the purpose of Data Visualization the Serial plotter excels at its job.Whether its a singular wave or a multiple plot graph the Serial Plotter auto-resizes itself and color codes each wave.
Using Microsoft’s Internet Explorer along with ActiveX technology, we could provide free diagnostic and maintenance tools that didn’t need to be installed. PC Pitstop - PC Performance RootsPC Pitstop began in 1999 with an emphasis on computer diagnostics and maintenance. As times changed and PC Pitstop grew, we transitioned to a software subscription model to not only provide better and more secure diagnostic and maintenance tests, but turn our focus towards computer security with PC Matic. During the early days of the dot com boom, our online PC maintenance tools were skyrocketing.
In-order to test the Data Visualization function you can follow the following steps:. Connect a couple of sensors to your Arduino.
Print the values of the sensors & Upload the code. Open the Serial Plotter.I have used the Serial Plotter in my to visualize the reading of the various sensors on the Weather Station. The above waveforms show the plot of the Temperature(26°C) & Humidity(65%RH) readings of the SL-HS-220 sensor. One of the best uses of the Serial Plotter is to troubleshoot the code & circuit. Faulty connections or incorrect coding logic can sometimes return an undesired output. In such cases where there too many lines of code or too many wires to debug the Serial Plotter can show the exact point of error.With the help of the Serial Plotter you can check if a sensors reading is incorrect or even if the sensor is not connected properly to the Arduino.
The Serial Plotter will also help debugging code by displaying the values various conditional statements and variables or even the states of the pins of the Arduino.A good example of would be troubleshooting a Obstacle Avoidance Robot. In this example the Blue waveform represents the Ultrasonic sensor and the Yellow and Red waveforms represent the left and right motors. As the distance between the obstacle & the robot decreases, the Blue waveform decreases. At a threshold value(minimum distance) of 10, the robot turns right hence the two motors have different value's;Right=50,Left=100. You can see the Red waveform decreasing and the Yellow waveform remaining constant speed which represents the right turn.Troubleshooting whether a wire was not connected properly or a component was malfunctioning or your coding logic was incorrect would have cost you a lot of time. But with the help of the Serial Plotter the amount of time it takes to troubleshoot the problem can be significantly reduced by analyzing the waveforms. With a basic programming sense and a couple of lines of code, the Arduino is able to act as a Function Generator.
The Arduino is capable of producing Square,Triangular, Sine & Sawtooth waveforms. In previous versions of the Arduino IDE one could only observe the values of the type of waveform being produced in the Serial Monitor without any visualization. It would be time consuming to analyze the output solely on the basis of numerical value's; and this is the place where the Serial Plotter comes handy; in visualizing the waveforms being produced. Does anyone know where in the IDE does one adjust the Baud rate (I know how to set the baud rate in the code but I am referring to the serial plotter)?? It shows a picture on one of the steps where it says your code and the serial plotter must be set at equal baud rates (and it shows a pic of the baud rate of 9600 and a scroll down) but it doesn't show how to actually adjust the baud rate on the serial plotter.
I ASK this question because on several projects now I have been able to build and test many of these projects but could never get results plotted on the plotter. Thanks for this. Nice clear explanation of a great tool. I have just one question. You say 'The main purpose of having the Serial plotter is that you do not need to be connected to the Internet in-order to visualize the data from a sensor or your project.' It would never occur to me to connect to the internet for data visualization. For visualization I think Excel, Processing, writing my own plot code in Python, whatever.
IDE plotting is mostly a better choice than those but none of them need the Internet. What Internet data visualization tool am I missing that is so popular that you just assume it? Assume a person(someone like me) who is not familiar with Processing or Interfacing an Arduino with Excel or has no experience with languages such as Python needs to visualize the data from his/her Arduino. The Serial Plotter is a useful tool too such a person. Since I had no knowledge regarding Processing,Python,etc I took too online(Internet based) open source data visualization platforms(Plotly, Sparkfun Data,etc) too visualize my data. These platforms are very easy to use if you have a wifi shield as you only need to copy & paste a few lines of code available in their documentation & user guides. Now considering the fact that this tutorial is made for newbies who do not possess a wifi shield and have basic coding skills; this Instructable is made to cater to their data visualization needs.