- A microcontroller
- A temperature sensor (duh)
- Somewhere to record the data
- A real time clock for data timestamps
- A second, "reference" temperature sensor
The Microcontroller
For the microcontroller I'm planning to use an MSP430 chip included with the TI launchpad product. Now the more obvious choice may have been to use an Arduino for this and I don't disagree that that would be a fine choice but for me I wanted something a little smaller, lower power, and super cheap. Plus I somehow feel more accomplished when I code a MSP430 partly because of the extra challenge of doing something perhaps no one else has done.
The Temperature Sensor
For the main temperature sensor my plan is to use the sensor on the MSP430G2231 chip (included with the TI Launchpad
The Data Logger
For the data logger I've ordered the OpenLog product from SparkFun. There are probably cheaper devices out there but I just wanted something that worked out of the box (I know this is exactly opposite of my logic for choosing the MSP430 but just go with it, ok?). The nice part of this device is that is writes to a microSD card so I don't need to worry about a data dump interface.
The Real Time Clock (RTC) ... And the second temperature sensor
For the real time clock I also turned to SparkFun and ordered the DeadOn RTC. My logic for this device is pretty much the same as it was for choosing the data logger. It is kind of expensive in the scheme of things but it should work out of the box. Plus I have never coded a SPI interface and would like to learn how to do that. The other huge benefit of this RTC is it has an onboard temperature sensor for calibrating the crystal time accuracy. This has two major advantages for this project: 1) the expectation is that the logger will be operating in a high temperature environment and 2) the temperature reading is available over the interface (I think)! This means that I get my second reference temperature sensor for "free" with the RTC. Sweet, right?
By the way, the second sensor is intended to log temperature at a different location to give an indication of how well the insulating device is actually working. If the logger simply shows that the temperature peaked at 90 degrees F it would be good to know if the external temperature was actually higher than that (e.g. it actually worked).
The Plan
With the parts on order I've given some though to the way I want this thing to work. I've come up with a few guiding design constraints:
- Battery Powered
- Low power (to last a long time on batteries)
- Turn off without losing RTC
- Provide an external serial interface for setting the clock and debugging
- As cheap as possible
- Update at least once a minute
The parts I've chosen should support 1-3; the MSP430 is very low powered and should run fine off of a couple AA batteries. The RTC has an onboard battery backup to preserve time. Items 4-6 will be supported by my HW and SW design going forward.
My thought for the main loop is something like this:
- Sleep for ~60 seconds
- Wake up
- Read the time from the RTC
- Read the temperature from the RTC
- Read the onboard temperature
- Write the values to the data logger
- Go back to 1.
The real challenge now is to think of how to do this on the relatively simple MSP430 chip. One of the main challenges is that it does not provide an onboard UART and thus all my serial connections will be done with regular DIO pins and bit banging. There are some provisions for SPI but that will also be a bit of a challenge since I've never done an SPI interface. THE MSP430G2231 does provide 10 GPI pins so I think I have enough for the SPI, Chip to Logger, and Chip to Debug serial interfaces. Maybe enven one or two left over for a blinken light :)
My first step in this plan is to start coding the bit banged, full duplex command and debug serial interface. This interface will be used to monitor what is going on as well as to set the RTC. Should be fun ...