Portable Temperature Logger
Portable Temperature Logger
Sometimes you want to measure things whilst away from your computer, the circuit described here is a portable data logger than measures temperature from an LM75 temperature sensor every 30 seconds and stores them in a local EEPROM.
Up to 32000 readings can be taken or over 11 days worth of data at a 30 second sample rate. Communications to the Data Logger is via a terminal program such as Hyper Terminal and an RS232 Port communicating at 1200 Baud 8 bit’s no Parity and 1 stop bit.
Hyperteminal also needs to be set to no hardware shaking. Control of the datalogger is performed by 4 basic ascii control codes and is case sensitive
“b” = Get version number of the datalogger
“s” = Start data logging
“t” = Stop data logging
“r” = Retrieve data from the data logger
An example of the output file can be seen in Cardatalog.csv and is plotted in the graph below this is a data log I took of by leaving the datalogger in the windscreen of the car, I placed it in the car in a late evening in August, initially you can see the temperature remain steady then as night falls slowly decline, in the morning the windscreen was in direct sunlight and the rapid rise in temperature can be seen, the dramatic decline is when I took it out of the car and back into the the house.
The bill of materials for this project is
QTY PART-REFS VALUE
--- --------- -----
Resistors
---------
4 R1,R3-R5 10k
1 R2 220
1 R6 1M (Fit if using ICL7660)
Capacitors
----------
5 C1-C5 100nF
2 C6,C7 47pF
2 C8,C9 10u
3 C10-C12 100u (Fit if using ICL7660)
1 C13 100n
Integrated Circuits
-------------------
1 U1 MAX3223
1 U2 PIC16F628A
1 U3 LM2936
1 U4 LM75
1 U5 24AA256
1 U6 ICL7660
Diodes
------
1 D1 DIODE-LED
1 D2 1N4004
Miscellaneous
-------------
6 J2,J4-J8 CONN-SIL2
1 X1 1.8432 Mhz
1 Serpac A21 enclosure with DB9 cutout panel and battery option
The circuit is based on a PIC16F628A(Note 16C54 on the schematic is a mistake) running at 1.8432 MHz
For RS232 communications the MAX3223 is used in auto shudown mode to conserve power( A previous prototype used the MAX3232 and it drew 2-4mA continuously)
The power supply has 2 options either to power from a low power linear regulator the LM2936 or using a charge pump as a divider, I put both these options on the PCB because I wanted to try out which one would give the longer operating life but to make it work you only need the LDO or the Charge pump fitted.
The PIC waits until it receives a correct ASCII character ‘s’ and then starts logging temperature every 30 seconds, first reading the LM75 and then storing it in EEPROM.
Currently the code transmits this over RS232 every time it takes a reading but this could be disabled to conserve battery life.
If the code ‘r’ is received it dumps the contents of the EEPROM to the terminal program in a a csv format where it can be saved and opened in a spreadsheet to plot the data.
The code is written in c using xc8 and can be downloaded here RS232 Portable Datalogger.c
The datalogger can be read using a raspberry pi with a serial port adaptor either USB ot using AMA0, a python script for downloading the data is available Datalogger.py
The Layout is on a 2 Layer PCB and designed to fit in a serpac A21 enclosure with the optional DB9 end panel cutout and the 9V battery compartment.
Note the U3 orientation shown on the silkscreen is reversed.
Portable Temperature Data Logger