Beehive scales: List of commercial and open source projects in Europe

Making an electronic hive scale can be harder than you think

Hive scales for use by beekeepers are a niche market; moreover, they must meet a number of special requirements, such as:

  • Must withstand long-term outdoor use (protection against rain, moisture/dust, very low and high temperatures, possibly theft/vandalism, wild animals etc.).
  • Must weigh accurately under challenging conditions (temperature fluctuations, vibrations caused by wind).
  • Must support a heavy load over a long period of time while still registering small weight changes.
  • Must be able to transmit weight data (often over long distances).
  • Must have low power consumption (for off-grid installations).

It is therefore unsurprising that no major scale manufacturer offers a hive scale and that commercially available scales from specialized manufacturers can be quite expensive.

List of hive scales available in Europe

The following list contains all beehive scales available in Europe that we currently know of (both commercial and open source / DIY projects). Websites with descriptions in English and with recent updates were highlighted:

We would be happy to receive links to other products and projects in the comments.

Does the A&D AD-1688 weighing data logger also work with scales from other manufacturers?

What is the A&D AD-1688 weighing data logger?

It is a compact device designed to be connected to scales and balances made by A&D via their RS-232 interface. It stores the weight and – if required – a sequential number and the date/time. After weighing, it is connected to a USB port on a computer (just like a flash drive) to access the data:

data logger ad-1688 connected to pc

The CSV file created by the AD-1688 can be opened in applications such as Excel by simply double-clicking on it. The weight will appear as a number in its own column, ready for further processing.

Does the data logger work with scales from other manufacturers?

Sometimes, but it almost never works as well as with scales from A&D. In our tests, the following problems occurred.

Connectors and pinout

Weighing data logger AD-1688 connectors
Connectors of the cables included with the AD-1688 weighing data logger

The data logger comes with suitable cables for (almost) all scales and balances made by A&D. On a DE9 connector (often erroneously called DB9), it uses pins 2 (RxD), 5 (GND) and 6 (DSR), though the latter is not strictly necessary. To connect to scales from other manufacturers, you may need adapters such as “gender changers” or null modem adapters, or you may need to make a special cable:
rs232 gender changer null modem adapter

Please do not assume that the pinout is compatible just because the connector can be plugged in on your scale!

Possible damage

Some scales use pins of the RS-232 port for other purposes, e.g. for powering peripherals such as check weighing signal lights. These pins must not be connected to the AD-1688!

Power supply via the RS-232 interface

The AD-1688 gets its power from the scale it is connected to (or the USB port when connected to a computer). RS-232 voltage levels are clearly defined in the RS-232 standard. Nevertheless, the “RS-232” interface of some scales does not supply the voltage required to operate the AD-1688. On a Kern DE parcel scale, for example, the data logger did not turn on at all, even though the pinout matched:

ad-1688 weighing data logger and kern de scale
AD-1688 weighing data logger conencted to a Kern DE parcel scale

Further analysis revealed that this scale did not contain an RS-232 transceiver and that logic one (“mark”) was sent as 0 V (instead of −15 to −3 V).

Interface parameters

The settings for baud rate, number of data bits and parity must match on the scale and on the data logger, otherwise the AD-1688 won’t be able to read the incoming data correctly.

When using the data logger with scales from A&D, you do not have to worry about this: Almost all A&D weighing instruments use 2400 bps, 7 data bits, parity “even”. This is also the default setting of the AD-1688.

For scales made by other manufacturers you will have to change the interface parameters either on the scale or on the data logger. The AD-1688 supports the following settings:

  • Bit rate: 600, 1200, 2400, 4800, 9600, 19200.
  • Data bits/parity: 7 even, 7 odd, 8 none.

Data format

The data logger expects all data to be sent as ASCII in A&D’s standard format:

First line: byte number; second line: ASCII character sent by an A&D balance; third line: hexadecimal value
 1 2 3 4 5 6 7 8 91011121314151617
ST,+00456.89gCRLF
53542C2B30303435362E38392020670D0A

Only a very small number of scales made by other manufacturers support this exact format. If your scale sends data in a different format, two problems may occur:

  1. Unless each line is terminated with carriage return and line feed, the AD-1688 won’t record it.
  2. Even if this is the case, the numeric value of the weight will not be separated from the unit (and other characters sent by the scale).

You can generally solve the second issue by using the import wizard of your spreadsheet application. With Excel, the easiest way to open the file in the import wizard is to rename it from .CSV to .TXT.

You can try this out yourself by right-clicking here and downloading a (renamed) file we recorded on an AD-1688 connected to an Ohaus Catapult 5000 scale. This is the scale shown in the header image of this article.

Number of lines

Many scales send several line breaks after the weight (for the paper feed of a serial printer). This causes the data logger to create empty rows not containing any data. If you cannot modify the line feed configuration of your scale, you can instead increase the “Line” setting of the AD-1688 to combine several lines into one row.

This will result in empty columns (see example file above), which is much better than empty rows. However, the maximum is 7 lines. Beyond that, data will spill into the next row.

Decimal point or comma

The AD-1688 data logger cannot convert between a decimal point and comma. If you’re in a country which uses a decimal comma, this again means that you will have to use the import wizard of your spreadsheet app to correctly format the weight as a number.

Note: A&D scales let you choose whether the weight should be sent with a point or comma (e.g. “12.34″ or “12,34″) and therefore do not have this problem. You only have to ensure that the “dP” setting on the data logger matches the decimal separator used by your scale.

