Lessons and the learning game

Build a smart beehive

A hive monitor on an Uno: hive weight and its trend, brood nest temperature, hive sound, a two-clue swarm watch and LoRa reports from the field.

Respect the bees

Sensors go in during a normal inspection: calmly, in good weather, with a veil and a smoker, and only as often as good practice says. Many places ask beekeepers to register their hives, so check the local rules before you start.

The monitor

Every lesson opens on the same wiring:

  • Weight: load cells under the hive stand on an HX711, 200 kg at 2 mV/V, about 21.5 counts a gram.
  • The brood nest: an SHT31 in the brood box.
  • Sound: the hive microphone on A0. There is no amplified microphone part, so a signal generator stands in for the module's output, a tone on 2.5 V.
  • Reports: an SX1278 LoRa radio.

The catalog lists this course on an ESP32. It is built on the Uno.

How it works

Weight. The empty stand's reading is written into the sketch, so the scale reads the whole hive from power-up; a tare would zero the hive. The weight at each of the last ten minutes is kept: a kilo up is nectar coming in, 1.5 kg or more down is what a swarm looks like. Over 10 kg at once is a hive placed or boxes lifted, and the trend restarts.

The brood nest. Bees hold brood at about 34.5 C. Hotter, and they fan and fetch water; a box at the outside temperature has no brood in it.

Sound. The pitch comes from counting rises through the average in 200 ms, the level from the RMS. A colony hums a little above 200 Hz; young queens pipe in roughly the 300 to 500 Hz range, and hive sound has been recorded changing before swarms. It is a hint, not proof.

Swarm signs. A weight drop alone could be honey taken off; piping alone can last days. A drop of 1.5 kg within half an hour of piping is called a likely swarm.

LoRa reports. Ten bytes: weight, brood temperature, humidity, pitch, level and a report number, every 30 seconds here and hourly on a real hive.

The course

Build a smart beehive gets there in six lessons, each a sketch on the same wiring:

  1. Hive weight: calibration, flows and drops.
  2. Temperature and humidity: the brood nest's thermostat.
  3. Hive sound: pitch, level and the piping band.
  4. Swarm signs: two clues, one alarm.
  5. LoRa reports: ten bytes home.
  6. Project: a season of data: all of it, with the season so far.

Every step but the last is checked against the running circuit.