Scaling an IoT deployment? Join our webinar on May 28th where we dive into real-world scaling pain points and how to overcome them.

Blues Developers
What’s New
Resources
Blog
Technical articles for developers
Newsletter
The monthly Blues developer newsletter
Terminal
Connect to a Notecard in your browser
Developer Certification
Get certified on wireless connectivity with Blues
Webinars
Listing of Blues technical webinars
Blues.comNotehub.io
Shop
Docs
Button IconHelp
Notehub StatusVisit our Forum
Button IconSign In
Sign In
Sign In
What’s New
Resources
Blog
Technical articles for developers
Newsletter
The monthly Blues developer newsletter
Terminal
Connect to a Notecard in your browser
Developer Certification
Get certified on wireless connectivity with Blues
Webinars
Listing of Blues technical webinars
Blues.comNotehub.io
Shop
Docs
homechevron_rightBlogchevron_rightDigitalizing the Wild with Blues

Digitalizing the Wild with Blues

Digitalizing the Wild with Blues banner

August 31, 2023

Explore a creative solution to help prevent human-wildlife conflicts with LoRa and Blues Cellular IoT.

  • Notehub
  • Cellular
  • Machine Learning
Pradeep
PradeepVLSI Chip Testing Engineer
email
Photo by Bernd 📷 Dittrich on Unsplash

Human-wildlife conflicts are interactions between humans and wildlife that result in negative impacts on human social, economic, or cultural life, wildlife populations, or the environment. They occur when humans and wildlife share the same resources, such as land, water, food, or habitat, and when humans perceive wildlife as a threat to their safety, livelihood, or well-being.

Elephants living amongst people

Human-wildlife conflicts are not a new phenomenon, but they have increased in frequency and intensity in recent decades due to various factors, such as human population growth, urbanization, habitat fragmentation, climate change, wildlife poaching, and illegal trade. These factors have reduced the natural habitats and resources of wildlife, forcing them to adapt to human-dominated landscapes and compete with humans for survival. In January 2023, a 64-year-old man in Tamil Nadu was attacked by an elephant that killed 21 people in Kerala and Tamil Nadu. The elephant, code-named PT 7, was tranquilized by a forest team and relocated to the Wayanad Elephant Camp. This is one example that shows the importance of finding effective and sustainable solutions to prevent human-wildlife conflicts.

Some innovative solutions that can reduce or deter human-wildlife conflicts include fencing, repellents, alarms, lights, or translocation.

Let’s Build Better with Blues

In this post, I will show you how I created my own solution that detects an animal and alerts people with LoRa and Blues Cellular IoT. Below is an illustration overview of the solution I built.

Technology used for human-wildlife conflict solution

For this project, I used a Xiao ESP32s3 Sense board , which is a low-power controller with an onboard camera. This helped me classify wild animals using Edge Impulse . I then transferred the classification information to a Blues base station via LoRa. To complete this transfer, I designed a custom PCB that has both Xiao ESP32S3 Sense and LoRa Wio E5 modules.

custom PCB

The Base station receives the LoRa signals and reverts them to the cloud network via Blues Cellular IoT.

Blues base station and custom PCB

Edge Impulse Model Creation

I used Edge Impulse to develop an image classification system. To do this, I used 10 GB of data from Kaggle .

note

Larger data sets will give better results.

Animals Detection Images Datasheet in Edge Impulse

Next, I uploaded all the necessary image models to Edge Impulse.

upload data section on Edge Impulse

Then, I labeled the images. For this step, you can label them manually, or you can generate predefined labels with YOLO V5.

Labeling section on Edge Impulse

Next, I prepared the impulse design, with the classification set in the image below.

Design section of Edge Impulse

Then, I generated the model features. Below is my model output.

Click to set a description for this version section of Edge Impulse

Once I generated the model output, I deployed the model for Arduino IDE.

Configure your deployment section of Edge Impulse

EL Model Deployment

The next step was to import the El Library to my Arduino IDE. To import, I opened the Arduino IDE and navigated to the Sketch tab. I then selected the Add Zip Library. Finally, I selected the downloaded zip file from the Edge Impulse portal to deploy the EI model to the Xiao ESP32S3 Sense.

navigate to sketch > include library > Add ZIP libary

Here is the Arduino sketch’s flow that helped me classify the wild animals and transfer the alert via LoRa.

Arduino Sketch flow

To view the full code used in this section, see this GitHub repo.

This part of this Arduino sketch will send an alert message via LoRa if it detects any wild animal.

#if EI_CLASSIFIER_OBJECT_DETECTION == 1
  bool bb_found = result.bounding_boxes[0].value > 0;
  for (size_t ix = 0; ix < result.bounding_boxes_count; ix++) {
    auto bb = result.bounding_boxes[ix];
    if (bb.value == 0) {
      continue;
    }
    ei_printf("    %s (%f) [ x: %u, y: %u, width: %u, height: %u ]\n", bb.label, bb.value, bb.x, bb.y, bb.width, bb.height);

    if (bb.label == "elephant")
    {
      Serial.println("Elephant Detected");
      node_send(1000);
      digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
      delay(1000);                       // wait for a second
      digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
      delay(1000);
    }
  }
  if (!bb_found) {
    ei_printf("    No objects found\n");
  }

Once the particular animal is detected, the above function will trigger the node_send() function. Here is the node_send() function definition.

