Introduction: Read ADC Values From Potentiometers

About: someone who likes electronics

In this article I will show you how to read ADC values from a potentiometer.

this is the basis of Arduino programming. which is reading analog values using the Analog pin provided by Arduino.

besides using the potentio, there are several sensors that use analog input. such as light sensors, sound sensors and soil moisture sensors.

Why use a pot? because this component is easy to find and can represent sensors that are read using analog input.

From this ADC reading, it can later be collaborated with output devices. and certainly will create interesting things.

Step 1: Required Components

This is a component that is needed in this tutorial :

Step 2: Assemble

Assemble all components used.

Use the schematic drawing above as a guide for assembling it.

Potentio to Arduino

1 ==> Gnd

2 ==> A0

3 ==> +5V

Step 3: Programming

After the circuit is installed. Next, fill arduino with the ADC read program that has been made.

The sketch that I made is roughly like this:

void setup() {
// initialize serial communication at 9600 bits per second: Serial.begin(9600); }

// the loop routine runs over and over again forever: void loop() { // read the input on analog pin 0: int sensorValue = analogRead(A0); // print out the value you read: Serial.println(sensorValue); delay(1); // delay in between reads for stability }

You can also download the original file below:

Step 4: Result

The following is a way to see the results:

  • Open the serial monitor on Arduino.
  • Make sure the baud rate on the serial monitor and the program is appropriate (here using 9600).
  • then turn the potentiometer
  • When rotated to the right, the ADC value will be even greater
  • When rotated left, the ADC value will get smaller
  • The smallest value is 0 and the biggest value is 1023.

From digital data 0-1023, we can use it to make other interesting things. Just look at my upcoming article.