Designing a simple and cheap temperature logger. Part 1

[I’m writing about this project at the same time I’m working on it. It’s not finished yet, so please forgive the errors I could make (and don’t hesitate to slap them on my face)]

Some time ago, I was looking for a temperature logger. After checking what was available on the market and the prices, I decided to make one myself.


  • Battery powered
  • USB
  • No docking station
  • Configurable period of acquisition
  • Time stamped temperature
  • Cheap
  • At least 30 000 temperature acquisitions

Ideally, it would be USB key shaped. The presence of a battery and no docking station limit the temperature range to the battery maximum temperature specifications (-20°C -> 70°C).

As I didn’t find any easily available rechargeable battery that could fit into a USB stick enclosure, I decided to use a coin cell battery, CR2030 type. It’s 3V, 200mAh and should last enough to log the number of temperature measurements in the spec.

The temperature sensor would be a cheap serial one (they usually have a good precision). The memory, serial, cheap and big enough. Once plugged into an USB port, the logger would be seen as a USB key with two files. One with the temperature measurements and the other, user editable, with the configuration of the delay between every temperature acquisition. The acquisition will be started by a push on a microswitch.

To reduce the costs and size, the microcontroller should be able to manage the memory, the temperature sensor, the USB communication and have a real time clock.

Selected components:

  • Temp sensor: Texas Instr. TMP102AIDRLT
  • Microcontroller: PIC18F26J50
  • Memory: Atmel, AT25DF081-SSHN-B

The temperature sensor is 0,5°C accurate and takes from 1.4V to 3.6V for power supply with a 10µA current (1µA in sleep mode).

The memory has needs a supply power form 1.65V to 1.95V, 12mA write current and 8µA deep sleep mode current.

For the PIC, it’s 2.15V minimum for an average current of a few mA when running and a few µA in sleep mode (or nA in deep sleep mode)

Then, we need a voltage regulator for the PIC and temperature sensor (3.3V, when in USB mode) and an other one for the memory (1.8V).

When not plugged in a USB port, the coin cell powers directly the PIC and sensor but the memory is powered by its own regulator.

USB Temperature Logger Diagram

The power supply voltage can drop as low as 2,15 V (PIC’s minimum). With a new coin cell and a 0,35V Schottky diode (to prevent the USB current flowing back to the battery) the logger will stop working once the battery reaches 2,5V. This 0,5V margin may appear  small, but the battery’s standard discharge curve in the datasheet shows a fast drop in the remaining capacity, around 2,5V:

Coin Cell Discharge Curve 12k

It’s even more obvious with a lower current draw:

Coin Cell Discharge Curve 60k

After 2,5V, the remaining capacity can be as low as 10% of the initial capacity for high current discharge and even a lower percentage with a lower discharge current.

To be continued…

Part two is here

USB Temperature Logger 3D View

16 thoughts on “Designing a simple and cheap temperature logger. Part 1

  1. Pingback: Designing a simple and cheap temperature logger « adafruit industries blog

  2. Love it.. I’ve been working on one using an Atemga8U2. I haven’t been planning on internal storage or battery backup though. Isn’t crazy that something so simple is so expensive to buy?

  3. 🙂
    I forgot to put “no drivers or program needed” in my specs. I’ll calculate the costs in the next article. If you only take the components in account, yes, it’s very cheap. Unfortunately, you have to add R&D, fabrication, shipping, packaging, distribution, FCC.. So at the end, it costs way more than just the components price.
    Still, I was surprised to not be able to find something cheap and simple. But maybe I’ll realise it’s not as simple as I thought once I’ll start the firmware and the electrical tests.

  4. FYI, a friend who manufactured electronic products once told me that to make a nominal profit, you must retail at 6 times the manufacturing cost.

  5. A question occurs: Have you been able to estimate at what point in the battery’s life it can still supply the 12ma memory write current?

    I am currently designing a temperature logger and I’m going with 2xAA batts for power to insure good write current from possible old,cold batts. The electronics will have an AA form factor, making the cylindrical shaped logger my app requires.

    • Yes, the 12mA write current could be a problem. The datasheet says it takes 15us to write a single byte. Each measurement would be ≈20 bytes, which makes 300us. So far, I have no idea of the battery voltage drop. The 1,8V regulator performances have to be taken into account, plus the fact that it’s 12mA@1,8V. Adding a big capacitor could help.
      I guess the ultimate way to know, will be to measure it once I receive and populate the PCB.
      So far, the only battery-powered product I designed was using 9V accu, with 3,3V electronics, so I had a way better power margin.
      Once I’ll measure the voltages and currents, I’ll be able to configure and use one of the PIC’s A/D channels to monitor the battery voltage and make the LED blink when it reaches the low point. (at least, that’s what I imagined)
      As for the temperature and battery, the datasheet shows quite a good response, good enough for this application. Once again, there’s sometimes a whole world between datasheets and reality, so I’ll have to run tests and measure things.

      I’m still thinking about using a Li-Ion battery. I saw some small and cheap ones, but adding a charging circuit could increase the costs (and/or safety problems)

      As for the costs, I of course forgot to mention the profit margin. I think your x6 number really depends on which technology your product is based on, the complexity, the yield in production, the regulations it’ll have to pass through, the safety level… But I doesn’t surprise me (even if I newer worked on production-aimed products, or not yet)
      So yes, the price of a product isn’t just the price of the components (you can see that for example with the iSupply calculations for Apple stuff, even with their 30% -or bigger- margin).

  6. My Backwoods Logger Classic is still running on its original CR2032 coin cell battery, after 6 months. I don’t use any voltage regulator, so the battery voltage is connected directly to the microcontroller and temperature/pressure sensor. When it’s sleeping between measurements, the current draw is about 10 microamps. I don’t know much about PICs, but I assume they would be capable of a similarly low sleep current. The Backwoods Logger Mini uses a higher-current drain OLED display, and goes about four months on a single AAA battery, using a DC step-up converter. My guess is that 2xAA would be overkill for a temperature logger that doesn’t have any LCD or other display.

    For pricing, I use Adafruit’s rule of thumb, which is a 1.6x markup from parts cost to the wholesale price (the price if sell a bunch of them to a store), and another 1.6x markup from wholesale to retail, so about 2.5x overall. That’s for open source hardware type products in the $5 to $100 range or so.

  7. You don’t say what your absolute price point is but I am assuming you ruled out the iButton thermocrons on that basis? At about $15 they’re a damned sight more than your TI temp sensor but you’d get a wider sensing range and wouldn’t need to worry about storage and power anymore.

    Probably not much fun as a project then, though. At that point you’d just be creating something that translated the 1wire protocol and pretended to be a storage device. However I’d probably buy a reasonably priced device that let me just edit the polling period in a simple file and allowed me to just open a CSV of the recorded temperatures…

    • Yes, I checked the iButtons before writing about my temperature logger project. They are a very good solution and as you said, they have a better temperature range. But you have to buy the reader to extract data from them, which adds to the costs (especially if you only need one iButton). And the $15 is the price for 1000 units. I saw prices closer to $100 for a starter kit, or $50 for an iButton with the reader. Plus, the cheapest iButtons have “only” 2048 temperature point. (Although I don’t know yet exactly how many points my battery will last, even if I have a 8Mb memory).
      As you said, having something simple (in my case, a USB stick) letting you get a CSV file with all the recordings would be cool.

  8. Pingback: Blog » Blog Archive » Designing a simple and cheap temperature logger

  9. CC2511Fx by Texas Instrument has a built-in temperature sensor and radio and USB interface and designed to sleep and consume the least amount of power great for logging and I temperature I think.

  10. Pingback: Nerd News » Blog Archive » Разработка дешевого логгера температуры

  11. Pingback: Standalone USB temperature logger - Hack a Day

  12. have you considered something like “TS5205
    150mA Low Noise LDO Voltage Regulator
    with Enable Function” as a voltage regulator for flash? they have very low turn off current. even lower than powered down flash.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s