# Lesson 11 Voltmeter

##### Share for us

Introduction

In this lesson, we will use two potentiometers and an LCD1602 to make a voltmeter.

Components

– 1 * SunFounder Uno board

– 1 * USB data cable

– 2 * Potentiometer(50k)

– 1 * LCD1602

– Several jumper wires

– 1 * Breadboard

Experimental Principle

One potentiometer is used to adjust the contrast of the LCD1602. And the other is used to divide voltage. When you adjust the potentiometer connected to pin A0 of the SunFounder Uno board, the resistance of the potentiometer will change and the voltage at pin A0 will change accordingly. This voltage change is converted into digital values by A/D converter on the SunFounder Uno board. We can see this change on the serial monitor. Then convert the digital values into voltage with the following formula: the voltage equals the digital value divides by 1024 and then multiplies by 5.0. Finally, display the voltage on the LCD1602.

Experimental Procedures

Step 1: Build the circuit

The schematic diagram

Step 2: Program (Please refer to the example code in LEARN -> Get Tutorials on our website)

Step 3: Compile the code

Step 4: Upload the sketch to the SunFounder Uno board

Now, adjust the potentiometer connected to pin A0, you will see the voltage displayed on the LCD1602 varies accordingly.

Code

Video