Skip to main content

Analyze the Measurement Data on Cloud using Raspberry Pi 4 and Analog Discovery 2

Nowadays, most service providers offer cloud storage. From images to videos, music or movies, they keep files in the cloud to save storage space. Users can get access to the data anywhere and easily share these files with others.

With the evolution of IoT, embedded systems have also started to grow in the cloud area. From development projects to complicated measurements, the industry is moving towards cloud technologies.

waveforms_demo_run_941962345220674cb4a50364229a7921758d79f8.png

Internet of Things (IoT) describes an emerging trend where a large number of embedded devices (things) are connected to the Internet. These connected devices communicate with people and other things and often provide sensor data to cloud storage and cloud computing resources where the data is processed and analyzed to gain important insights. Cheap cloud computing power and increased device connectivity are enabling this trend.

With the Digilent Analog Discovery 2, Waveforms and Raspberry PI 4, you can send measured data and signals directly to the ThingSpeak.com cloud and eventually analyze them.

Analog Discovery 2 is a USB oscilloscope and multi-function instrument that allows users to measure, visualize, generate, record, and control mixed-signal circuits of all kinds. Analog Discovery 2 is small enough to fit in your pocket but powerful enough to replace a stack of lab equipment. Driven by the free WaveForms software, Analog Discovery 2 can be configured to work as any one of several traditional instruments including an Oscilloscope, Waveform Generator, Power Supply, Voltmeter, Data Logger, Logic Analyzer, Pattern Generator, Static I/O, Spectrum Analyzer, Network Analyzer, Impedance Analyzer, and Protocol Analyzer

WaveForms is a software developed by Digilent and intended for use with the Analog Discovery 2 and the Analog Discovery Studio. WaveForms provides a user interface for a 2-channel oscilloscope, logic analyzer, arbitrary waveform generator, digital I/O, and more. It's free to download and compatible with Mac (Apple), Windows, and Linux (32-bit, 64-bit, and ARM).

Installing WaveForms

Step 1: Download WaveForms
This tutorial will guide you through the steps involved in the installation process on a Raspberry Pi 4 Model B after downloading it from the website. We will be using the Raspberry Pi 4 Model B 1GB version within this tutorial. The 2GB and the 4GB versions of the Raspberry Pi 4 Model B also work with this tutorial.

Download the correct installation file for WaveForms for your distribution of Linux. Since we are using a Raspberry Pi 4 Model B with the Raspbian OS, we will choose the Debian flavor of the ARM build.

arm_debian_option1_ba177a702e76dd21502bc5e3a8d4c4bf825fd194.png

Step 2: Download Adept 2
Download the correct version of Adept 2. Make sure that the version of the Adept install file is the same as WaveForms. We chose the ARM version for WaveForms, so we will use the ARM version of both the Runtime and Utilities for Adept.

adept2_rpi_runtimedownload1_c1cea28e394fddd35be47b0981b6b5db16c7d988.png

Step 3: Open the Adept 2 File
Open up the file you downloaded for Adept 2 in Step 2.

doubleclick_adeptruntimedownload_a7a2368f25257fc0044d0df1012928859067145f.png

Step 4: Click Install
Click “Install” in the window when prompted.

installadeptruntime_c5e980603ce4247fe2f9e15e49710a1b7d5825c8.png

Step 5: Open the WaveForms File
Open the file you downloaded to install WaveForms.

doubleclick_adeptruntimedownload1_a7a2368f25257fc0044d0df1012928859067145f.png

Step 6: Click Install
Click “Install” in the window when prompted.

Step 7: Open WaveForms
Go to your applications and open WaveForms.

Step 8: No Device
If you don't have an Analog Discovery 2 plugged in, a window will pop up with a warning stating that no device was detected. You don't need to have a device to run the software, so go ahead and click “OK” to proceed.

waveforms_nodevice1_2bb730034b9e0d2e5251271c4fbce149cd133f4c.png

Step 9: Run Demo Mode
The device manager will now open. Click on “Demo Mode”, and then click “Select”.

waveforms_choosedemo_47605c2623831e14390a69db70a9437f3ab4743e.png

Step 10: Demo Mode Oscilloscope
As mentioned previously, if you don't have an Analog Discovery 2 yet, that's okay. You can still run WaveForms in demo mode and get a feel for the interface and capabilities.

The below image is a demo of the oscilloscope displaying a sine and square wave.

waveforms_demo_run1_941962345220674cb4a50364229a7921758d79f8.png

Step 11: Plug in Analog Discovery 2
If you plug in the Analog Discovery 2, a window will pop up indicating that it was detected. Select “OK” to proceed.

Step 12: Device Manager
If you open the device manager, or you have the Analog Discovery 2 plugged in when WaveForms is open, the window displayed in the image below will appear. Select the Analog Discovery 2 just as you did for demo mode.

waveforms_select_devce_91e7964dd60071c65eabf201fad0ab06d33c2ebe.png

Now that you are connected and have WaveForms installed, you can view the tutorials for each Instrument on the WaveForms Resource Center.

Sending Data from WaveForms SDK to ThingSpeak.com

ThingSpeak, created by MathWorks, is an online platform for collecting, viewing, and analyzing data in the cloud. This guide runs through the steps required to send data captured by your WaveForms SDK compatible Digilent Test and Measurement Device up to ThingSpeak.

Step 1.

Go to thingspeak.com and sign in or sign up.

thingspeak-1_a286d2ab7968d917d47859078a3b2142e6b54121.png
Step 2.

In the Channels menu select My Channels and create a New Channel.

Step 3.

Configure the channel settings, name, and fields:

thingspeak-3_20e2bb81d7196d6524320eb585551e1bcb3e23f4.png

Step 4.

Under API Keys, note the Write API Key that will be needed to push data to the server from the custom application or script:

thingspeak-4_dd301c27851c183c7b97ea421c54d323b0266eb2.pngStep 5.

Download the AnalogImpedance.py script, then edit it and replace the “8C####BU” with the Write API Key, as seen below:

url = "https://api.thingspeak.com/update?api_key=8C############BU"

Run the script on Windows, macOS, Linux desktop, or on an embedded device like Raspberry Pi:

thingspeak-6_b7d2da5c7915f741ea1001a62696152095516466.png
Step 6.

Once the data has been sent to ThingSpeak, the default charts can be seen in the Private View and Public View tabs:

thingspeak-5_5e18a92513d6b4167151442751f64246bca5f7d1.png

Next Steps

Now that data can be transferred between the test and measurement device and ThingSpeak, the script can be modified as needed for your project.

For more information on WaveForms SDK, see its Resource Center.

awong has not written a bio yet…
DesignSpark Electrical Logolinkedin