monitor multiple beehives from one

Hi Guys,

I have been pondering on a project for multiple weeks now and I am kind of lost. I have multiple plausible solutions, but none is really 'the' solution in my eyes.

What are we talking about? For now I have a arduino mini pro connected to 3 DS18B20, a DHT22 and a RFM95 lora radio. This unit monitors one of my beehives and sends temperature and humidity to TheThingsNetwork.

I have the DS sensors connected to different pins, so I'm sure which sensor is which. I change sensors often when I have to replace stuff in the hive, so sensor id's can change. Pin1 is box1, pin 2 is box2... I can't just loop through all sensors as far as I know.

As I have hives in places that don't have TTN coverage I am looking towards GPRS to send my data. As these modules are quite expensive (If I would want to monitor 20 to 50 hives in the future), I want to combine multiple hives 4 or 6 for example) on one node.

Things I have thought of:

  • Connect all DS18 sensors to one arduino pro mini, 1 pin per hive, 3 to 6 sensors per pin. Hard code sensor ID's so I know where which sensor is. No easy way to replace sensors without reprogramming or using sd card with sensor id's

  • Let a arduino pro emulate a 1- wire slave. Looked into this, but this seems beyond my skill level to build from cratch.

  • Build a arduino pro mini I2C slave which communicates the sensor data to the master adruino. Hives ar not more that a few meters apart, so this should be a plousible solution.

  • Connect 3 to 6 sensors to a DS2482-800 1-wire master chip, 1 chip per hive. Almost gave up on this as there no 'decent' libraries that I could find. Almost gave up on this until i found this one: GitHub - mario67/DS2482MM: An Arduino library for DS2482-800 and DS2482-100 (Maxim).

  • I have been thinking about wireless solutions as Bluetooth or RF, but this would mean the master should always on to be able to receive data from all the slaves

Is there anything I overlooked, some miracle solution I didn't think of? Or does anybody have any pointers for the things I listed above.

Ooh did I mention it has to be low power? I'm using ds16850 batteries.

Thanks for taking the time to read through all this. Any hint/tips/.. are greatly appreciated!

Can you provide a sketch that illustrates where the hives are relative to each other with distances marked on it?

...R

Thx for the reply Robin. I’ll sketch something tomorrow morning. Hives are adjectives to each other, 4 to 6 in a row on 2 wooden beams. Not further then 50cm apart.

robbideloose:

  • Build a arduino pro mini I2C slave which communicates the sensor data to the master adruino. Hives ar not more that a few meters apart, so this should be a plousible solution.

That's a problem. I2C is difficult to push more than 20cm.

Maybe you need just a little more user-interface to set up the DS18B20 sensors. Are you able to plug them in one at a time? So you press a "program" button on the Arduino and then plug in the top sensor, then the middle sensor, then the bottom one? The Arduino saves the sensor IDs in EEPROM so that if it loses power, it doesn't lose the sensor allocations.

I made a menu system on one of my projects that allows me to see all the sensors on the bus and assign them to the individual logical locations one at a time. I had to have everything plugged in, but I could put my fingers on most of the sensors to heat them up and see which ID was in which place. That does mean you have to take your laptop out to the hive.

It definitely sounds like you need some kind of mesh network, maybe with NRF modules, then one master which has the GSM module.

I think you are making too much of the DS18B20 addressing. A pencil and paper is quite sufficient to keep track of them. You can use heatshrink to colour code the leads and groups. You can write on heatshrink. You can wrap Dymo tags onto the leads, or just sticky labels. The DS18B20s is extremely reliable, and able to take abuse. If you have a laptop, reprogramming in the field is easy enough, and it is certainly not something you will have to do often.

I would imagine connecting the hives on an NRF24 network would be all you need. You already have the base station to talk to the outside world. NRFs use very little power, are made for this sort of thing, and are dirt cheap. The coverage would be fine for what you are talking about. A high power NRF on the base station would allow greater coverage. You only need one.

If hives are that close together, I suppose you can at least group all hives on one location onto a single Arduino. These wire lengths should be fine for both the DTH and DS sensors.

Then how far apart are those hive clusters? You may indeed be able to use some mesh networking, where the clusters communicate with one another. Then only one of the Arduinos actually communicate with you, after receiving all the data from the others.

