This page describes a Beehive Data Logger that I developed to measure the hive weight and two temperatures (from a probe inside the hive and of the external ambient temperature). It records the measurements in a file on an SD card using the CSV format which is easy to load into a spreadsheet. It can also send results in an SMS message. The data logger achieves very low power by switching off between measurements. Depending on how frequently it takes readings and sends an SMS, it should be able to run for several months from a fully charged 250mAh rechargeable PP3 battery. There is also a button cell used by the clock circuit which should last at least a year.
In addition to this page, there are further details about the data logger here.
The Beehive Data Logger system consists of:
A box of electronics based on an Arduino plus additional modules. The electronics is not completely weatherproof and is to be located on a shelf under the hive, protected from rain.
Load cell weight sensors. Four load cells are mounted underneath the four corners of the hive on a modified hive stand.
A platform on top of the load cells, with four metal plates attached to the underside so that they are in contact with the load cells, in order to spread the load as otherwise the load cells would dig into the wood of the hive. The hive is placed on top of this platform.
A temperature sensor to measure the external temperature, located near the load cells in case we need to compensate for any temperature drift of the load cells.
A temperature sensor to monitor the internal hive temperature. This can be threaded through the hive entrance and than up over a brood frame and then back down such that the sensor is as near as possible to the centre of the brood.
Hive with Data Logger: (1) Prototype Installed; (2) Schematic.
The electronics consists of:
A purpose designed PCB for this project. All other electronic components and modules are mounted on this PCB except the GSM modem.
Arduino Nano.
SD Card Interface PCB.
Real Time Clock RTC. The Hive Logger PCB has been designed to give the choice of using either a a surface mount RTC IC and button cell holder soldered directly to it, or plugging an RTC module (a small PCB) into it.
LCD Display PCB. 2 lines of 16 characters.
Load Cell Analogue to Digital Converter HX711 PCB.
Buck Converter to provide the 5V for the GSM module.
Siemens TC35 GSM Module.
If you don't want to make a PCB, you could build the circuit and mount the modules on strip-board (Veroboard); this is what I did for the prototype. You could also prototype using a plugboard.
The Hive electronics, mounted in a plastic box with transparent lid.
The sensors are:
4 Load Cells (which connect to the HX711 AtoD).
2 LM335 temperature sensors (one for hive interior, the other for ambient).
The data logger achieves very low power by switching off between measurements. The alarm function of the Real Time Clock DS3231 is used to wake up the unit. The power to the Arduino is controlled by a flip-flop comprised of two NAND gates. This bistable is flipped into the Power-ON state by any of three events:
When the unit is powered up (battery connected), a capacitor is intended to hold an input low for long enough to make it come up in the Power-ON state.
When the alarm output of the Real Time Clock DS3231 is pulled low.
When the push button mounted on the unit’s case is pressed. This is to allow the user to force a power up in order to read the current weight, etc.
The Arduino is able to flip the bistable into the Power-OFF state via output D4, when the program wants to put the unit into sleep. The RTC is powered by its own button cell, like a watch. The flip-flop power-up circuitry consumes only microamps from the main 9V battery.
The circuit was designed in KiCad and a PCB laid out (the "Hive PCB").
To understand how to use KiCad, see the brilliant series of several Youtube videos starting with An Intro to KiCad – Part 1: How PCBs Are Made | DigiKey There are 10 videos that take you through the whole process: essential viewing!
The PCB gerber files generated by KiCad were sent for manufacture to Chinese company JLC PCB who made 5 copies of the PCB for under in £10 total. Had I used surface mount components, they could also have populated them.
The software is a single Arduino file. It makes use of standard libraries for the SD Card, the RTC, the HX711. The SW has two functions: (a) For a log (woken by the RTC alarm), carry out the measurements, record them to SD and if due, send an SMS; (b) When woken because the user pressed the push button, make and display measurements and provide a simple User Interface that allows the user to check the current configuration settings, adjust the clock, re-calibrate the sensors and send a test SMS.
The way that the logger operates (frequency of logs, etc.) is controlled by a configuration file on the SD card. This file has to be edited by removing the SD card from the logger, plugging it into a PC and using a text editor. It can only be viewed, not edited, on the Logger itself, as editing with just a push button as input would be too hard. Also there is almost no space for additional code on the Arduino, the program already being large.
There are two ways results are obtained from the Logger:
By the SMS messages it sends.
By retrieving the LOG file it stores on the SD card.
The SMS messages have to be very brief in order to fit in the 160 character SMS limit. The illustration shows a real message received. Below is the content of a message sent at 14:00 on 21st October:
Hiv2 B7.6V dd hh:mm kg Ext Int 20 18:00 11.08 14 32 20 22:00 11.08 14 31 21 02:00 11.08 14 30 21 06:00 11.08 14 30 21 10:00 11.08 13 29 21 14:00 11.08 15 29
The first line shows a 4-character (max) Hive ID "Hiv2", followed by the battery voltage "B7.6V". The battery voltage is provided so that you can tell when the battery may need replacing.
The second line is the column headings for the data rows. These are:
dd – Day of the Month the measurement was made (SMS messages are time-stamped so you will know the month & year).
hh:mm – The time the measurement was made.
kg - The hive weight in kg.
Ext – The external temperature in C.
dd – Day of the Month the measurement was made (SMS messages are time-stamped so you will know the month & year).
Int – The internal temperature in C.
The remaining 6 rows are the data. These are retrieved from the LOG file.
SMS Received from Hive.
To use the LOG file copy it to a PC. You can view it in a text editor (like Microsoft Notepad); normally a text editor will open it automatically if the extension is .TXT
You can also open the LOG file in a spreadsheet like Excel. The easiest way to do this is to make the file extension .CSV (if it isn’t already, so the filename will be LOG.CSV) and then click on it. When Excel opens the CSV file for the first time, it is likely to ask how you want to import the columns. Select the DateTime column and choose Date YMD. The DateTime should now be in the first column of the spreadsheet and you will be able to generate graphs with DateTime as the X-Axis.
If you record measurements frequently (e.g. every hour) you will be able to see the hive weight change as the bees leave in the morning to forage and return with nectar, and the drop in weight during the night as they consume stores. When the brood box contains larvae, you can also observe the very steady temperature of about 33C that is maintained in the brood chamber. Some example graphs obtained from our hive during the summer of 2020 are below.