static int node_send(uint32_t timeout)
{
  static uint16_t count = 0;
  int ret = 0;
  char data[32];
  char cmd[128];
  int node = 1;
  int alarm = 1;
  memset(data, 0, sizeof(data));
  sprintf(data, "%04X,%04X", node, alarm);
  sprintf(cmd, "AT+TEST=TXLRPKT,\"5345454544%s\"\r\n", data);
  ret = at_send_check_response("TX DONE", 2000, cmd);
  if (ret == 1)
  {

    Serial.print("Sent successfully!\r\n");

  }
  else
  {
    Serial.print("Send failed!\r\n");
  }
  return ret;
}

This above function will send node number and alert message to the receiver when it is triggered.

Below, you can see the results of the Arduino serial monitor.

Arduino serial monitor output

Reciever Setup

Next, I worked on the base station side. I set up the base station to receive all the LoRa signals and alert users when data would be moved to Blues Notehub via Notcard. Then, I set it to alert all remote users via Qubitro .

Blues base station and custom PCB

In this image, both Xiao + LoRa E5 and Blues Notecard are connected to the Xiao ESP32 S3 board. I used this Arduino sketch to receive the data from the slave node and then transferred it to Blues Notehub . Here you need to modify the product UID.

#define PRODUCT_UID "your project UID"

I then navigated to the Notehub | Create Project and created a new project.

Create new project in Notehhub

I entered my project name, copied the project UID, and replaced it in the Arduino Sketch. After this, I was able to see the Blues Notehub starting to receive data.

Data displayed in Blues Notehub

Cloud Visualization

Once the data reached the Notehub, I used Qubitro to visualize and make an alert function based on the received data.

Qubitro projects page

Qubitro simplifies the IoT development process by providing tools, services, and infrastructure that enable users to connect their devices, store and visualize their data, and build robust applications without coding. Qubitro supports various IoT protocols and platforms, such as LoRaWAN, MQTT, and The Things Stack.

I navigated to the Qubitro Portal and created a new project.

Create new project pop up in Qubitro

Then, I selected MQTT as the data source.

Select MQTT as data source in Qubitro

Next, I entered all the input details as needed.

Insert input details for data source

Then, I opened the created MQTT source and selected the connection details. It will show you all the credentials, we need these credentials in order to transfer our data to Qubitro.

Connection details and credientials

Routing Data Through Blues Notehub

Let’s move on to the Blues Notehub’s route page. Here, I created a new MQTT route and changed the username and password according to my Qubitro credentials.

Route configuration

At the bottom, I defined which data should move to Qubitro. Here I’m using body only. So, my payload only transferred to the Qubitro.

transform data set to body only

After my payload was successfully transferred to Qubitro, I opened the Qubitro portal to monitor the incoming data.

Historical data on Qubitro

Visualizing Data

We can visualize the data via the Qubitro dashboard. First, I navigated to the Dashboard section and created a new dashboard.

Creating a new dashboard

Then, I clicked on edit and added the widgets I needed.

Edit Widgets

Next, I have added the image widget with the data points, making it straightforward to comprehend the data levels.

Widget configuration with data points

Then, I added a standard gauge to check and visualize the alert level.

Adding Standard Gauge

Finally, I used a state widget for slave number visualization

Adding state widget

and map widgets for GPS mapping.

View of map widget for GPS mapping

This was my final dashboard, which shows the location of my base station and the slave node’s status.

Final Dashboard on Qubitro

Rule Engine Setup

In this section, I added a rule function to alert users when an anomaly is detected. To do this, I navigated to the function in the Qubitro portal and then selected the rule section.

Create function section

Then I created a new rule.

Creating a new rule function

Here I used Webhooks. I entered all the basic details and moved to the next page.

Setting up webhhooks

Then, I opened the webhook site and copied the webhook URL.

Webhook website

Next, I pasted the URL to the Qubitro rule page.

Webhook url pasted in Qubitro rule page

Then I selected the conditions. For this condition, my rule will trigger when my Alert level is greater than 0.

Select conditions for rule

Below is the webhook response.

Webhook response on webhook site

At this point, you could use Twilio or Mailgun to send a customized SMS or email to alert you.

Wrap up

Human-wildlife conflict can have negative impacts on biodiversity conservation, human development, and social harmony. It can also lead to retaliation against wildlife, which can further endanger their survival. With the help of Blues and Machine Learning, we can develop creative solutions to help overcome these issues.

In This Article

  • Let’s Build Better with Blues
  • Edge Impulse Model Creation
  • EL Model Deployment
  • Reciever Setup
  • Cloud Visualization
    • Routing Data Through Blues Notehub
    • Visualizing Data
  • Rule Engine Setup
  • Wrap up

Blues Developer News

The latest IoT news for developers, delivered right to your inbox.

Comments

Join the conversation for this article on our Community Forum

Blues Developer Newsletter

The latest IoT news for developers, delivered right to your inbox.

© 2025 Blues Inc.
© 2025 Blues Inc.
TermsPrivacy
Notecard Disconnected
Having trouble connecting?

Try changing your USB cable as some cables do not support transferring data. If that does not solve your problem, contact us at support@blues.com and we will get you set up with another tool to communicate with the Notecard.

Advanced Usage

The help command gives more info.

Connect a Notecard
Use USB to connect and start issuing requests from the browser.
Try Notecard Simulator
Experiment with Notecard's latest firmware on a Simulator assigned to your free Notehub account.

Don't have an account? Sign up