Weight, temperature and humidity measurement in a beehive using Arduino and LoRaWan (TTN).\ Deutscher Text.
To support bee keepers in monitoring their bees with minimal interference, a set of sensors will measure and transmit the current state in short intervalls. Design goals:
Arduino (alternatively Uno + Dragino LoRa Shield, Dragino LoRa Mini Dev, or CubeCell LoRa Dev)\ A small microcontroller has enough power to measure every couple of minutes. A rechargeable battery serves as buffer to measure during night and cloudy weather.\ The device works without any human intervention except a button to put it to a 'manual mode' when working with the beehive.
LoRaWAN TTN-Gateway/Network/Application\ Beehives usually have no wired internet connection and high-speed connections using GSM and WLAN is avoided to keep radiation low.\ TheThingsNetwork (TTN) is a global open LoRa network. If no gateway is available within some km near the beehives, an additional gateway can easily be installed.
Dashboard and visualization with ThingSpeak channel\ This is the quick and simple way to display the sensor data.
Mapping and routing sensor data eg. using AWS (work in progress) \ Alternative or extension to the ThingSpeak display. Such a back-end application can be used to collect the sensor data and to feed a web application.
Three boards have been tested:
Used pins:
Pin Function | Wiring | Uno+Shield / Dragino | CubeCell |
---|---|---|---|
1-wire Temp sensor | pull-up resistor 4k7 to VCC | D5 | GPIO5 |
DHT-11/22 | pull-up resistor 4k7 to VCC | D4 | GPIO4 |
HX711 Dout | A0 | GPIO2 | |
HX711 Sck | A1 | GPIO3 | |
Push-Button | to GND (active low, triggers interrupt) | D3 | GPIO7 (aka battery test control) |
LED | to VCC (active low) | A2 | GPIO1 |
"sensor": {
"version": 0, // command id or version
"battery": 3.92,
"weight": 0.37,
"humidity": {
"roof": 47.5
},
"temperature": {
"drop": 20.68,
"lower": 19.5,
"middle": 19.93,
"outer": 20.62,
"roof": 22.2,
"upper": 19.37
}
}
Local installation of git
and Arduino IDE
assumed.\
Install the CubeCell board: https://heltec-automation-docs.readthedocs.io/en/latest/cubecell/quick_start.html
(current version 1.3.0).
cd <project-root>
git clone https://github.com/joergkeller/beehive-sensor.git
cd beehive-sensor
git submodule init
git submodule update
To fetch the latest updates:
cd beehive-sensor
git stash
git pull
git submodule update
git stash pop
Arduino Settings | Value |
---|---|
File > Preferences > Settings > Board Manager URLs | https://github.com/HelTecAutomation/CubeCell-Arduino/releases/download/V1.3.0/package_CubeCell_index.json |
File > Preferences > Settings > Sketchbook location | C:\...\beehive-sensor |
File > Open... | C:\...\beehive-sensor\arduino_beehive_sensor_lora\arduino_beehive_sensor_lora.ino |
Tools > Board | CubeCell-Board |
Tools > LORAWAN_REGION | REGION_EU868 or your region |
Tools > LORAWAN_CLASS | CLASS_A |
Tools > LORAWAN_DEVEUI | CUSTOM |
Tools > LORAWAN_NETMODE | OTAA |
Tools > LORAWAN_ADR | ON |
Tools > LORAWAN_UPLINKMODE | UNCONFIRMED |
Tools > LORAWAN_NET_RESERVATION | OFF |
Tools > LORAWAN_AT_SUPPORT | OFF |
Tools > LORAWAN_RGB | ACTIVE or DEACTIVE |
Monitor baud rate | 115200 |
The project already includes all required libraries (that is the reason for the submodule commands and for the local sketchbook location).
Then
credentials.h
calibration.h