Using Linux and Ethernet to Upload Data to ThingSpeak

Have you recently acquired a bunch of data and are trying to figure out what to do with it? Using theAnalog Discovery Pro 3450‘s (or ADP3250’s, for that matter) unique network connectivity and Linux Mode, you’ll be able to push the data through the interwebs and ontoThingSpeak.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 the ADP3450/ADP3250 up to ThingSpeak and ends with an example, which uses the Pmod MIC3 to capture a sound wave, then, from the measurements, the Analog Discovery Pro calculates the noise level. The noise level measurements are visualized in four different ways on the ThingSpeak channel.

The first thing(s) you’ll need are a working internet connection, an account at ThingSpeak, and an Analog Pro Device. For this, we’ll use the ADP3450.

Configuring a ThingSpeak Channel

In theChannelsmenu selectMy Channelsand create aNew Channel.

Configure the channel settings, name, and fields. The field will be the containers for your data. Configure a field for every data type that you want to store/process.

UnderAPIKeys,请注意WriteAPIKeythat will be needed to push data to the server from the custom application or script. TheReadAPIKeycan be used to access stored data.

将数据上传到thingsPeak频道时,将在不同图上显示逐场。要修改这些默认图,或在频道中添加其他数据可视化方法,您可以使用可视化或小部件预设,可以修改默认图的MATLAB代码,也可以编写自己的代码以可视化数据。

To make your visualizations/data publicly available, go toSharingand select the option you want to set.“iframe”tags can be used to embed graphical elements from ThingSpeak into your webpages.

Hardware Overview

The Pmod MIC3 communicates on a SPI interface which will be connected to the Analog Discovery Pro’s digital I/O lines as follows: SS to DIO line 0,MISOto DIO 1 and SCK to DIO 2. Power to the Pmod is also supplied by the Test and Measurement device used, so theVCCpin of the Pmod should be connected to the VIO pin on Analog Discovery Pro, and the grounds of the two devices should be connected together, as shown in the image to the right.

准备FAT/FAT32 USB驱动器(虽然这是许多USB驱动器的默认格式,但您可能需要格式化它)。将Python脚本(PMODMIC3_TO_THINGSPEAK.PY)复制到USB驱动器的根目录。您也可以使用自己的Python脚本,只需将其复制到USB驱动器的根目录即可。将USB驱动器插入模拟发现Pro的背面。与往常一样,在使用测试和测量设备之前,需要将其连接到主机计算机。为了安全地将其连接起来,应征询其他软件使用该设备的情况,或者由于某些原因无法提供。

Preparing the Script, Running It, and Getting Results

对于使该项目运行的整个失败,请阅读我们持续的资源中心的其余部分:https://reference.digilentinc.com/reference/instrumentation/analog-discovery-pro-3×50/linux-thingspeak-demo

0
Be the 1st to vote.

2 Comments on “Using Linux and Ethernet to Upload Data to ThingSpeak”

发表评论

Your email address will not be published.Required fields are marked*