Serial Temperature Sensor

 

 The task was to devise a way to read the temperature from a LM35 Temperature Sensor to a computers serial port for integration with LabView.


The hardware used was:

  • LM35 Temperature Sensor
  • Atmel ATMega8L Microcontroller
  • MAX232 Level Shifter
  • PC with Serial Port.

Using this hardware and a breadboard a prototype was developed for the initial testing.

LM35

The LM35 Temperature sensor was used for its simplicity, this particular temperature sensor is extremely easy to use. There are only three pins VCC, GND and OUT. The temperature is represented by 10mV/degree Celsius on the Output pin. This made it very easy to read the temperature on the ATMega8L with the ADC.

ATMega8L

 There is no real reason for choosing the ATMega8L for this project, it just happened to be the closest microcontroller when we started experimenting. The ATMega8L was suitable because of the USART interface and the 10bit ADC. In the future this may be downgraded to save costs.

MAX232

The MAX232 (or equivalent) was needed as problems were faced with the signal levels from the ATMega8L were too low. This was only discovered later in the experimentation. The MAX232 was used to output the correct voltages for serial communications. The MAX232 was replaced with its cheaper alternative the ST232 which performs the exactly the same as the MAX232 but is 1/3 of the price.

Problems Faced

This project presented a few problems as none of us undertaking the task had ever used serial communications. The first major problem was the cable made for transferring the data from the microcontroller to the PC was made incorrectly with the RX and TX pins reversed.

The second major hurdle to overcome was the signal level was only from 0-5V where serial communications is from -12-12V this is the reasoning behind enlisting the MAX/ST232 level shifter.

Limitations

As there is no flow control used there can be data loss but as this is only intended to be used for real time temperature measurements this is not really a big issue.

The microcontroller development board used only has a fixed 5v AVREF which means there the resolution of the temperature is limited.

Possible Upgrades

The microcontroller used has several more ADC pins which would allow for multiple temperature sensors to be used this could provide an average temperature measurement.

The analogue voltage referenace could be change to 3v this would limit the overall operating range but would increase the resolution of the readings.

Replacing the MAX/ST232 with a FT232RL Serial to USB interface so the sensor is more portable between computers.

A custom made PCB using surface mount components to reduce the size and make the sensor more portable and accessible.

Circuit and PCB

The original circuit was done using a breadboard and my ATMega8 Development board, however since the original design i have done a full scehmatic can be seen below:

The PCB design is due to be finished soon.

Acknowledgments

This project was completed with Brendan Spiniello

Comments are closed.

created By ooyes.net