Transmission mode

Most scales have a “print” or “data” button to send a single weight reading to a connected device. However, this is not always the case. Some scales send the weight continuously with several values per second. This would quickly fill the memory of the AD-1688. You can mitigate this by using the “Rec” setting so that data is only stored at certain intervals, but this is far from ideal for most applications.

Other scales use bi-directional protocols (very common with point-of-sale scales):

nci pos protocol
Example: NCI POS protocol

Such scales can definitely not be used with the AD-1688 weighing data logger as it can only passively record incoming data. It is unable to send requests to the connected scale (see pinout above, there is no transmit pin).

Intended use according to A&D

Finally, the manual (PDF) clearly states that the AD-1688 is designed to be connected to “balances and scales with an RS-232C connector manufactured by A&D“. It was never intended to be used with weighing instruments made by other manufacturers. Given the many pitfalls described here, this is an understandable decision.

Conclusion

The trouble-free operation of the AD-1688 weighing data logger is only guaranteed with compatible scales from A&D.

On scales from other manufacturers, the AD-1688 may work, but there are many potential problems that can cost you a lot of time. Even in the best case, the resulting CSV file will often not be fully comma-separated due to differences in the data format and will require further processing.

If your scale is not made by A&D, consider connecting it to a PC for data acquisition. You can use our Simple Data Logger software, which is designed to work with scales from many different manufacturers.

Note: The information in this article is valid for firmware P1.10 of the AD-1688.

Links and further information about the AD-1688 weighing data logger

Reading the weight from an Ohaus Defender 5000 scale with PHP

Please consider: A single-threaded, synchronous programming language with blocking I/O calls like PHP may not be the best choice for communicating with a scale. The following post is not meant as a recommendation for PHP.

Defender 5000 scales can be equipped with a WiFi or wired Ethernet interface. The scale acts as a TCP server and your script establishes a persistent connection as a TCP client.

You can then use one of the following methods to send the weight from the scale to your PHP application:

  • Send a command to the scale to request the weight (described in this post).
  • Wait until the operator presses the PRINT button.
  • Configure the scale to send each stable weight automatically.
  • Set the scale to a continuous transmission mode (it will send several values per second).

Please see the Defender 5000 manual (PDF) for further information.

You can easily test the communication via wired Ethernet or WiFi by using PuTTY in “raw” mode:

PuTTY raw tcp connection
The WiFi dongle uses port 6060 (wired Ethernet: port 9761), the IP address is assigned via DHCP by default.
Defender 5000 scale: weight in PuTTY
IP (immediate print) command used to request the weight and reply sent by the scale (N: net weight, G: gross weight, T: tare weight).

Using PHP to communicate with the scale

For demonstration purposes, I’ve adapted example #2 (simple TCP/IP client) from the official documentation:

<?php
error_reporting(E_ALL);

echo "TCP/IP Connection\n";

/* Ohaus Defender 5000 WLAN interface uses port 6060 by default, Ethernet interface uses port 9761 */
$service_port = 6060;

/* IP address of the scale, can be displayed/set in the menu */
$address = "192.168.0.195";

/* Create a TCP/IP socket. */
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
if ($socket === false) {
    echo "socket_create() failed: reason: " . socket_strerror(socket_last_error()) . "\n";
} else {
    echo "OK.\n";
}

echo "Attempting to connect to '$address' on port '$service_port'...";
$result = socket_connect($socket, $address, $service_port);
if ($result === false) {
    echo "socket_connect() failed.\nReason: ($result) " . socket_strerror(socket_last_error($socket)) . "\n";
} else {
    echo "OK.\n";
}

$in = "IP\r\n"; //IP command (Immediate Print) - supported commands depend on the manufacturer, model and LFT settings
$out = '';

echo "Sending command...";
socket_write($socket, $in, strlen($in));
echo "OK.\n";

echo "Reading response:\n\n";
while ($out = socket_read($socket, 128, PHP_NORMAL_READ)) {
    echo $out;
}

echo "Closing socket...";
socket_close($socket);
echo "OK.\n\n";

When socket_read encounters carriage return or line feed, it returns the data received from the scale. By default, these characters are sent by the scale at the end of each line.

The PHP script produced the following output:

Defender 5000 weight requested with PHP

You can modify the output template through the menu of the scale or by using the Ohaus Scale Mate software, e.g. to send just the net weight and date/time:

Ohaus Defender 5000 custom template

You’ll find a list of commands supported by the scale in the user manual (chapter 5, “interface command”). Note that each command has to be followed by carriage return and line feed.

In the script, I used the “IP” (immediate print) command, which tells the scale to send the weight immediately (whether it is stable or not). This command is available on all recent Ohaus scales. One notable exception are legal-for-trade (LFT) models, which only support the P command (similar to pressing the print button) and in some cases the SP command (stable print, send weight as soon as it has stabilized).

Tip: The Ohaus Defender 5000 also supports many MT-SICS commands. This means that you could send commands such as “SI” (send immediately) and receive a reply in a standardized format which is independent of the template set in the scale:
MT-SICS response Ohaus Defender 5000

Please note that I’m not a PHP expert and that I don’t recommend using PHP. This article is only supposed to be a very basic demonstration. Other programming languages such a C#, Java, server-side JavaScript (node.js) or Python may be more suitable.


The header photo shows a Defender 5000 communication test case (a hard case with a built-in Defender 5000 indicator with all optional communication interfaces installed).