Skip to content


In this experiment we will show and test what a poteniometer is and we use it to find voltages when microcontroller reads LOW and HIGH state on his digital input pin.

We cover the following topics


A potentiometer is a three-terminal resistor with a sliding or rotating contact that forms an adjustable voltage divider. If only two terminals are used, one end and the wiper, it acts as a variable resistor.

Test idea

Take the Arduino board and make the following test

  • Turn potentiometer to one of its final position.
  • Use middle potentiometer's pin output signal as input signal for digital and analog Arduino's pins
  • In Arduino
    • read digital pin value and print HIGH if this pin is in HIGH state and LOW if is in LOW state
    • read analog pin value and print voltage
  • Change, not to fast, potentiometer position to oposite final position. Doing this, read and print digial and analog values (see previous step). Note when digital state will switch to HIGH when voltage is increased from 0V to 5V, and when digital state will switch to LOW when voltage is decreased from 5V to 0V.



Below tere is a code we can use to make this test.

Read an appropriate documentation if you don't know how function we used are working


In my case

  • when voltage is increased from 0V to 5V, digital state switches to HIGH for 2.7V
  • when voltage is decreased from 5V to 0V, digital state switches to LOW for 2.16V.
Top-left: Step 1, initial voltage about 0V, LOW state; top-right: Step 2; bottom-left: Step 3; bottom-right: Step 4, voltage about 2.7, HIGH state