Advertisement

PIC 16F88 Digital Thermometer Light Meter and resistance ohm meter

Not rated 5,987

#PIC 16F88 #digital thermometer #light meter #resistance meter #ADC #LCD display #WINTEK WD-C2401P #microcontroller #sensor interface #measurement
PIC 16F88 Digital Thermometer Light Meter and resistance ohm meter
PIC 16F88 Digital Thermometer Light Meter and resistance ohm meter

Description: The initial concept for this project involves interfacing the WINTEK WD-C2401P LCD panel with a PIC microcontroller. The intention is to incorporate several ADC readings to provide useful information on the LCD. PORTB on the PIC serves as the data port for the LCD, while the Enable, Register Select, and Reset pins are connected to PORTA. Once the LCD is initialized, the PIC reads ADC values from a thermistor, a CDS cell, and a resistor (if connected) through a voltage divider. This voltage divider converts variations in sensor resistance into corresponding voltage changes. The output voltage (Vout) is calculated using the formula Vout = Vdd * (R2 / (R2 + R1)), where R1 is the sensor's resistance. Any change in R1 results in a change in output voltage. The PIC, equipped with a 10-bit ADC resolution, has 1024 possible steps. If the microcontroller operates at 5V, each step corresponds to an increment of 5/1024 = 0.004882813V. The ADC value can be determined by dividing the input voltage by 0.004882813, allowing for precise calculations of sensor resistance. To convert this resistance into a human-readable format, calibration with real-world instruments is necessary to extrapolate the values. Additionally, since the display lacks a backlight, an LED is connected to PORTA4 to activate when ambient light falls below a specific threshold.

The circuit design involves several key components and connections to achieve the intended functionality. The WINTEK WD-C2401P LCD panel is interfaced with the PIC microcontroller, which is responsible for controlling the display and processing sensor data. The LCD requires proper initialization, which involves sending specific commands to set up the display parameters. The data lines connected to PORTB allow for the transmission of characters and commands to the LCD, while PORTA manages control signals such as Enable, Register Select, and Reset.

ADC readings are taken from the thermistor and CDS cell, which are connected through a voltage divider configuration. The voltage divider consists of two resistors, R1 (the sensor) and R2 (a fixed resistor), which together determine the output voltage based on the resistance of R1. This output voltage is fed into the ADC input of the PIC microcontroller, where it is digitized for further processing. The 10-bit ADC allows for a detailed resolution of the analog input, enabling accurate readings of the sensor outputs.

Calibration of the sensors is crucial for ensuring that the displayed values are meaningful and accurate. This involves comparing the ADC readings against known values obtained from calibrated instruments, allowing for the development of a calibration curve or formula that correlates ADC values to actual resistance measurements.

The inclusion of an LED connected to PORTA4 serves as a visual indicator of ambient light levels. When the light level drops below a predetermined threshold, the LED illuminates, providing a simple yet effective feedback mechanism for users.

Overall, this project combines display technology with sensor interfacing and analog-to-digital conversion to create a versatile system capable of presenting real-time environmental data on an LCD panel.My original idea for this project was simply to try and interface the WINTEK WD-C2401P lcd panel to the pic (see my previous post). I figured it would be fun to add a couple of ADC readings to display something useful on the lcd. PORTB on the PIC is used as the data port for the LCD. The Enable, Register Select and Reset are tied to PORTA. Once th e LCD is initialized, the PIC reads the ADC values from the thermistor, CDS cell and resistor (if connected) via a voltage divider. The voltage divider translates any change in resistance from the sensors into changes in voltage. The Vout is calculated as Vdd*(R2/R2+R1). ) So any change in R1 (the sensor`s resistance) will result in a change in the output voltage. In order to translate this into the ADC value, a 10 bit ADC resolution microcontroller will have 1024 (2 to the power of 10) possible steps.

So if the controller is operating on 5V then each step will increment the voltage by 5/1024 =0. 004882813V every increment. So the value in the ADC will be the voltage input at the ADC divided by 0. 004882813. This allows for an accurate calculation of the resistance of the sensor. In order to translate the resistance to useful human readable form, its necessary to calibrate the sensors using real life instruments and extrapolating the values to the resistance offered. Since the display does not have any backlight, an LED is connected to PORTA4 to turn on whenever the light falls below a certain threshold.


Related Circuits