Introduction: Alaska Datalogger

Alaska is on the edge of advancing climate change. Its unique position of having a fairly untouched landscape populated with a variety of coal mine canaries enables a lot of research possibilities. Our friend Monty is an Archaeologist who helps with camps for kids in Native Villages scattered around the He has been building cache sites for the historical preservation of food with these kids and wanted a way of temperature monitoring that he could leave for about 8 months of winter. A food cache in Alaska is designed to prevent Bear entry and can either be buried or secured in a small cabin-like structure on poles. Unfortunately the warming of the climate makes many of these handy refrigerator designs more like a microwave this summer--honestly its really hot up here! There are a lot of commercial datalogging machines out there but Alaska needed its own DIY brand: Waterproof, Two waterproof sensors on long lines that could be within the cache and another to lay on the surface, Something buildable for kids with a STEM program, Minimal maintenance, Long term battery, Easy download from SD card, 3D printable, rechargeable, Real time Clock, and cheap.

The design is totally printable with any 3D printer and I have done the design for the PCB that you can order and populate with easy to obtain components. The battery is generic 18650 that should last a year or so with 12x/day readings and charging is done by just plugging in some power for a day. It is designed(Fusion 360) around the O-ring that is used in house water purifiers so it is easy to obtain and with silicon grease and tightening of the well placed bolts should provide protection for the Alaska winter if it comes this year....

Step 1: Gather Your Supplies

The wonderful designs from Adafruit make up most of the components on the board--they are a little more expensive but they are very workable and dependable. ( I have no financial ties with any company...) I used a Creality CR10 printer for the 3D parts. The two switches are waterproof variety.

1. Vktech 5pcs 2M Waterproof Digital Temperature Temp Sensor Probe DS18b20 $2

2. Adafruit DS3231 Precision RTC Breakout [ADA3013] $14

3. Adafruit TPL5111 Low Power Timer Breakout $5

4. Adafruit Feather 32u4 Adalogger $22 You can also use the MO version but the battery level line is on a different pin and you must change it in the software.

5. IZOKEE 0.96'' I2C IIC 12864 128X64 Pixel OLED $4

6. Rugged Metal On/Off Switch with Blue LED Ring - 16mm Blue On/Off $5

7. Rugged Metal Pushbutton with Blue LED Ring - 16mm Blue Momentary $5

8. A variety of quick connects to make assembly easy

9. 18650 Battery $5

10. Captain O-Ring - Whirlpool WHKF-DWHV, WHKF-DWH & WHKF-DUF Water Filter Replacement

Step 2: Build It

The design of the housing is built around the easily available o-ring from a standard Westinghouse whole house water filter. The ring slips into a silicon lubricated groove between the the two printed halves of the enclosure. The bottom of the enclosure has space for the 18650 battery and the two waterproof control switches--there is also a hole for the exit of the cables for the temp probes. The two files for the upper and lower halves are below.

The bottom section is completed by taking some 4 mm or equivalent size nylon bolts and removing their heads and cementing them into the support pillars that have been drilled to accommodate them. Use an appropriate length so that the nylon cap nuts on the top will just cover them when the two halves are joined. Both upper and lower sections must be printed with support. The upper section is completed by gluing in a round plastic window made from thin lexan.

Step 3: Wire It

The assembly of the PCB is fairly straightforward. I designed the board in Eagle and sent it to PCBway for manufacture--honestly it the cheapest thing ever. If you want to bug-wire it that is easily done just follow the circuit diagram on the Brd file. The small LED screen is attached through the I2C connections on the board along with power and ground. The heart of the system is the TPL5111 which is connected directly to the battery and stays on all the time. It has a selectable timer (variable resistor) that wakes the system up every 2 hours to every second by enabling the enable pin on the Feather module. The RTC communicates by the same I2C bus as the LED--they have different addresses. The Feather is also connected to the 18650 battery by JST cable through the on/off switch to turn all power off to the system. This allows built in charging by the Feather when the battery is low by plugging in a micro USB into the feather. Whenever you upload new software to the Feather you must remember to start the TPL5111 by pushing its button otherwise the Feather will not answer the USB boot call. The pushbutton is designed to provide power to the LED screen only when pushed and also to send a high signal to the TPL5111 that allows the Feather to turn on for as long as you have the button pushed. This is done to limit the amount of time the screen is on -- it is used only to check the status of the temp probes, battery level and time/date and the size file that you are building. The last piece of wiring are the two probes that are placed through the last drill out spot on the lower half. These were connected with JST 3 pin connectors to make removal easier. I neglected to place the 4.7K resistor on the board to connect the Data and Voltage pin on the temp sensor bus. So this must be done on one of the sensor connection points on the board--they are labeled so it should be easy. They both go to the same GPIO pin on the Feather so only one resistor connection is necessary.

Step 4: Program It

The program is very easy to understand. The SD library is for utilizing the SD card file that is built into the feather board. The OneWire and Dallas Temp libraries are for getting the one-wire readings off the temp probes. DonePin is to notify the TPL5111 that all data reading has been completed and it is ok to dis-enable the Featherboard. VBatpin is the pin on the feather that has a voltage divider on it to read the value of the Lipo battery. The Asciiwire library is to run the LED screen. The OneWireBus is GPIO pin 6 in this case. The SD file system for this Datalogger sets up a file ANALOG02.TXT to accumulate all the data. It opens up the same file every time and just adds to it. To get rid of old data you must take the chip out of the SD card holder and download it into a computer--for example into the EXCEll spread sheet. This is easily done with the DATA import section of the spreadsheet. The files are then removed from the chip and when the Feather opens it up again it builds a new one. Next comes the time/date setting for the RTC. //rtc.adjust(DateTime(F(__DATE__), F(__TIME__))); remove the comment characters to set your RTC to your boot time and then reprogram the chip with this line commented out so that the next time the computer boots it doesn't use the same boot time again instead of allowing its battery backed timekeeper to fill it in. The loop( ) section opens the SD file, gets the date/time, read and convert both sensors, calculates the battery level and writes it to the SD card. It then makes the donePin high to shut down the sequence.

Step 5: Using It

The battery is fully charged by plugging the Feather into a MicroUSB plug. The Charge LED will come on until it is fully charged--its slow. A fresh SD card without ANALOG02.TXT is placed in the chip holder. The cover is installed and the five nuts are screwed down against the rubber gasket. The power button is turned on and after about 4 seconds the pushbutton is held in. It will rapidly display first a default temp and after a screen clear it will show T1 and T2 as outputs of the temp probes. You can warm one up with your hand so it can be labeled as T1 and T2. The screen will also display the Hour, Minute, Sec, Day, Month and Year of the reading as well as the battery level and how big your file is at this point. This check is done to make sure everything is running well before leaving it for 8 months. Release the button and place the probes where you want the temp measurements to be done. They are waterproof and so hopefully is your machine. This machines initial outing will be in Iliamna Alaska where it will be underground until next April. On early testing this size battery was found to be good enough for at least 1 1/2 years at 12 readings per day all due to the power marshaling of the TPL5111. Global warming studies are very important for everyone to be involved with--get out and do some science!