loading

Arduino doesn't have much in terms of debug and analysis capability built in, so it can be very useful to have a facility to plot data that's sent from Arduino over the Serial Port.

There are several ways to do that including Processing, Python + Matplotlib etc.. but none of these methods work effectively with very little setup and offer expected features such as Zoom, Scroll, Write to File, Save Setup etc.

I want to show you how to produce the kinds of plots illustrated in my Frequency Detection Instructable.

The Software I used to produce those plots is Bridge Control Panel.

It's released as a part of Cypress Semiconductor's PSOC Programming Utilities.

==============
By the way. If you like this Instructable, you might also like to read My Blog covering various projects and Tutorials.

==============

Step 1: Bridge Control Panel

Download and Install the Bridge Control Panel.

You need to write the Arduino Data over the Serial Port one byte at a time. For an int data type that would look as follows:

    // RX8 [h=43] @1Key1 @0Key1
    Serial.print("C");
    Serial.write(data>>8);
    Serial.write(data&0xff);

We Signal that we're sending a data byte then send each byte of the int.

The Syntax for the Bridge Command is shown in the comment and in the Picture of the Bridge Window.

Notice we have successfully connected to Arduino on COM6.

The command to Read Data is:  RX8 [h=43] @1Key1 @0Key1

RX8 is the read command
[h=43] means the next valid byte is "C" in ASCII
then the High Byte of Key1
then the Low Byte of Key1

[Chart -> Variable Settings]   panel is illustrated in the Picture.

In here you need to tell Bridge Key1 is Type:int , signed. The TICK means this is in use.

If you have made any mistakes here the command in the Editor Window will show the Errors in BLUE.

Finally you need to setup the comm's protocol in   [Tools -> Protocol Configuration F7]

Make sure the Baud Rate matches the one specified in Arduino.

