.
Story.
In this project, I created a dashboard using IoTConnect platform to track elephant activities. Based on a Edge Impulse Studio tutorial, an activity classification model was built. The dashboard shows a time series of activities' classification of one of the elephants. Elephants with high activities will be alerted with red color indication.
.
Setup IoTConnect.
I followed the instructions detailed at Hackster's ElephantEdge contest page. I created 2 templates and 3 devices. The 2 templates are Weather and Activity. One weather device called W1 which is used to receive temperature and humidity sensor data. While the other 2 devices are E1 and E2 which are used to track elephants' activity level and location information.
.
With IotConnect SDK, I created two apps to ingest data to IoTConnect Platform. One app is a Node.js console app which I modified from the SDK sample program. Another one is a Node-RED app running in the docker container.
.
Setup Edge Impulse.
I created an Edge Impulse account and followed the "continuous motion recognition" tutorial to build the activity recognition model. Then I followed the "through WebAssembly (Node.js)" tutorial to build the library so that I can use it in the Node.js environment.
.
New IoTConnect Dashboard.
With new IoTConnect dashboard functionality, I made a new dashboard to track the elephants' activities and devices' location. The new dashboard shows 3 devices for tracking elephants' activities and 1 device for weather tracking. Since my trial IoTConnect plan allows only 3 active devices, I used 2 devices for activity tracking and 1 device for weather monitoring. The dashboard too shows the elephant activity chart, the devices' location and notification table.
.
.
The Demo.
The top portion of the dashboard shows the 4 labels: Elephant 1 Activity, Elephant 2 Actviity, Elephant 3 Activity and Temperature. There is an activity chart Elephant 1 below showing the detected activities of Elephant 1. On the right panel are the device location map and notification panel. The activity labels show 4 types of activities. They are (1) minimal activities (resting), (2) low activities (feeding, bathing), (3) medium activities (walking), and (4) high activities (rapid walking). If the activities are of type high activity, the color of the label text will turn red.
The code section below explains how the data (simulated) come about.
.
Code.
There are 3 important NodeJs codes:
(1) The send_data_w1.js
which send weather data of device W1 to IoTConnect. The data are in the form of:
{
uniqueId: 'W1',
time: 2020-10-18T10:25:06.931Z,
data: { temperature: '24.33', humidity: '24.52' }
}.
These values are generated randomly. The temperature values will be displayed on the dashboard.
(2) The send_data_e2.js
that send device E2's activities level to IoTConnect. The data are in the form of activity level:
{
uniqueId: 'E2',
time: 2020-10-18T10:29:06.011Z,
data: { latitude: 8, longitude: 38, level: '3' }
}
These activity level values are generated randomly too. The values range from 1 to 4.
(3) The send_data_e1_files.js
which send device E1's activities level to IoTConnect. The data have the form as (2) above:
{
uniqueId: 'E1',
time: 2020-10-18T10:40:54.590Z,
data: { latitude: 10, longitude: 10, level: 3 }
}
But the level values are classification values computed from the activity classification model built from the "continuous motion recognition" tutorial. The activities data are raw features recorded from accelerometer in the said tutorial. These values were read from files and fed into the classification model during the demo.
.
Summary.
Obviously, this project uses simulation data in the demo. The next step will be using real life data to build the model and use that to classify the behavior of elephants.
.
Comments