Call Us Now
0242159130 | 0546096840
Up to 2% reward

#### For new all Customers

Delevery schedule

# how to make a simple voltmeter Experiment description 12

In this tutorial, we will learn how make a simple voltmeter (0~5V) with Arduino UNO and LCD1602. Then, we will measure the voltage of the potentiometer(when adjusting the knob) with the simple voltmeter and display the voltage detected on the LCD1602.

Hardware required

1 * Arduino UNO

1 * USB Cable

1 * LCD1602

2 * 10kΩ Potentiometer

Principle of operation

The basic principle of this experiment: Convert the analog voltage collected from Arduino to digital quantity by the ADC (analog-to-digital converter) through programming, and then display the voltage on the LCD1602. Connect the three wires from the potentiometer to your Arduino board. The first goes to ground from one of the outer pins of the potentiometer. The second goes from analog input 0 to the middle pin of the potentiometer. The third goes from 5V to the other outer pin of the potentiometer.

By turning the shaft of the potentiometer, you change the resistance on either side of the wiper which is connected to the center pin of the potentiometer. This changes the voltage at the center pin. When the resistance between the middle and the side one (connected to 5V) is close to zero (and the resistance ontheothersideis closeto10kOhm), thevoltageatthemiddlepiniscloseto 5V. When the resistances are reversed, the voltage at the center pin changes to about 0V, or ground. This voltage is the analog voltage that you're reading as an input.

The Arduino UNO board has a circuit inside called an analog-to-digital converter that reads this changing voltage and converts it to a number between 0 and 1023. When the shaft is turned all the way in one direction, there are 0 volts going to the pin, and the input value is 0. When the shaft is done in the opposite direction, it's 5 volts going to the pin and the input value is 1023. In between, analogRead( ) returns a number between 0 and 1023 that is proportional to the amount of voltage being applied to the pin.
Keyfunction :

Reads the value from the specified analog pin. The Arduino board contains a 6 channel (8 channels on the Mini and Nano, 16 on the Mega), 10-bit analog to digital converter. This means that it will map input voltages between 0 and 5 voltsintointegervaluesbetween0 and1023.This yieldsaresolutionbetween readings of: 5 volts / 1024 units or, 0.0049 volts (4.9 mV) per unit. The input range and resolution can be changed using analogReference( ).

Syntax :

Parameters:

pin: the number of the analog input pin to read from (0 to 5 on most boards, 0 to 7 on the Mini and Nano, 0 to 15 on the Mega)

Returns :

int (0 to 1023)

Experiment Code

#### }

Compile the program and upload to Arduino UNO. Now, turn the shaft of the potentiometer, and you will see the voltage displayed on the LCD1602 changed