How to interface Humidity Sensor with 8051 Microcontroller (AT89C51)
Humidity sensor works on the principle of relative humidity and gives the output in the form of voltage. This analog voltage provides the information about the percentage relative humidity present in the environment.
The relative humidity is defined as:
The analog output of sensor is connected to ADC to get its corresponding digital value. For calibration of digital values, the reference voltage of ADC is set to 1.5 volts. The digital values are received at port P0 of microcontroller. These digital values are used to calculate percentage relative humidity of environment. The calculated data is sent to LCD to display the percentage relative humidity. The connections of ADC0804 and LCD with the 8051 microcontroller (AT89C51) are shown in circuit diagram.
1. Define the input and output port of microcontroller.
2. Initialize LCD.
3. Monitor the value of ADC 0804.
4. Calculate the relative humidity
5. Convert the calculated value in their corresponding ASCII codes.
6. Display the converted value on the LCD.
7. Repeat steps 4 to 7 in an infinite loop.
LCD (Liquid Crystal Display) screen is an electronic display module and find a wide range of applications. A 16x2 LCD display is very basic module and is very commonly used in various devices and circuits. These modules are preferred over seven segments...
Analog to digital converters find huge application as an intermediate device to convert the signals from analog to digital form. These digital signals are used for further processing by the digital processors. Various sensors like temperature, pressure, force etc. convert the physical characteristics into electrical signals that are analog in nature....