Description: This project outlines the construction of a digital voltmeter utilizing a PIC microcontroller. A character LCD based on the HD44780 is employed to display the measured voltage. The PIC microcontroller used is the PIC16F688, which features 12 I/O pins, with 8 of those capable of serving as analog input channels for the integrated 10-bit ADC. The voltage to be measured is supplied to one of the 8 analog channels. The reference voltage for the analog-to-digital conversion is set to the supply voltage, Vdd (+5 V). An input resistor divider network is implemented to scale the range of input voltage to the ADC input voltage range (0-5 V). This technique is demonstrated for input voltages ranging from 0-20 V but can be extended further with appropriate resistor selection and calculations. Since the PIC port cannot directly handle a 20V input, the input voltage is scaled down using a resistor divider network. Resistors R1 and R2 reduce the input voltage from 0-20V to a range of 0-5V before being applied to the PIC16F688's analog input channel, AN2. A 5.1V zener diode is connected in parallel between the AN2 port pin and ground to protect the PIC pin in case the input voltage exceeds 20V. The LCD is connected in 4-bit mode, and the ICSP header facilitates firmware development, allowing reprogramming and testing of the PIC while it remains in the circuit. Once the circuit is finalized and ready for transfer from a breadboard to a PCB or general-purpose prototyping board, the ICSP header is no longer necessary. A regulated +5V supply is crucial for output accuracy, as the ADC uses Vdd as its reference for conversion, with all computations performed at Vdd = 5V. A regulated +5V can be obtained using an LM7805 linear regulator IC. The accuracy of the system is influenced by the precision of the input resistors and the stability of the reference voltage, Vdd = +5V. The measured values for R1 and R2 are 1267 and 3890 Ohms, respectively.
The digital voltmeter circuit leverages the capabilities of the PIC16F688 microcontroller, which integrates an analog-to-digital converter (ADC) that allows for precise voltage measurements. The use of the HD44780 character LCD provides a user-friendly interface for displaying the measured voltage readings. The design incorporates a resistor divider network formed by resistors R1 and R2, which is crucial for scaling the input voltage to a level that the microcontroller can safely handle. The selection of resistor values is pivotal in determining the input voltage range and ensuring that the ADC operates within its specified limits.
In this configuration, the input voltage is fed into the resistor divider, where R1 and R2 work together to reduce the voltage from the maximum of 20V down to a maximum of 5V, making it suitable for the ADC input of the PIC16F688. The calculated output voltage from the divider can be expressed using the voltage divider formula: Vout = Vin * (R2 / (R1 + R2)). Therefore, careful selection of R1 and R2 is necessary to maintain the desired voltage range.
The inclusion of a 5.1V zener diode serves as a protective measure, ensuring that any voltage spikes do not exceed the maximum rating of the PIC's analog input. This component helps safeguard the microcontroller from potential damage due to over-voltage conditions, which could occur if the input voltage inadvertently exceeds the expected range.
The LCD is interfaced in 4-bit mode, which reduces the number of data lines required for communication, simplifying the circuit design and minimizing the use of I/O pins on the microcontroller. The ICSP header is a valuable feature during the development phase, allowing for easy firmware updates and debugging without the need to remove the microcontroller from the circuit.
For optimal performance, a regulated power supply of +5V is essential. The LM7805 linear voltage regulator is a reliable choice for providing this stable voltage, ensuring that the ADC operates accurately. The precision of the resistors used in the voltage divider and the stability of the reference voltage directly influence the overall accuracy of the voltmeter. Consequently, using high-precision resistors and ensuring a stable Vdd are critical for achieving accurate voltage measurements.This project describes how to make a digital voltmeter using a PIC microcontroller. A HD44780 based character LCD is used to display the measured voltage. The PIC microcontroller used in this project is PIC16F688 that has 12 I/O pins out of which 8 can serve as analog input channels for the in-built 10-bit ADC. The voltage to be measured is fed to one of the 8 analog channels. The reference voltage for AD conversion is chosen to be the supply voltage Vdd (+5 V). A resistor divider network is used at the input end to map the range of input voltage to the ADC input voltage range (0-5 V). The technique is demonstrated for input voltage ranging from 0-20 V, but it can be extended further with proper selection of resistors and doing the math described below.
Since the PIC port cannot take 20V input directly, the input voltage is scaled down using a simple resistor divider network. The resistors R1 and R2 scale down the input voltage ranging from 0-20V to 0-5V, before it is applied to PIC16F688`s analog input channel, AN2.
A 5. 1V zener diode connected in parallel between the port pin AN2 and the ground provides protection to the PIC pin in case the input voltage accidentally goes beyond 20V. The LCD display is connected in 4-bit mode, and the ICSP header makes the firmware development easier as you can reprogram and test the PIC while it is in circuit.
When you are satisfied and want to transfer the circuit from the breadboard to a PCB or general-purpose prototyping board, you don`t need the ICSP header. The circuit diagram and the prototype built on a breadboard are shown below. Important: You need a regulated +5V supply for accuracy of the output. The ADC uses Vdd as the reference for conversion, and all computations are done with Vdd = 5V. You can get a regulated +5V using a LM7805 linear regulator IC. The accuracy depends upon the accuracy of the resistors at the input end and the stability of reference voltage, Vdd = +5V.
I found Vdd is stable to +5. 02 V. I measured R1 and R2, and their values are 1267 and 3890 Ohms. So this gives,
Standard serial interfacing of a microcontroller (TTL) with a PC or any RS232C standard device requires a TTL to RS232 level converter. A MAX232 is used for this purpose. It provides a 2-channel RS232C port and requires external 10µF capacitors.
The...
The rectifier bridge voltage is determined by the U2 element; refer to its datasheet for the maximum voltage specifications. The minimum voltage at this pin should not fall below approximately 9V, or 6.5V if low-dropout type U2 and U3 voltage...
The kit employs an off-the-shelf microcontroller based on the AtMega328P-PU Arduino, along with a simplified version designed for ease of replication and modification by collaborators and students. This initiative aims to enable the fabrication of simplified microcontrollers for DIY synthetic...
A regulated and noise-free power supply voltage is essential for microcontrollers and other components such as amplifiers, filters, and GPS devices. Voltage surges in the supply voltage can permanently damage embedded systems. A voltage regulator must maintain the output voltage...
The flash type converter is the simplest and fastest type of analog-to-digital converter. The entire digital output word is available immediately after the propagation delay time of the comparators and the encoding logic gates. A typical conversion time for a...
This circuit is capable of measuring voltages up to 15 volts, utilizing a 9-volt battery that draws a current of only 23 mA. The input circuit includes a diode for protection.
The circuit design features a voltage measurement system that is...
Most LCD issues arise from delay routines. First, ensure proper interfacing of the LCD before proceeding with your digital clock project. A step-by-step approach is crucial. An LCD tutorial is available in the tutorial section for reference. The code has...
This example implements a clock using 36 lines of Perl code. It displays the time and date, with a small icon called "heartbeat" in the upper right corner. The "heartbeat" icon, added by the LCDd server, blinks intermittently to indicate...
To create a dashboard digital voltmeter circuit diagram that includes a parts list, PCB layout, and component placement, a full PDF article is available for download.
The dashboard digital voltmeter circuit is designed to provide an accurate measurement of voltage levels...
We use cookies to enhance your experience, analyze traffic, and (if you allow) serve personalized ads.
By clicking Accept All, you agree to our use of cookies.
Learn more