Gate Keeper - an IoT Based Elephant Detection System

0 16066 Medium


Hey, what's up, Guys! Akarsh here from CETech.


Elephants are known to be very calm and composed animals. They are very intelligent and do not cause any harm unless they feel something dangerous around them. But sometimes these calm animals can also cause nuisance and can damage properties and even people when they are in a bad mood. There are places where humans live very close to the forest and they are prone to the problems like wild animals entering their village etc. This in itself is a big problem and needs a solution by also maintaining a peaceful relationship with the animals. Therefore in today's project, we have made something that can help solve this problem to some extent.


We have made an IoT-based Image detection System called GateKeeper. This device is capable of Image detection and is trained to detect Elephants. After detection, it sends messages and email alerts to the configured device alarming people that the animals are nearby their place and they need to stay alert.

With this, people can reduce their face-off with these animals to the bare minimum and also contributes to their safety. So let's see how it's made and how it works.


The items used in this project are as listed below:-

1) Seeed Studio SenseCAP K1100 - The Sensor Prototype Kit with LoRa® and AI

2) Blues Wireless Notecarrier-A

3) Blues Wireless Notecard (Cellular)

4) Arduino 101

5) Arduino IDE

6) Qubitro

7) Blues Wireless Notehub.io


Get PCBs for Your Projects Manufactured



You must check out PCBWAY for ordering PCBs online for cheap!

You get 10 good-quality PCBs manufactured and shipped to your doorstep for cheap. You will also get a discount on shipping on your first order. Upload your Gerber files onto PCBWAY to get them manufactured with good quality and quick turnaround time. PCBWay now could provide a complete product solution, from design to enclosure production. Check out their online Gerber viewer function. With reward points, you can get free stuff from their gift shop.


About the Gatekeeper



The Gatekeeper as we call it is an IoT-based device loaded with Cellular modules which use Machine Learning for Image Detection, to be specific, for detecting an Elephant and once it detects one, it uses the Cellular module to pass the alert to the cloud and after that, an email and a message alert is generated which are displayed on the devices configured with it.

To achieve this target, we use a SenseCAP K1100 kit that contains Grove AI Vision module and Wio Terminal. WIth the help of the Grove AI Vision module, we train the device to detect an elephant and as the elephant is detected, then the detection data is supplied to the Wio Terminal. We will use Seeedstudio to build and train customer model for image detection. Seeedstudio works with Edge impulse integration which helps in creating a more confident and accurate model.

Now as the data is collected, to visualize that, we need to upload that data to a Cloud Platform and for that we will use a Blues Wireless notecard which is a cellular-based IoT hardware, It also allows integration with multiple cloud platforms. Using this module, we will send the data to Qubitro Cloud Platform and on that platform, we will visualize the data and will configure the platform in such a manner that it shares updates and alerts on our email and our SMS.


Image Detection Setup



The SenseCAP K1100 kit contains the Grove AI Vision module. Grove Vision AI Module Sensor represents a thumb-sized AI camera, the customized sensor which has already installed ML algorithms for people detection, and other customized models. Being easily deployed and displayed within minutes, it works under an ultra-low-power model and provides two ways of signal transmission and multiple onboard modules, all of which make it perfect for getting started with an AI-powered camera. This Grove AI Vision module can be trained to detect a model by using Roboflows ML detection. Here is the guide by Seeedstudio to create and upload a custom model. https://wiki.seeedstudio.com/Grove-Vision-AI-Module/.

You can easily create custom models of your own choice for the detection of any other animal as well in a similar way that I created one for elephants. Seeedstudio works with Edge impulse integration so it will update the system with the Edge Impulse model which will ultimately make a more accurate model.

After that, our Wio terminal will get model detection results. In the next step, we will set up the procedure to send the model classification results to the cloud and make an alert.


Data Transfer Mechanism Setup



Now as the data is collected, we need to transfer it to the cloud for further processing and visualization. For this purpose, we have used a Cellular module named Blues Wireless notecard. The Notecard is a device-to-cloud data pump that reduces the complexity of building connected solutions with a secure, reliable cellular or Wi-Fi connection. It's a 30x35 millimeter System-on-Module (SOM) that can be readily embedded into several projects.



Notecard uses Notehub cloud service to securely send and receive data. Notehub also provides a console for fleet management and secure connectors for routing data to 3rd-party cloud applications.



We connected Blue's notecard to the UART port (8th and 10th pin) of the Wio Terminal. We have added a light system that can turn on at night and turn off during the daytime to sufficient lighting for Vision classification. You have to create a new project on the Blues note hub and program that project Id into the Wio terminal to send data to the cloud. First, get the project ID from the Blues Notehub and paste it into the following code.



Next, compile the code and upload it to the Wio Terminal, now this wio terminal will detect the serial data and forward it to the Blues Notecard. So this will now send model status, model confidence, and count. You can get the complete code for the project on the Github repository of this project that you can access from here. As we mentioned earlier, Blues Notehub is the Cloud Platform used to send and receive data from and to the Notecard. On the Notehub Platform, you will be able to see the data received from the Wio Terminal.



Now, for the visualization of the received data, we will use the Qubitro Cloud Platform. The Setup and Linking of the Qubitro Cloud Platform and Blues Notehub Platform are discussed in the next step.


Qubitro Setup


Qubitro is a Cloud Platform that allows visualizing the data from multiple data sources like MQTT, TTN, HTTPS, Helium, etc. You can check Qubitro.com for more additional details. Now to complete the setup procedure, You need to Go to portal.qubitro.com and Create a new project. After that add a device with an MQTT connection. You will see the connection credentials, note them somewhere because you will need them moving ahead. Now go to the Route tab on the Blues Note hub then select type as MQTT and enter the credentials as given below:-

Set the Username to the Qubitro Device ID.Set the Password to the Qubitro device token.Set the Topic to the Qubitro device ID.

Now go to the environment section on the Blues Device and change the content as shown in the image above.




After this, open the qubitro portal and look for the incoming data from the Notehub you will see some data received from the note hub, but the data will not be there in a readable format. To make it clean, just go to the Blues Route tab, scroll down and add a JSON rectifier with the help of which, you will be able to see the data in a more clean way. The next step is adding visuals for this navigation to the monitoring section and creating a new dashboard.



You can add different widgets as per your need. Finally, we will add an alarm system, for this, we will use webhooks with make. Go to eu1.make.com and create a new account and then create a scenario as shown in the image. Here we have added webhooks with Twilio and email so that once the webhook is triggered, SMS and Email Alerts get started.



Now go to the Qubitro portal and navigate to the rule section, add a new rule there, we have added a rule like model score =100, so whenever the model detects its trigger item, it would trigger the webhook then all the actions will take place with the help of make.

So in this way, our setup is complete and we can go ahead to check if everything is working fine or not.





After all those setup procedures, now we are finally at the testing stage of this project. There are a lot of steps to be followed therefore you need to take care while implementing these so that a seamless implementation happens. Now, Once the device detects the items that it is trained to detect(in our case, elephants), it will send an email alert on the given email id and an SMS alert on the mobile phone configured.



You can also open the Qubitro Platform to see some additional details of the detection like the location from which the items have been detected or other visualizations, provided you have added those widgets to your dashboard. So in this way, our Elephant detection Gatekeeper is up and running. You can use this device according to your need and train the module to detect something else according to your need. Hope you liked the project. That's it for this project, we will be back soon with another fascinating project.

All Rights