To Capture Data press REPEAT in the Window.
<p>I made an equivalent tool in python that print real time data from ADXL345 accelerometer.</p><p><a href="https://github.com/mba7/SerialPort-RealTime-Data-Plotter" rel="nofollow">https://github.com/mba7/SerialPort-RealTime-Data-P...</a></p><p>may be it will be helpful for someone</p>
<p>Thank You!</p><p>You're a saviour</p>
<p>For multiple values just add bytes. If you want to send two 16 bit words for example:</p><p>RX8 [h=43] @1Key1 @0Key1 @1Key2 @0Key2</p><p>Remember to select Key 2 as Active in {Chart -&gt; Variable Settings} and set that data as having the appropriate formatting.</p><p>In Arduino:</p><p> Serial.print(&quot;C&quot;);</p><p> Serial.write(data1&gt;&gt;8); </p><p>Serial.write(data1&amp;0xff);</p><p> Serial.write(data2&gt;&gt;8); </p><p>Serial.write(data2&amp;0xff);</p>
<p>This software is no longer available. Can you upload it again?</p>
<p>I just checked that the software is still available under that link.</p>
<p>sir how to connect arduino to the bridge control?</p>
<p>Hello<br>Im using following Adafruit sketch to read and plot the data from themocouple<br>based on MAX 31855 device using Bridge Control Panel </p><p>I<br>did receive plot ,set X axis as a time ,and Y axis as temperature readings. but<br>instead of temperature readings I getting triangle waveform with amplitude vary from 30 to 7710 (see attached images) , values<br>represented in Bridge Control panel TABLE capture looks okay to me. It is<br>possible to adjust Y axis temperature readings scale to get scaled temperature<br>readings ? Or there is something wrong in my data readings ?</p><p>Source h and cpp files : https://github.com/adafruit/Adafruit_MAX31856</p><p>Thank You </p><p>#include &lt;SPI.h&gt;<br><br>#include &quot;Adafruit_MAX31855.h&quot;<br><br><br><br><br><br>int maxSO = 5;<br><br>int maxCS = 6;<br><br>int maxSCK = 7;<br><br>int abc;<br><br>//Create a MAX31855 reference and tell it what pin does what<br><br>Adafruit_MAX31855 kTC(maxSCK, maxCS, maxSO);<br><br><br><br>void setup() {<br><br>Serial.begin(9600);<br><br>// The MAX31855 needs a little time to stabilize<br><br>delay(500);<br><br>}<br><br>void loop() { <br><br>Serial.print(&quot;C = &quot;); <br><br>Serial.println(kTC.readCelsius()); <br><br>abc= int(kTC.readCelsius()); <br><br><br><br>delay(1000);<br><br>Serial.print(&quot;C&quot;);<br><br>Serial.write(abc&gt;&gt;8);<br><br>Serial.write(abc&amp;0xff);<br><br>}</p>
<p>If you are looking for a general purpose solution, you can also check out my project on Github <a href="https://github.com/Overdrivr/Telemetry" rel="nofollow">https://github.com/Overdrivr/Telemetry</a><br><br></p><p>I was tired of reinventing the wheel for serial so I figured out why not make something clean once and for all, well tested, etc.</p><p>The arduino library is highlevel, allows to write any kind of data (string, numbers, arrays) and is super easy to use. For PC side, I wrote a command-line interface (a terminal where you type commands), where, once connected, you can open as many plot as you want just using a command, selecting the received data by their label (each data you send is attached to a label). You can also write variables from the terminal, display a list of received data, log everything, etc.</p><p>This is just scratching the surface, there are many goodies in this library and the list is growing every day :) </p>
<p>I also am having trouble getting 'Bridge Control Panel' to show output. I want to use it to draw graphs. I have read the complete Help documentation that comes with it.</p><p>I have a (cypress psoc based) device connected to Windows COM5, and I know it is streaming my data, with a header of 'C' followed by binary bytes, which I can verify in TeraTerm of other serial emulator. I have set the serial parameters are the same as yours, RX8, 115200,8N1. </p><p>Bridge reports 'Syntax: OK' and 'Connected', I have the variables Chart Variables as your example. But nothing shows when I hit 'Repeat' or first highlight the command and hit 'Repeat'</p><p>1) to get a real basic hex dump of the serial port in Bridge Control, shouldn't I be able to use a command like: 'RX8 @0Key1' and set the chart variable 'Key1' to Byte. Could you possible post a step by step procedure for a simple hex dump with Bridge Control Panel?</p><p>2) Can you explain why only the 'Repeat' and 'ToFile' are enabled, but not 'Send' ?</p><p>3) Does the software on the device have to wait to receive a command from Bridge? Or can it just be streaming out the data? </p><p>4) Is it possible in RX8 mode to send a command to the device to initiate the stream?</p><p>5) Your example does not show any incoming data in the 'Results' window. In my attempts I saw some lines of hex values there 3 times, but cannot consistently get any.</p>
<p>I'm using this sketch to read Thermistor data (http://playground.arduino.cc/ComponentLib/Thermist... but I've problems plotting the data with Bridge Control. </p><p>I modified a bit the code adding an int Temp_copy and the last two Serial.write lines at the end of the sketch but I don't see nothing in Bridge control. </p><p>Please help.</p><p>Thanks</p><p>#include &lt;math.h&gt;</p><p>int Temp_copy;</p><p>double Thermistor(int RawADC) {</p><p>double Temp;</p><p> Temp = log(10000.0*((1024.0/RawADC-1))); </p><p>// =log(10000.0/(1024.0/RawADC-1)) // for pull-up configuration</p><p> Temp = 1 / (0.001129148 + (0.000234125 + (0.0000000876741 * Temp * Temp ))* Temp );</p><p> Temp = Temp - 273.15; // Convert Kelvin to Celcius</p><p> Temp = (Temp * 9.0)/ 5.0 + 32.0; // Convert Celcius to Fahrenheit</p><p> return Temp;</p><p>}</p><p>void setup() {</p><p> Serial.begin(115200);</p><p>}</p><p>void loop() {</p><p> //Serial.println(int(Thermistor(analogRead(0)))); // display Fahrenheit</p><p> Temp_copy = int(Thermistor(analogRead(0)));</p><p> Serial.println(Temp_copy);</p><p> delay(100);</p><p> Serial.write(Temp_copy&gt;&gt;8);</p><p> Serial.write(Temp_copy&amp;0xff);</p><p>}</p>
<p>I don't think Serial.println(Temp_copy); is the correct thing to do. This will get sent to the Bridge control panel and won't mean anything to it. I think it should be :</p><p>Serial.print(&quot;C&quot;);</p><p> Serial.write(Temp_copy&gt;&gt;8);</p><p> Serial.write(Temp_copy&amp;0xff);</p><p>The C character is improtant because that's what Bridge is lloking for to tell it that a number is coming next.</p>
<p>Hey<br>Great instructable, very helpfull.<br>Would you be able to tell me how to send a float data type to Bridge Control Panel? I tryed but no luck :(.</p>
<p>I've tried to send float data type to BCP as well with no luck. Have you managed to figure it out? Cheers.</p>
<p>Send as an INT by multiplying by your required precision e.g. int( float_val*1000) </p>

About This Instructable

52,924views

63favorites

License:

Bio: Technologist, Electronic Engineer, sometime Coderdojo mentor.
More by akellyirl:Arduino Guitar Tuner Using DSP Techniques Add Amazon Echo Voice Control to You Smart Device Smart Home Thermostat 
Add instructable to: