DersTedersDersTeders

Home / Blog / Analog vs digital pin.

Analog vs digital pin: which one reads your signal?

A digital pin reads one of two states. An analogue pin reads a voltage that can sit between the rails. Our circuit guides show both cases.

Study guideElectronicsInputs

The recorded difference

In the button project a digital input is connected to 5 V when the button is pressed and pulled to 0 V by a 10 kiloohm resistor when it is released. The sketch reads logic 1 and logic 0. The guide warns that without the pull path the input floats and gives unstable readings.

In the potentiometer project the middle terminal goes to a single analogue pin, so the sketch can read a changing voltage rather than two states. Our board data records six analogue inputs A0-A5 on the Uno and eight A0-A7 on the Nano, where A6 and A7 are analogue only. PWM outputs are a separate subset of the digital pins: 3, 5, 6, 9, 10 and 11.

Analog vs digital pin side by side

QuestionAnalogdigital pin
Values readHIGH or LOWA voltage level along the range
Example in our guidesButton with 10 kohm pull-down resistorPotentiometer middle terminal
Pin naming in board dataD0-D13A0-A5 (Uno), A0-A7 (Nano)
Extra ruleProvide a pull path or the input floatsA6/A7 on Nano are analogue only

Read both columns against the same question. A difference in interface or recorded range is a reason to choose, not a claim that one part is generally better.

Evidence from our own material

Button states

Pressing the button connects the input to 5 V; the pull-down resistor holds it at 0 V when released. (source: en/devre/arduino-circuits.html)

Potentiometer signal

The middle terminal goes to one analogue pin; an outer terminal by mistake leaves the value unchanged. (source: en/devre/potansiyometre-ile-analog-okuma.html)

Digital reuse

On the Uno, A0-A5 can also be addressed as digital pins 14-19; on the Nano, A6 and A7 cannot. (source: js/arduino-kart.js)

Which one to pick

Best for a switch or a yes/no signal: a digital input with a defined pull path.

Best for a value that varies continuously: an analogue input. If your board is a Nano, remember that the two extra analogue pins cannot be used as digital outputs later.

A short check you can do now

Question 1. What happens to a digital input without a pull resistor?

Question 2. Which potentiometer terminal goes to the analogue pin?

Question 3. Which Nano pins are analogue only?

If you can answer all three without rereading, move on. If not, go back to the table and one source note — that is usually enough.

Next steps in the library

Continue with a hands-on guide, a browser simulator or a free account.

Generated from DersTeders' own material. Source files: en/devre/arduino-circuits.html · en/devre/potansiyometre-ile-analog-okuma.html · js/arduino-kart.js. Names such as Uno, Nano, DHT11, DHT22, HC-SR04, VL53L0X, servo and stepper are used as component identifiers only. This page records documented behaviour and interface differences; it makes no cost comparison, no maker ranking, no commercial endorsement and no performance promise.

Save your progress. Create a free account to keep your place across lessons, quizzes and circuits.

Topic tracking