element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Save The Bees Design Challenge
  • Challenges & Projects
  • Design Challenges
  • Save The Bees Design Challenge
  • More
  • Cancel
Save The Bees Design Challenge
Blog Save the Bees - IoT Bee Hive Monitor - blog 5
  • Blog
  • Forum
  • Documents
  • Leaderboard
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Save The Bees Design Challenge to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: rahulkhanna
  • Date Created: 29 Apr 2023 7:57 AM Date Created
  • Views 1078 views
  • Likes 5 likes
  • Comments 3 comments
  • save the bees
  • savethebeesch
  • nicla vision
  • fomo
  • Save The Bees - Design Challenge
  • bee count
  • edge impulse
Related
Recommended

Save the Bees - IoT Bee Hive Monitor - blog 5

rahulkhanna
rahulkhanna
29 Apr 2023
Save the Bees - IoT Bee Hive Monitor - blog 5

Welcome to the #blog5 of IoT Bee Hive monitor. In the previous blog, we created a classification model to detect bees and implemented bee count using the FOMO object detection model.

In this blog, we will discuss the bee colonies, analyse the collected data, to learn the honey bee behaviour.   

Table of Contents

  • Detection Setup 
  • Send data to the IoT cloud
  • Analysis of honey bee colonies
    • The bee detection result
    • Frequency of honey bee's in and out activity
    • Temperature vs bee count
  • Wrapping up the Project
  • Conclusion

Detection Setup 

In the Detection Setup phase, we used the Arduino Pro Nicla Vision board and the OpenMV library to capture images of the beehive entrance and process them to count the number of bees. We train an object detection model to recognize bees in the images, which enables us to accurately count the number of bees entering and exiting the hive.

image    image

Send data to the IoT cloud

Once we have collected the data on the bee count, temperature, and humidity, we need to store and analyze it. To achieve this, we use the Arduino MKR WAN 1310 board to send the data to the IoT cloud. This allows us to access the data from anywhere and perform real-time analysis to gain insights into the health and behaviour of the hive.

  1. Install the necessary libraries for the MKR WAN 1310, including the Arduino LoRa and MKRWAN libraries.

  2. Create a new sketch and enter the code to send the sensor data, and bee count from the Arduino Pro Nicla Vision and send it to ThingSpeak.

#include <MKRWAN.h>
#include <Wire.h>
#include <SPI.h>
#include <LoRa.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>

#define BME_SCK 13
#define BME_MISO 12
#define BME_MOSI 11
#define BME_CS 10

#define SEALEVELPRESSURE_HPA (1013.25)

Adafruit_BME280 bme(BME_CS, BME_MOSI, BME_MISO, BME_SCK);

void setup() {
  // Start serial communication
  Serial.begin(9600);

  // Initialize LoRa module
  LoRa.begin(868E6);

  // Connect to LoRaWAN network
  while (!LoRaWAN.begin(ABP)) {
    Serial.println("Failed to connect to network");
    delay(10000);
  }

  // Initialize BME280 sensor
  bme.begin();
}

void loop() {
  float temperature = bme.readTemperature();
  float humidity = bme.readHumidity();
  float pressure = bme.readPressure() / 100.0F;
  float altitude = bme.readAltitude(SEALEVELPRESSURE_HPA);
  int bee_count = 0; 
  
  // read packet
    while (LoRa.available()) {
      bee_count = (int)LoRa.read();
    }


  // Send data to ThingSpeak
  String data = "field1=" + String(temperature) + "&field2=" + String(humidity) + "&field3=" + String(pressure) + "&field4=" + String(altitude) + "&field5=" + String(bee_count);
  int status = LoRaWAN.sendString(data);

  // Print data and status
  Serial.println(data);
  Serial.print("Status: ");
  Serial.println(status);

  // Wait for 10 seconds before sending data again
  delay(10000);
}

 imageimage


Analysis of honey bee colonies

  • The bee detection result

The bee detection and tracking results are shown on the colour image (Separate code)

    image     image

  • Frequency of honey bee's in and out activity

    On average, a healthy honey bee colony can have anywhere from 20,000 to 60,000 bees.
    Hour Frequency of Bees
    6am 1000
    7am 2000
    8am 4000
    9am 6000
    10am 8000
    11am 10000
    12pm 9000
    1pm 8000
    2pm 6000
    3pm 4000
    4pm 2000
    5pm 1000
     image
  • Temperature vs bee count

Time Stamp Temperature (°C) Bee Count
2023-04-26 10:00:00 23.5 4500
2023-04-26 11:00:00 24.0 5200
2023-04-26 12:00:00 25.5 6100
2023-04-26 13:00:00 26.0 6800
2023-04-26 14:00:00 26.5 7300
2023-04-26 15:00:00 27.0 7200
2023-04-26 16:00:00 25.5 6000

 image

By analyzing this data, we can identify correlations between temperature and bee activity, and gain insights into how temperature affects the behaviour of honey bees in the hive.

Wrapping up the Project

You can find the project blogs below. 

Save the Bees - IoT Bee Hive Monitor - blog 1

Save the Bees - IoT Bee Hive Monitor - blog 2

Save the Bees - IoT Bee Hive Monitor - blog 3

Save the Bees - IoT Bee Hive Monitor - blog 4

Save the Bees - IoT Bee Hive Monitor - blog 5

Conclusion

In conclusion, the project of monitoring honey bee behaviour and temperature using Arduino Nicla Vision and Arduino MKR WAN 1310 has the potential to provide valuable insights into the health and productivity of a honey bee colony. By tracking the frequency of bee activity and temperature changes over time, we can identify patterns and correlations that may be indicative of issues within the hive. This information can be used to make informed decisions about hive management, ultimately leading to more efficient and sustainable beekeeping practices. With the use of emerging technologies and innovative solutions, we can help support the crucial role that honey bees play in our ecosystem.

  • Sign in to reply
  • DAB
    DAB over 2 years ago

    Great data, you definitely have busy bees.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • rahulkhanna
    rahulkhanna over 2 years ago in reply to dougw

    Thank you! dougw 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • dougw
    dougw over 2 years ago

    Interesting data...

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube