USB temperature logger using minimal components

This PIC16F1455-based USB temperature logger is one of the simplest designs I have ever seen and uses only 2-components, the PIC microcontroller itself and an USB connector. It uses PIC’s internal temperature indicator module for sensing the ambient temperature.

Simplest USB temperature logger

Simplest USB temperature logger

The PIC16F1455 is a relatively new microcontroller that can do USB without an external crystal. It also has internal pull-up resistors for the USB data lines. These things mean no extra hardware is necessary for USB communication.

I needed something useful to send over USB and I noticed that the PIC16F1455 has a Temperature Indicator Module. This peripheral will let you read the operating temperature of the silicon die over the ADC. It’s not terribly accurate, but the silicon die temperature will be about equal to the outside temperature.

I carefully soldered a male USB Type A connector to the PIC16F1455’s Vdd, Vss, D+, and D- pins. Then, using the M-Stack USB Stack from Signal 11, I wrote a program to enumerate the PIC16F1455 as a USB CDC serial device and send the temperature in ADC counts as an ASCII string at 1 Hz.

From the computer side, it’s easy to connect to the USB temperature data logger like any other serial device, parse the incoming strings, and save the data to a file with a timestamp.

The last step is to map the ADC counts to a temperature scale. Microchip has an application note AN1333 with some equations. However, for a constant Vdd, the scale is pretty linear so it’s easiest to record the ADC count at two known temperatures and interpolate between them.

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *