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 Bees Monitor With Predators Repellent # 10 - Summary
  • 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: guillengap
  • Date Created: 24 Apr 2023 8:03 PM Date Created
  • Views 401 views
  • Likes 6 likes
  • Comments 0 comments
  • save the bees
  • savethebeesch
  • nicla vision
  • lora
  • mkr1310
  • arduino
Related
Recommended

Bees Monitor With Predators Repellent # 10 - Summary

guillengap
guillengap
24 Apr 2023
Bees Monitor With Predators Repellent # 10 - Summary

Table of Contents

  • Introduction
  • Getting Started
  • Edge Impulse
  • Improving Edge Impulse Model
  • Testing The Machine Learning Model With OpenMV
  • Adding The Water Sprayer System
  • Testing The Water Sprayer System
  • IoT Ambient Monitoring System | Part1
  • IoT Ambient Monitoring System | Part2
  • Summary

**********************************************************************************************************************

In this last section I show you my final thoughts on the project, as well as references, how I solved problems and motivations. In this project there are still ideas to experiment, for example I no longer had time to repeat the experiment with wasps, test my artificial intelligence models in an apiary, etc. But if you have enough time, then you can start your own research and use my project as a reference.

image

Introduction

Here I show you a description of my project, goals, schematic diagram, necessary hardware and software. If you have read all the chapters, you should know that my project was divided into two parts: 1) Bees Monitor With Predators Repellent, and 2) IoT Ambient Monitoring System. Below I show you the flowcharts.

image

Getting Started

In this chapter I show you the main features and the setup of the Arduino Nicla Vision and MKR WAN 1310 boards. All this steps are necessary to update the firmware, install the libraries and a simple test to verify the good condition of the boards.

Edge Impulse

  • Here I take the first steps to use the Edge Impulse platform, which helped me to make my artificial intelligence model. To start, I followed the steps in this arduino tutorial: https://docs.arduino.cc/tutorials/nicla-vision/image-classification
  • This tutorial shows you the basic steps in image classification with Edge Impulse, however it uses very simple objects (fruits) with few features and for this reason they got a precision of 100% and loss of 0.06 which are perfect values.
  • Bees, spiders and wasps have many features such as color, size, shapes, weight, texture, etc. In my case I had to make three models because the first two didn't work for me.
  • The first model gave me an accuracy of 70.5% and a loss value of 0.89. Here I used 1200 images of bees, spiders and unknown.
  • In the second model I added more images to increase the accuracy up to 98.8% and loss value to 0.05. However, I discovered that the model used up to 2.7 MB of Flash memory and the Nicla Vision only has 2 MB.

image

Improving Edge Impulse Model

  • I faced next problem to made the model for Nicla Vision.
  • I followed all steps for Image Classification with Edge Impulse and OpenMV in this link: https://docs.arduino.cc/tutorials/nicla-vision/image-classification
  • However, I coulndn’t finish the last step: “7. Test the Model”. Everything was fine until I created and deploy a library with OpenMV in Edge Impulse.
  • Since the Nicla Vision doesn’t have any on-board SRAM we need to build the machine learning model into the firmware and load it from the flash. So, I went to the openmv girhub and fork the repository.
  • Then, I renamed the machine learning model and the label file, and In my fork, I replaced the built-in machine learning model under src/lib/libtf/models with the model downloaded from Edge Impulse. Finally, OpenMV failed to build a new firmware for Nicla Vision.
  • I had repeated this process 3 times, I had changed the image size to 96 and 48, used Grayscale, etc. etc and nothing worked.

image

I found the solution in technical support of OpenMV, where I opened a report: https://forums.openmv.io/t/openmv-cant-build-a-new-firmware-for-nicla-vision/8200

The solution was to remove images from the model I was creating in Edge Impulse. However the accuracy dropped from 98.8 to 74.1%, but better than the first model (70.5%).

Testing The Machine Learning Model With OpenMV

Once I got OpenMV to create the binary file with the model, the next step was to upload it to the Nicla Vision. Here I did a simple test simulating bees and spiders with two images printed on paper.

Adding The Water Sprayer System

I stopped in the progress of my project due to the bug I experienced in the previous chapter. In this section I tried to improvise a practical and easy to use water sprayer. I found a prototype on the internet but I didn't like it because it used a servo mounted on the spray bottle. Finally I found a nicer solution using a gripper claw, which was perfect since it had holes through which to pass a strap, which helped me to hold the water sprayer bottle.

image

Testing The Water Sprayer System

  • Here I did a final test with the prototype. Again experiment with the same images used in chapter 5. From the observations it can be concluded that the tests are affected by the size of the images, the lighting, the resolution of the digital camera, the focus of the image or object.
  • The water sprayer system worked well, and here I faced the problem of not finding the information to program the GPIO ports of the Nicla Vision using MicroPython. Again I found the solution in the OpenMV discussion forum. Here is the link to the Open MV documentation which is useful for programmers: https://docs.openmv.io/openmvcam/tutorial/gpio_control.html

IoT Ambient Monitoring System | Part1

  • In this section I show you the environmental monitoring of an apiary, inspired by the project that I developed last year for an ecological reserve. I have used the Arduino MKR WAN 1310 board as a receiver module. One of the advantages of this board is energy saving since its previous version wastes unnecessary energy.
  • Finally, I preferred to improve the previous version of the IoT System instead of showing numbers of bees and spiders seen by the Nicla Vision because I think this is more useful to protect an apiary.

image

IoT Ambient Monitoring System | Part2

Here I do a simple test of the environmental monitoring prototype using temperature, humidity and air quality sensors. At the moment I have not been able to use this entire system in the ecological reserve of my community because the local authorities are providing maintenance.

image

Project/Repository

  • https://studio.edgeimpulse.com/public/205534/latest
  • https://github.com/guillengap/bee-or-spider

References:

  • https://docs.edgeimpulse.com/docs/development-platforms/officially-supported-mcu-targets/arduino-nicla-vision
  • https://docs.arduino.cc/tutorials/nicla-vision/image-classification
  • https://openmv.io/pages/download
  • https://store-usa.arduino.cc/products/arduino-mkr-wan-1310?selectedStore=us
  • https://www.edgeimpulse.com/
  • https://thingspeak.com/login?skipSSOCheck=true
  •  (Missing Blog Post) 
  • Sign in to reply
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