So now my Arduino MKR Wan start sending data and also ESP32 and LoRa: Ra-02 start taking it with just receiving code.
- Analysis of honey BeeHive
Here I am going to showcase and discuss the software part and the final project. The Code to send the data using loRa(Ra-02) 433MHz.
- Monitoring
LoRa Sending Code:
#include <AHT10.h> #include <Wire.h> #include <Adafruit_BMP280.h> #include <SPI.h> #include <LoRa.h> int counter = 0; uint8_t readStatus = 0; Adafruit_BMP280 bmp; // I2C AHT10 myAHT20(AHT10_ADDRESS_0X38, AHT20_SENSOR); byte Node1 = 0x60; #define SEALEVELPRESSURE_HPA (1013.25) void setup() { Serial.begin(9600); while (!Serial); Serial.println("LoRa Sender"); if (!LoRa.begin(433E6)) { Serial.println("Starting LoRa failed!"); while (1); } Serial.println(); bool status; if (!bmp.begin()) { Serial.println(F("Could not find a valid BMP280 sensor, check wiring!")); while (1); } while (myAHT20.begin() != true) { Serial.println(F("AHT20 not connected or fail to load calibration coefficient")); //(F()) save string to flash & keeps dynamic memory free delay(2000); } Serial.println(F("AHT20 OK")); } void loop() { readStatus = myAHT20.readRawData(); //read 6 bytes from AHT20 over I2C if (readStatus != AHT10_ERROR) { Serial.print(F("Temp. Super Chamber_Celsius "));Serial.println(myAHT20.readTemperature()); Serial.print(F("AVG. Hive Humidity ")); Serial.println(myAHT20.readHumidity()); Serial.print(F("Temp. Breeder_Celsius ")); Serial.println(bmp.readTemperature()); Serial.print(F("Pressure")); Serial.println(bmp.readPressure() / 100.0F); Serial.print(F("Approx. Altitude")); Serial.println(bmp.readAltitude(SEALEVELPRESSURE_HPA)); Serial.println(F(".")); Serial.print("Sending packet: "); Serial.println(counter); // send packet LoRa.beginPacket(); LoRa.print(F("Temp. Super Chamber_Celsius ")); LoRa.print(myAHT20.readTemperature()); LoRa.print(F("AVG. Hive Humidity ")); LoRa.print(myAHT20.myAHT20.readHumidity()); LoRa.print(F("Temp. Breeder_Celsius ")); LoRa.print(bmp.readTemperature); LoRa.print(F("Pressure ")); LoRa.print(bmp.readPressure() / 100.0F); LoRa.print(F("Approx. Altitude ")); LoRa.print(bmp.readAltitude(SEALEVELPRESSURE_HPA)); LoRa.print(counter); LoRa.endPacket(); } else { Serial.print(F("Failed to read - reset: ")); Serial.println(myAHT20.softReset()); //reset 1-success, 0-failed } delay(2000); //recomended polling frequency 8sec..30sec }
Discussion:
Here we can see the Super Chamber Temperature is higher than Breeder Chamber that means super chamber is getting honey and that's why its warmer and bees are taking care of their larva and cooling down their breeder chamber. no attack occurs. My agenda was to save the bees from "Yellow Jacket" and protect them from miscellaneous condition in practical places.
So, start working to find "Yellow Jacket" detection.
Previously I told that "I was lucky to find the relevant code for image processing for Nicla vision from examples in OpenMV. So, my task became quite easy."
To work with Nicla vision, we need to install OpenMV which is IDE for that and here is many examples to work. Primitively after install OpenMV, you need to connect Nicla Vision Cam.
then,
You see this picture and you need to connect it or follow my steps one by one.
Then press connect and you will see the play button become green
.py program start running.
I also get my code through example just simple need color code modification.
During operation I cannot find any "Yellow Jacket" but I tried to show this by internet image simulation of Japanese yellow jacket.