Miniature Temperature Logger
2016-06-10 | By Alex Iannuzzi
License: General Public License
Abstract Overview
This is an abstract only. For full project details, see Building the Mini Temp Logger Part 1: Re-design of the SATVL/A25TTL into another product.
I redesigned my SATVL and A25TTL temperature loggers into a single logger/reader device. This is based on an ATtiny841 microcontroller with a proper SMD battery holder, TMP102 temperature sensor, an Mbit EEPROM and possibly an RTC.
TMP102 has 1.4 to 3.6V supply voltage, which means I’ll need to use a 3.3V LDO or similar when connecting up to the USB. With 3.3V to the microcontroller I’m limited to 12 MHz, which is enough to run V-USB library.
Voltage-switching circuit
I’ll be using all SMD parts, an SOT23 LDO (Ritek RT9166) and a small 12MHz crystal to keep the PCB as small as possible. The MCU will still be using the watchdog timer with 10% accuracy. I’ll place the battery holder on the back and TMP102 on the bottom, without the ground plane near it to reduce any effect it might have on the temperature reading. I was able to reduce the circuit to 3 components (MOSFET, diode, and resistor). The P MOSFET only turns off when the 5V USB is connected.
Detecting USB
To detect whether the USB is plugged in, I can hook up a pin on the LDO’s output. If that reading is low, I know that the USB has been disconnected. Once it’s disconnected, it will simply sleep until the battery is removed and reconnected. Otherwise the logging will begin again – I might think about adding a small tactile button for this, but it will need more space.
Delay time transfer
I have the thermistor function at the PC side. This really helps to save flash memory as I didn’t have to pre-calculate any variables.
EEPROM writing method
I stored the logged data in SRAM, then rewrote 128-bytes page every 32 bytes (so 4 writes per page, 250K times) until it was filled just in case something goes wrong. This way, if the battery is disconnected when logging I won’t lose all 128 bytes waiting to be written. This will also require a button so I can indicate when the logging is finished and then write the final data to the page. By storing the data in SRAM and only writing to the EEPROM every now and then, I will be able to increase battery life quite a bit.
Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.
Visit TechForum