This week, I am going to talk about the basics of the software we wrote for this project. I’m also going to talk a little bit about the case and batteries used for the logger. I chose the PIC18LF14K50 8-bit MCU because of its extremely lower power usage and its USB capabilities, all stuffed into a 20-pin package. Luckily, 20 pins were all I needed for the logger.
The Logger Board
Using the MCHPFSUSB Framework (which is free), I was able to quickly get a simple program running that talked to my PC and output a nice menu system. (You can access this menu using any terminal software.) When you access this menu, you can see live data from individual sensors and live group sensor data, dump all of the logged data on the EEPROM, and erase the EEPROM. When the device is plugged in, it will auto detect that a USB connection is present and switch to a faster operating speed (48 MHz). When USB is disconnected, the device returns to a slower operating speed (12 MHz) to save power.
The EEPROM uses I2C™ to communicate with the PIC® MCU. The GPS receiver uses a UART to communicate with the MCU. We take in the raw NMEA code and parse out the information we want to keep. Then, we add the pressure data and temperate data to the string, including the sensor ADC counts, and save it all to the EEPROM. There is also a 32.768 kHz crystal, which acts as our time keeper. This crystal allows us to wake up once a minute to collect sensor data, and once every hour to collect GPS data.
To keep the unit running in the extremely cold temperatures of Mt. Kilimanjaro, I found the L91 Ultimate Lithium AA batteries from Energizer had very good performance. They are rated down to -40 degrees Celsius and, at 0 degrees Celsius, have more than twice the capacity of a traditional alkaline (when discharging at 50 mW).
The case I chose is big enough to hold two AA batteries and a circuit board (~2" x 3"), but is small enough to fit in the palm of your hand. And, it only weighs 3.2 oz (91 grams), which is roughly the same weight as four standard alkaline AAs.
The Final Product
By using just a few of the PIC18LF14K50s on-chip ADCs, a UART and an I2C pin, you too can build a simple logging device!
is an Electrical Engineering Intern with Microchip Technology Inc. He specializes in rapid prototyping, dealing with everything from board assembly to additive manufacturing. Tim is currently studying Electrical Engineering at Chandler/Gilbert Community College.