汉斯在物联网上

ThingSpeak, MATLAB, and the Internet of Things

Live Seismic Traffic Monitoring with ThingSpeak, MATLAB, and Raspberry Shake

我们已经建立了一种新方法来监视流量,并在此过程中使用MATLAB进行了一些意外的发现。您可能熟悉Thingspeaktraffic monitor channelthat uses a image processing from a webcam to count cars on a busy highway. My friends and collaborators艾伦·卡夫卡(Alan Kafka)在韦斯顿天文台,波士顿学院和杰拉i at Raytheon let me know that we might be able to verify the traffic data with seismic analysis. So, we bought aRaspberryHake®地震仪and set it up on the ground floor three floors below the traffic monitor. Here’s a picture of the device at its home in the MathWorks Headquarters and a snapshot of the filtered seismic data compared to the traffic data.

The “Shake” already makes the data available in the cloud. But with ThingSpeak, I can to set up an automated process that filters the raw data and plots it with the traffic data. Now I can查看比较数据whenever I need to and verify predictions with live data. For example, I can see there is a correlation of an increase in the traffic intensity during rush hour. Recently, during a big snowfall, I was able to verify seismic data (from the snowplows) correlated to lower traffic numbers (from travelers staying off the road.)

Here’s the process for getting this going, with a few code hints (not the full script though).

  1. Use theFSDN RESTful webservices API要读取MATLAB中的数据,然后将其过滤至1秒钟或更少的分辨率,以便您可以将其写入ThingsPeak通道。
urlquery = ...'https://data.raspberryshake.org/fdsnws/dataselect/1/query?starttime = 2022-02-28T00:30:00&endtime = 2022-02-28T01:00:00:00:00:00data = webread(urlquery);

2.如果您使用过MATLABAnalysis在Things peak中,您可以设置一个时间控制定期获取数据;我选择了5分钟,因此数据快到了。

3.使用MATLAB可视化要读取流量监视器数据和过滤的摇动数据,并在同一时间范围内绘制。

myData = thingSpeakRead(channelID,'dateRange',[startTime,endTime],'outputformat','timetable');

The seismic data does generally mimic the traffic data but there is not 100% correlation. One reason may be that trucks driving by at night may make large seismic events but show up as only one count in the webcam data. Another issue is that the distance from the road to the seismic detector is at least 100 m, over which many of the ground vibrations may dampen or scatter. Last the building vibrations are still present somewhat in the comparison data.

该建筑物发出了很多噪音,因此为带通滤波器选择正确的频率对于获取良好的比较数据很重要。由于该处理是在MATLAB中完成的,因此很容易生成FFT spectrum并将夜间数据(当汽车较少)与白天数据进行比较,也许在高峰时段,当时流量最高。这是一个比较频谱在高峰时段开始和半夜。

差异线(以黄色为单位)没有特定的值,因为两个FFT未归一化,但它提供了在哪里寻找差异的提示。选择正确的频率可以消除地震数据中与交通数据不匹配的功能。请注意下面图中缺少的建筑噪声特征。

实用IoT数据的真正好处是,您可以随时随地查看绘图。例如,当道路封闭或当地采石场正在爆破岩石时,您可以在寻找特定功能或见解时看到实时数据的响应。

|
  • print
  • send email

コメント

コメントを残すには、ここをクリックして MathWorks アカウントにサインインするか新しい MathWorks アカウントを作成します。