Connecting the henhouse

[The Excamera Labs store is now a little bit more polished... another small step towards Excamera Labs being a self-sustaining open-source hardware company.
This image was deleted by MailChimp when they shut down TinyLetter.
Thanks for your ongoing support of everything Excamera Labs. To celebrate I've set up a 10% off coupon code for this week (until Friday at midnight). Use code NWSLTR at checkout to get 10% off everything right here. Thanks again!]
 



At home, we have about 30 hens who sleep in a rather nice henhouse at the back of the yard. It now has a solar panel to supply lights, and I've had a to-do for a while now to put in some sort of monitoring to keep an eye on the state of the battery through the winter.

After a couple of attempts using wifi modules (not stable enough) I decided to try these Lora modules to make a sensor network. They worked great. You can try them out using a couple of USB-serial adapters on the desktop:

This image was deleted by MailChimp when they shut down TinyLetter.
There's a clear summary of the command-set here; it's straightforward to send and receive packets using good old AT commands.

(One annoying quirk of these modules is that the command-line has a timeout. Unless you send the entire AT command within about 1 second, it rejects it. This is not a problem for an MCU, obviously, but for terminal-based experimenting I ended up pasting the AT command lines from another window.)

"Deployment" is a grandiose word for what's in the henhouse right now. It's a RPi Pico 2040 module (just $4 from Adafruit!) with the other Lora module and an Electric Dollar Store I2C temperature sensor.

This image was deleted by MailChimp when they shut down TinyLetter.
Every ten seconds the RP2040 wakes up, reads the temperature, and sends a JSON status string back to the other Lora module. This morning it is reporting about 25C in the coop:
 
{"seq": 81875, "temp": 24.88, "uptime": 848000003478}
{"seq": 81876, "temp": 24.88, "uptime": 848010361474}
{"seq": 81877, "temp": 25.00, "uptime": 848020719466}
{"seq": 81878, "temp": 24.88, "uptime": 848031077459}
{"seq": 81879, "temp": 24.88, "uptime": 848041435454}

The RPi Pico sensing loop code is in plain C, using their SDK. It was quite easy to use, and the whole system has been very solid, no problems at all, despite being made of jumper cables.

The next step is to make a custom board that includes a battery voltage sensor, plus I have a clever scheme to detect whether the henhouse door is open. More in later weeks.

Thanks for reading.