Close

A More Complex Example: Cat Logging

A project log for LP Mini - Low Power Dev Board

Inexpensive, Arduino Compatible Low Power Dev Board

maxkMax.K 01/05/2017 at 21:470 Comments

After building a simple SD card logger I wanted to go for something more advanced. And this is not just because I needed another example for programming the LP mini. The actual purpose I built this board for, is this:

Our cat is usually an outdoor cat. He has his own little house in our garden, where he sleeps (except for cold winter days when it's freezing outside). During winter we wanted to know how much time he spends in his house and how warm it is in there.

The first thing I built last winter was an SD card temperature logger based on a regular Arduino Nano. As there is no access to a power outlet the Arduino has to be battery powered. While it worked, the lousy battery life of only hours was a problem. Having to take the SD card out of the cat's house to check the data was really inconvent.


Hardware

To fix these problems I needed a low power Arduino board, which is why the LP mini was made. As a sensor I am using the Dallas ds18b20. It is small, cheap and takes up only one pin. A rf24 module (nRF24L01) is used to transmit the data inside the house. The whole device is then powered by three AA batteries (4.5 V), which is converted to 3.3 V by the internal regulator.

The base station doesn't have to rely on batteries, as it is inside the house. I decided to use an ESP8266 with the rf24 to upload the temperature data to the internet. This way there is no need for the device itself to store or display any data.

Wiring:


Software

To minimize power consumption, the Atmega sleeps most of the time. Once every five minutes the RTC wakes up the microcontroller to measure the temperature and to send data to the base station. While the Atmega is at sleep, the temperature sensor is turned off entirely using the mosfet-pin (D10). The rf24 module is connected to VCC and has its own sleep mode that can be utilized. With an overall power consumption of 4.2 µA in sleep mode the batteries should last for months.

Programming the base station is quite simple after figuring out how to connect the ESP to the rf24 module. As there is no need to save power, the ESP can be listening continuously. Once it receives a temperature value, it uploads it directly to Adafruit.io.

The code for both devices is available as an example in the LP mini library on Github:

https://github.com/CoretechR/lpmini

The devices have been working quite nicely for the past few days. You can see the data feed on Adafruit.io here:

https://io.adafruit.com/MaxMKA/dashboards/cat-a-log

Discussions