RS232 Temperature Data Logger

 
 

Sometimes it is more convenient to have a data logger that communicates over a serial port, this enables the sensor to be located further away from the computer and also used on any operating system that has ja terminal window to what the sensor is reading.


In this project a PIC16F628A is used to read an LM75 Temperature sensor every 30 seconds and send the temperature through an RS232 level translator to a DB9 connector
























Power is supplied via J2, and fed through the reverse protection diode D2 to the Linear Regulator the ADP122 which generates a 3.3V supply that powers the processor and ADM3202 RS232 level converter chip, this is connected to a DB9 connector.


The temperature is read from the LM75 via I2C bus on SDA and SCL into the PIC where it is converted into an ASCII stream and transmitted at 1200 Baud 8N1, this can be read by a terminal in this example I have used hyperterminal. 


The Bill of materials for this project is


QTY  PART-REFS           VALUE              

---  ---------           -----              

Resistors

---------

4    R1-R4               10k                


Capacitors

----------

5    C1-C5               100nF              

2    C6,C7               47pF               

2    C8,C9               10u                


Integrated Circuits

-------------------

1    U1                  ADM3202            

1    U2                  PIC16F628A           

1    U3                  ADP122             

1    U4                  ADT75                     


Diodes

------

1    D1                  DIODE-LED          

1    D2                  1N4004             


Miscellaneous

-------------

1    J1                  CONN-D9F           

1    J2                  TBLOCK-I2          

1    X1                  1.8432MHz CRYSTAL  




The code is written in C and compiled using XC8, it can be downloaded RS232 LM75.c


The code I would term as functional not elegant... There is a small thing with XC8 that I found that in the I2C routine, I needed to write the outputs after the tristate something that didn’t need to happen in older hi-tech compilers.







 

RS232 Temperature Logger