{"id":27830,"date":"2020-04-05T09:44:24","date_gmt":"2020-04-05T16:44:24","guid":{"rendered":"https:\/\/blog.digilentinc.com\/?p=27830"},"modified":"2021-06-09T12:50:43","modified_gmt":"2021-06-09T19:50:43","slug":"analyze-measurement-data-on-cloud-using-raspberry-pi-4-and-analog-discovery-2","status":"publish","type":"post","link":"https:\/\/digilent.com\/blog\/analyze-measurement-data-on-cloud-using-raspberry-pi-4-and-analog-discovery-2\/","title":{"rendered":"Analyze Measurement Data on Cloud Using Raspberry Pi 4 and Analog Discovery 2"},"content":{"rendered":"<p class=\"type-intro\">For any of your larger sized files, you can be certain that most providers will keep files in the cloud to save storage space. That way, you&#8217;ll have access to everything no matter where you&#8217;re trying to get to it from.<\/p>\n<p>The &#8220;Internet of Things&#8221; (IoT) is a new trend where a large number of embedded devices are connected to the Internet via the cloud. These\u00a0 devices communicate sometimes with people and sometimes with other devices, often to provide sensor data and other measurement information to cloud storage and cloud computing resources. On the cloud, the data is processed and analyzed to gain important insights.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.rs-online.com\/designspark\/rel-assets\/dsauto\/temp\/uploaded\/waveforms_demo_run.png?w=815\" \/><\/p>\n<p>Using the cloud and cloud-based computer is relatively cheap, so it&#8217;s no wonder that it is becoming a popular resource in embedded design. As IoT evolves, embedded systems are staking their own claim on the cloud. Whether it be home-brewed projects to or more intricate designs or measurements, cloud computing is becoming more prevalent.\u00a0 Have you ever wanted to get in on the action? With the Digilent <a href=\"https:\/\/digilent.com\/shop\/analog-discovery-2-100msps-usb-oscilloscope-logic-analyzer-and-variable-power-supply\/\">Analog Discovery 2<\/a>, <a href=\"https:\/\/digilent.com\/shop\/waveforms-download-only\/\">WaveForms<\/a> software, and <a href=\"https:\/\/www.raspberrypi.org\/products\/raspberry-pi-4-model-b\/\">Raspberry Pi 4<\/a>, you can send measured data and signals directly to the <a href=\"http:\/\/www.thingspeak.com\">ThingSpeak.com<\/a> cloud and eventually analyze them.<\/p>\n<p><strong>Analog Discovery 2<\/strong> is portable analog measurement tool, 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<\/p>\n<p><strong>WaveForms<\/strong>\u00a0is 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&#8217;s free to download and compatible with Mac (Apple), Windows, and Linux (32-bit, 64-bit, and ARM).<\/p>\n<h3>How to Install WaveForms<\/h3>\n<p><strong>Step 1: Download WaveForms<\/strong><br \/>\nThis tutorial will guide you through the steps involved in the installation process on a Raspberry Pi 4 Model B after <a href=\"https:\/\/digilent.com\/shop\/waveforms-download-only\/\">downloading it\u00a0from the website<\/a>. 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.<\/p>\n<p><a href=\"https:\/\/digilent.com\/reference\/learn\/instrumentation\/tutorials\/waveforms-2015-getting-started\/start\">Download the correct installation file for WaveForms<\/a> 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 <a href=\"http:\/\/www.arm.com\">ARM<\/a> build.<\/p>\n<p><strong>Step 2: Download Adept 2<\/strong><br \/>\nDownload the correct version of\u00a0<a class=\"urlextern\" title=\"https:\/\/digilent.com\/reference\/software\/adept\/start\" href=\"https:\/\/digilent.com\/reference\/software\/adept\/start\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Adept 2<\/a>. 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.<\/p>\n<p><strong>Step 3: Install both Adept 2 and Waveforms<\/strong><\/p>\n<p><strong>NOTE: <\/strong>If you don&#8217;t have an Analog Discovery 2 plugged in, a window will pop up with a warning stating that no device was detected. You don&#8217;t need to have a device to run the software, so go ahead and click \u201cOK\u201d to proceed.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.rs-online.com\/designspark\/rel-assets\/dsauto\/temp\/uploaded\/waveforms_nodevice1.png?w=815\" \/><\/p>\n<p><strong>Step 9: Run Demo Mode in WaveForms<\/strong><br \/>\nThe device manager will now open. Click on \u201cDemo Mode\u201d, and then click \u201cSelect\u201d.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.rs-online.com\/designspark\/rel-assets\/dsauto\/temp\/uploaded\/waveforms_choosedemo.png?w=815\" \/><\/p>\n<p><strong>Step 10: Demo Mode Oscilloscope<\/strong><br \/>\nAs mentioned previously, if you don&#8217;t have an Analog Discovery 2 yet, that&#8217;s okay. You can still run WaveForms in demo mode and get a feel for the interface and capabilities.<\/p>\n<p>The below image is a demo of the oscilloscope displaying a sine and square wave.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.rs-online.com\/designspark\/rel-assets\/dsauto\/temp\/uploaded\/waveforms_demo_run1.png?w=815\" \/><\/p>\n<p><strong>Step 11: Plug in Analog Discovery 2<\/strong><br \/>\nIf you plug in the Analog Discovery 2, a window will pop up indicating that it was detected. Select \u201cOK\u201d to proceed.<\/p>\n<p><strong>Step 12: Device Manager<\/strong><br \/>\nIf 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.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.rs-online.com\/designspark\/rel-assets\/dsauto\/temp\/uploaded\/waveforms_select_devce.png?w=815\" \/><\/p>\n<p>Now that you are connected and have WaveForms installed, you can view the tutorials for each Instrument on the\u00a0<a class=\"wikilink1\" title=\"reference:software:waveforms:waveforms-3:start\" href=\"https:\/\/digilent.com\/reference\/software\/waveforms\/waveforms-3\/start#tutorials\" target=\"_blank\" rel=\"noopener noreferrer\">WaveForms Resource Center<\/a>.<\/p>\n<h3>Sending Data from WaveForms SDK to ThingSpeak.com<\/h3>\n<p><a href=\"http:\/\/www.thingspeak.com\">ThingSpeak<\/a>, created by <a href=\"http:\/\/www.mathworks.com\">MathWorks<\/a>, 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 <a href=\"https:\/\/digilent.com\/shop\">Digilent<\/a> Test and Measurement Device up to ThingSpeak.<\/p>\n<h4 id=\"section1\"><a id=\"section1_anchor\" class=\"anchor\" href=\"https:\/\/digilent.com\/reference\/learn\/instrumentation\/tutorials\/waveforms-sdk-thingspeak%0a#section1\" aria-hidden=\"true\"><\/a><strong>Step 1.<\/strong><\/h4>\n<div class=\"level4\">\n<p>Go to\u00a0<a class=\"urlextern\" title=\"http:\/\/thingspeak.com\" href=\"http:\/\/thingspeak.com\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">thingspeak.com<\/a>\u00a0and sign in or sign up.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.rs-online.com\/designspark\/rel-assets\/dsauto\/temp\/uploaded\/thingspeak-1.png?w=815\" \/><br \/>\n<strong>Step 2.<\/strong><\/p>\n<\/div>\n<div class=\"level4\">\n<p>In the\u00a0<em>Channels<\/em>\u00a0menu select\u00a0<em>My Channels<\/em>\u00a0and create a\u00a0<strong>New Channel<\/strong>.<\/p>\n<\/div>\n<h4 id=\"section2\"><strong>Step\u00a03.<\/strong><\/h4>\n<div class=\"level4\">\n<p><span class=\"group \"><span class=\"wrap_column wrap_half \">Configure the channel settings, name, and fields:<\/span><\/span><\/p>\n<p><span class=\"group \"><span class=\"wrap_column wrap_half \"><img decoding=\"async\" src=\"https:\/\/www.rs-online.com\/designspark\/rel-assets\/dsauto\/temp\/uploaded\/thingspeak-3.png?w=815\" \/><\/span><\/span><\/p>\n<\/div>\n<h4 id=\"section4\"><a id=\"section4_anchor\" class=\"anchor\" href=\"https:\/\/digilent.com\/reference\/learn\/instrumentation\/tutorials\/waveforms-sdk-thingspeak%0a#section4\" aria-hidden=\"true\"><\/a><strong>Step 4.<\/strong><\/h4>\n<div class=\"level4\">\n<p><span class=\"group \"><span class=\"wrap_column wrap_half \">Under\u00a0<em>API Keys<\/em>, note the\u00a0<strong>Write API\u00a0Key<\/strong>\u00a0that will be needed to push data to the server from the custom application or script:<\/span><\/span><\/p>\n<p><span class=\"group \"><span class=\"wrap_column wrap_half \"><img decoding=\"async\" src=\"https:\/\/www.rs-online.com\/designspark\/rel-assets\/dsauto\/temp\/uploaded\/thingspeak-4.png?w=815\" \/><\/span><\/span><strong>Step 5.<\/strong><\/p>\n<\/div>\n<div class=\"level4\">\n<p>Download the\u00a0<a class=\"media mediafile mf_zip\" title=\"learn:instrumentation:tutorials:analogimpedance_thinkspeak.zip (1.2\u00a0KB)\" href=\"https:\/\/digilent.com\/reference\/_media\/learn\/instrumentation\/tutorials\/analogimpedance_thinkspeak.zip\" target=\"_blank\" rel=\"noopener noreferrer\">AnalogImpedance.py<\/a>\u00a0script, then edit it and replace the \u201c8C####BU\u201d with the Write API\u00a0Key, as seen below:<\/p>\n<pre class=\"code\">url = \"https:\/\/api.thingspeak.com\/update?api_key=8C############BU\"<\/pre>\n<p>Run the script on Windows, macOS, Linux desktop, or on an embedded device like Raspberry Pi:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.rs-online.com\/designspark\/rel-assets\/dsauto\/temp\/uploaded\/thingspeak-6.png?w=815\" \/><br \/>\n<strong>Step 6.<\/strong><\/p>\n<\/div>\n<div class=\"level4\">\n<p><span class=\"group \"><span class=\"wrap_column wrap_half \">Once the data has been sent to ThingSpeak, the default charts can be seen in the\u00a0<em>Private View<\/em>\u00a0and\u00a0<em>Public View<\/em>\u00a0tabs:<\/span><\/span><\/p>\n<p><span class=\"group \"><span class=\"wrap_column wrap_half \"><img decoding=\"async\" src=\"https:\/\/www.rs-online.com\/designspark\/rel-assets\/dsauto\/temp\/uploaded\/thingspeak-5.png?w=815\" \/><\/span><\/span><\/p>\n<h3 id=\"next_steps\" class=\"sectionedit5\"><strong>Next Steps<\/strong><\/h3>\n<div class=\"level2\">\n<p>Now that data can be transferred between the test and measurement device and ThingSpeak, the script can be modified as needed for your project.<\/p>\n<p>For more information on WaveForms SDK, see its\u00a0<a class=\"wikilink1\" title=\"reference:software:waveforms:waveforms-sdk:start\" href=\"https:\/\/digilent.com\/reference\/software\/waveforms\/waveforms-sdk\/start\" target=\"_blank\" rel=\"noopener noreferrer\">Resource Center<\/a>.<\/p>\n<\/div>\n<\/div>\n<div class='watch-action'><div class='watch-position align-left'><div class='action-like'><a class='lbg-style6 like-27830 jlk' data-task='like' data-post_id='27830' data-nonce='579aded7b7' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Like' \/><span class='lc-27830 lc'>+2<\/span><\/a><\/div><div class='action-unlike'><a class='unlbg-style6 unlike-27830 jlk' data-task='unlike' data-post_id='27830' data-nonce='579aded7b7' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Unlike' \/><span class='unlc-27830 unlc'>0<\/span><\/a><\/div><\/div> <div class='status-27830 status align-left'><\/div><\/div><div class='wti-clear'><\/div>","protected":false},"excerpt":{"rendered":"<p>For any of your larger sized files, you can be certain that most providers will keep files in the cloud to save storage space. That way, you&#8217;ll have access to &hellip; <\/p>\n","protected":false},"author":15,"featured_media":27832,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4312,1563],"tags":[1736,452],"ppma_author":[4473],"class_list":["post-27830","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-usb-scopes-analyzers-generators","category-guide","tag-analog-discovery-2","tag-waveforms"],"jetpack_featured_media_url":"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2020\/04\/waveforms_demo_run1.png","jetpack_sharing_enabled":true,"authors":[{"term_id":4473,"user_id":15,"is_guest":0,"slug":"alexwong","display_name":"Alex Wong","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/e08e1ee5a8834a7869b373c559c42709f2f0474f0482e704867ed4e45564dcd2?s=96&d=mm&r=g","1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":"","9":"","10":""}],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/27830","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/comments?post=27830"}],"version-history":[{"count":0,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/27830\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media\/27832"}],"wp:attachment":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media?parent=27830"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/categories?post=27830"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/tags?post=27830"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=27830"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}