I can see two ways to solve your power/always on methods.

  1. a small solar panel + battery at each location would easily produce enough power to keep then on all the time.
  2. add a RTC to all modules, that switches them on say four times a day. This way all modules will keep in sync and switch on at roughly the same time, try to find each other, and when done (read sensors, transmit their data to downstream, receive all expected data from upstream if any) go back to sleep. A bit care on setting the clock and this can be done in a few minutes and all are back to sleep or even power down.

If you are prepared to put a separate "slave" Arduino at each hive (or perhaps one slave Arduino can connect directly to the sensors on adjacent hives) then it seems to me there are two simple options for communicating with the master Arduino.

RS485 is a long range wired serial connection system. AFAIK it is simple to implement and a wired system will be more reliable than wireless.

or

Attach an nRF24L01+ wireless module to each slave and to the master. Have a look at this Simple nRF24L01+ Tutorial. Wireless is probably easier to implement physically.

...R

Thanks all for thinking along!

MorganS:
you press a "program" button on the Arduino and then plug in the top sensor, then the middle sensor, then the bottom one? The Arduino saves the sensor IDs in EEPROM so that if it loses power, it doesn't lose the sensor allocations.

I hadn't thought about that, but that sounds like a good idea. I Would combine sensors on one hive on one cable, so this might provide a challenge Also the box has to be weatherproof as it is exposed to the elements, but these are things than can definitely be done.

Nick_Pyner:
The DS18B20s is extremely reliable, and able to take abuse. If you have a laptop, reprogramming in the field is easy enough, and it is certainly not something you will have to do often.

They have not let me down, but I have to move frames around the hive on a regular basis, so a frame from the bottom box might end up in the top box.

Robin2:
Attach an nRF24L01+ wireless module to each slave and to the master. Have a look at this Simple nRF24L01+ Tutorial. Wireless is probably easier to implement physically.

Nick_Pyner:
I would imagine connecting the hives on an NRF24 network would be all you need. You already have the base station to talk to the outside world. NRFs use very little power, are made for this sort of thing, and are dirt cheap.

I have never really noticed these radios. They definitely look like a good solution. 50m range, high number of nodes possible. Pitty they take 3,6v max, as I have piles of 16850 batteries I can use with the project.I could always change to 3 aa batteries of use a LDO. at about 1 euro they don't add to much extra cost (compared to the 1-wire master, which costs about 10 euros).

As the hives are usually in a areas without too much radio interference. i'll take a look at the RS485 as a backup solution. Less wires is indeed less stuf to get in the way when working on the beehives.

RS485 is a long range wired serial connection system. AFAIK it is simple to implement and a wired system will be more reliable than wireless.

The receiver and could indeed use a solar panel. I try to keep my hives under the trees to protect them from to much sun during summer. If the receiver can be about 30 to 50 meters away, I must be able to find a good place for it. This also gives me the opportunity to build different kind of recievers (gprs, wifi, ...) so I can choose the best one for each location.

Well, it looks like I have some reading/ordering/prototyping to do :slight_smile:

robbideloose:
I have never really noticed these radios. They definitely look like a good solution. 50m range, high number of nodes possible. Pitty they take 3,6v max, as I have piles of 16850 batteries

I use a LiPo cell to power a model train and I just drop the voltage for the nRF24 through a diode.

...R

Robin2:
I use a LiPo cell to power a model train and I just drop the voltage for the nRF24 through a diode.

...R

Lipo would be roughly the same voltage as li-ion. The ones I'm using are around 4,1v when charged.

This is the first time I would need very low power nodes. Till now I relied on level shifters or just 3;3v power supply. Never had to resort to voltage regulator, diodes, ... I'll have to read up on them.

What diode are you using? I would guess you'll need them as well on the power line as on the logic lines?

Greets,
Robbie

robbideloose:
What diode are you using? I would guess you'll need them as well on the power line as on the logic lines?

Regular diodes have a more or less fixed voltage drop of around 0.6V.
They're not such a good idea for logic lines, as those often require current to flow in both directions (even if the information stream is one way), so you really have to be careful with what you're doing there.

robbideloose:
What diode are you using? I would guess you'll need them as well on the power line as on the logic lines?

An nRF24 can accept 5v on its logic pins.

...R