PIC16F688 Based Digital Voltmeter with a PIC mictocontroller

Not rated 32,008

PIC16F688 Based Digital Voltmeter with a PIC mictocontroller
PIC16F688 Based Digital Voltmeter with a PIC mictocontroller

This project details the construction of a digital voltmeter utilizing a PIC microcontroller. A character-based HD44780 LCD display is employed to visualize voltage measurements. The microcontroller selected for this project is the PIC16F688, which features 12 I/O pins, with 8 of these capable of serving as analog input channels for the integrated 10-bit ADC. The voltage to be measured is directed to one of the eight analog channels. The reference voltage for the analog-to-digital conversion is set to the supply voltage Vdd (+5 V). A resistor divider network is implemented to map the input voltage range to the ADC input voltage range (0-5 V). This technique allows for the measurement of input voltages from 0 to 20 V, with potential for expansion through appropriate resistor selection as described below. Given that the PIC port cannot directly handle a 20 V input, the input voltage is scaled down using a simple resistor divider network. Resistors R1 and R2 adjust the input voltage range from 0-20 V to 0-5 V before being fed into the PIC16F688's analog input channel AN2. A 5.1 V zener diode is connected in parallel between the AN2 pin and ground to protect the PIC pin from accidental input voltages exceeding 20 V. The LCD is operated in 4-bit mode, and the inclusion of an ICSP header facilitates firmware development, allowing for reprogramming and testing of the PIC while in operation. Once the circuit is finalized, transferring the design from a test card to a PCB or prototyping board does not require the ICSP header.

The digital voltmeter circuit utilizes the PIC16F688 microcontroller, which is well-suited for this application due to its integrated ADC capabilities and sufficient I/O pins for interfacing with the LCD display. The HD44780 LCD is commonly used for displaying alphanumeric characters, making it ideal for showing voltage readings in a user-friendly format.

The resistor divider network, composed of resistors R1 and R2, plays a crucial role in scaling down the input voltage. The values of these resistors must be carefully calculated to ensure that the maximum voltage of 20 V is reduced to a safe level of 5 V for the ADC. The formula for the voltage divider is given by:

V_out = V_in * (R2 / (R1 + R2))

Where V_out is the voltage across R2 (input to the ADC), and V_in is the input voltage (up to 20 V). Choosing appropriate resistor values will ensure that the input voltage remains within the acceptable range for the microcontroller.

The zener diode serves as an essential protective component, safeguarding the microcontroller from overvoltage conditions. If an input voltage exceeds the specified limit, the diode will conduct and clamp the voltage to a safe level, thus preventing damage to the PIC16F688.

The firmware for the PIC microcontroller will need to be developed to read the ADC values and convert these readings into a voltage display format suitable for the LCD. The 4-bit mode of the LCD will reduce the number of I/O pins required for communication, allowing for efficient use of the available pins on the microcontroller.

In summary, this digital voltmeter project combines a PIC microcontroller with an LCD display and a resistor divider network to measure and display voltages up to 20 V safely and effectively. The design emphasizes the importance of component selection and protective measures to ensure reliable and accurate voltage measurements.This project describes how to make a digital voltmeter with a PIC microcontroller. A character based on HD44780 LCD display is used to measure voltage. The PIC microcontroller used in this project is PIC16F688, which has 12 I / O pins of which 8 can be used as analog input channels to the built-in 10-bit ADC. The measured voltage is fed to one of eight analog channels. The reference voltage for the AD conversion is chosen to be the supply voltage Vdd (+5 V). A resistor divider network is used to end the inning with a map of the range of input voltage range of ADC input voltage (0-5 V). The technique can show that the input voltage from 0 to 20 V, but can be expanded with an appropriate choice of resistance and make the calculation described below.

Since the PIC port can not be directly 20V input, the input voltage is reduced by using a resistor divider network simple. The resistors R1 and input voltage range R2-range of 0-20V to 0-5V, before being implemented in PIC16F688 channel analog input AN2.

5. 1V zener diode connected in parallel between the port pin AN2 and earth provides protection to the PIC pin input voltage is accidentally beyond 20V. The LCD screen is connected to the 4-bit mode, and the head of CPSI makes firmware development easier than you can reprogram and test the PIC while it is on.

When you`re happy and you want to transfer the circuit of the test card to a PCB or prototyping board for general purposes, it is not necessary ICSP header. 🔗 External reference