Wednesday 28 October 2020

LoRat Rat Trap Monitor - Weather proofing, battery life and software updates

 After leaving a couple of the rat trap monitors in place for a few months it soon became apparent that weatherproofing was going to be an issue. In fact, I've learned a lot about how to have electronics outside, how to maximise battery life and how to iterate on a product design.

The major issue was weather-proofing. My original idea was to use repurposed "Eclipse" mint tins. These are about the correct size to hold the PCB and have a handy hinged lid that by eye at least seems to seal quite well. Unfortunately, it soon became apparent that "quite well" is not good enough. Although the LoRat devices are in tunnel-like rat trap boxes, the ends of these are open and the LoRat and it's antenna needs to be near the open end of the tunnel. After a few months of sitting out in the garden, each of the prototypes had become unserviceable and signs of water corrosion were visible on the LoRa module.

Although there is no shortage of "true" ingress-protected enclosures, such as these gasket sealed ABS boxes from Jaycar, these are fairly expensive and would cost as much again as the rest of the parts. Instead, I decided to go with these simple Sistema food storage boxes. These have room for the PCB and for a 9V battery and I've been using a simple rubber gasket to seal the opening required for the antenna and one of these waterproof toggle switches for power.  The box is attached with a short length of aluminium angle that is screwed onto the trap. Originally I tried epoxying the food storage box to the aluminium but this was difficult to get good adhesion, even after roughening the surface of the plastic. After lifting up the trap by the box and a few times the trap was set off, I found the plastic box would detach. I'm now using some M3 bolts and washers and these seem to be able to be tightened enough to keep it secure and protect against water. Finally I've been using a small packet of self-indicating silica gel in the box as a "last resort" defence against moisture.





The move to using a 9V battery, however, bought its own challenges. Even with the Arduino Mini in low-power mode and the indicator LED removed, a 9V battery only lasted six weeks.  That's starting to get a bit expensive and wasteful. The big problem is the low capacity of a 9V (400-500 mAh) and the fact that the Arduino Mini has a relatively inefficient voltage regulator on the board. This hardly matters for most applications but in this situation where the microprocessor is in low-power mode it becomes quite significant. My solution has been to make an additional small PCB with a separate low-dropout regulator with a very low quinesent current.  The MCP1703A has a 2.0 µA quiescent current. 




As usual the design files are available on GitHub. With this regulator connected directly to the VCC input of the Arduino clone, the current draw is such to give about 6 months running on a single 9V. That's about the same as a smoke detector so should be OK. Later versions of the main PCB will have this voltage regulator on it directly.

While I was at it I made a few changes to improve the robustness and usability on the software side as well. The code for the receiver, an ESP9226 Wemos D1 Mini, now just forwards the data over Wifi to my weather station server running on a Raspberry Pi. This is a more robust solution as the Pi can send out the notification emails and store the data in the same SQL database used for the weather station data so I have a record of it. I also slightly modified the firmware for the sensor itself so that it now blinks an LED for 15 seconds before sending the "caught" signal - this allows it to be switched off when moving it to rebait or for other maintenance without sending a false positive signal. 

After nearly four months of use I'm finding that all five traps I have in the local neighborhood are operating will and seem to have had little damage from the elements. While it's true that there haven't been a lot of rats trapped, other forms of monitoring (chew cards, a trail camera) have not shown many rats either. However back in August I caught four rats in just over a week on one trap:

17 August 2020 04:03:13CASH03
16 August 2020 16:09:28CASH02
13 August 2020 20:24:31CASH03
13 August 2020 20:23:51CASH03
12 August 2020 23:50:14CASH03
09 August 2020 20:02:17CASH03


Given that I normally check the traps once a week that's a significant win and perhaps was a family of invaders who have not managed to get established. Note that one trap was triggered twice within 30 seconds, suggesting there was not an immediate kill but that's rare and there was no sign of serious struggle when I examined the trap. 



A Proton Precession Magnetometer - Part 1: Overview and Polarisation Coil

 A Proton Precession Magnetometer - Part 1: Overview and Polarisation Coil For some time now I've wanted to add a magnetometer to my wea...