Did you know a sensor can offer 1,024 possible digital readings even though its largest displayed reading is 1,023? A student building a light sensor, soil-moisture monitor or simple Arduino project may mistake that difference for a missing measurement. It is actually a place-value lesson: counting possible values is not the same thing as naming the highest value.
A 10-bit analogue-to-digital converter (ADC) represents an analogue input with a 10-bit digital code. Each bit has two states, so the code contains 210 = 1,024 possibilities. When the codes are numbered from zero, the complete integer range is 0 through 1,023 inclusive. The number 1,024 describes how many codes exist, not the highest code. Real voltage conversion, accuracy and reference limits are separate questions.
- Count first: 210 = 1,024 distinct binary patterns.
- Number from zero: first code 0, last code 1,023.
- Remember that a digital code is a quantised representation, not an infinitely precise voltage.
- Check the actual board, reference voltage, ADC configuration and safe input range before connecting hardware.
- Distinguish code count, voltage step, calibration accuracy and sensor resolution.
- Validate your calculation with binary and an independent arithmetic check.
The confusion starts with an entirely reasonable question
Suppose a worksheet asks: ‘A converter has 10 bits. What is the highest reading?’ Some pupils calculate 2 × 2 × 2 × 2 × 2 × 2 × 2 × 2 × 2 × 2 = 1,024 and write that as the maximum. Their multiplication is sound; their interpretation is not. If four numbered chairs have labels 0, 1, 2 and 3, there are four chairs, but no chair numbered 4. Binary codes follow the same counting distinction.
A ten-bit number has ten positions. The patterns run from 0000000000 to 1111111111. The all-zero pattern represents decimal zero. The all-one pattern represents 512 + 256 + 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 1,023. Counting both endpoints gives 1,023 − 0 + 1 = 1,024 codes. That final ‘+ 1’ matters because the endpoints are included.
Worked example: interpret a 3.3 V ADC reading without overselling its precision
Imagine a fictional school electronics demonstration using an ADC with ten output bits and a nominal 0–3.3 V input span. For a first illustrative display calculation, choose a simple endpoint mapping, estimated voltage = code × (3.3 V ÷ 1,023). If the code is 512, the estimate is 512 × 3.3 ÷ 1,023 ≈ 1.6516 V. It is a little above 1.65 V because 512 is just above the midpoint of the integer code range. This is a teaching convention rather than a universal ADC transfer equation.
Using the same endpoint mapping, code 0 corresponds to 0 V and code 1,023 corresponds to 3.3 V. The difference between adjacent displayed voltage estimates is 3.3 ÷ 1,023 ≈ 0.003226 V, or 3.226 mV. Here we are describing spacing between our reported estimates. In a common ideal quantiser model, the nominal bin width is instead full-scale span ÷ 1,024 ≈ 3.223 mV. The two denominators answer different modelling questions. A real data sheet decides the actual reference, transfer curve, thresholds and endpoint behaviour.
The cross-check that prevents a false ‘extra code’
If a learner writes that the range is 0–1,024, count the integers: 1,024 − 0 + 1 = 1,025. But ten bits cannot encode 1,025 distinct values. If a learner writes 1–1,024, that is also 1,024 labels, but it is not the zero-based code range specified by a typical ADC API. We must not silently change the labelling convention just to make the multiplication fit.
Diagnosis: find exactly which idea is unstable
- Cardinality error: ‘1,024 codes’ is incorrectly treated as ‘maximum code 1,024’. Repair with a two-bit example: 00, 01, 10 and 11.
- Binary-position error: a pupil cannot expand 1111111111 into powers of two. Repair by labelling the positions 29 down to 20.
- Unit error: a code such as 512 is called ‘512 volts’. Repair by naming raw code and estimated voltage separately.
- False precision: the learner thinks a ten-bit display guarantees a 3.2 mV-accurate measurement. Repair by discussing reference error, noise and calibration.
- Hardware-transfer error: an online formula is copied without checking the chip’s actual ADC specification. Repair by consulting its documentation.
An effective tutor does not give all pupils another hundred binary exercises. Ask a short diagnostic first: How many values can two bits represent? What is their largest zero-based label? What is the unit of a value returned by analogRead()? A pupil who answers ‘four, three, a digital count’ has the basic conceptual bridge. A pupil who cannot answer the last question needs sensor and measurement vocabulary, not merely arithmetic speed.
Guided practice, then a deliberate removal of support
Stage 1 — construct the codes
Write every two-bit pattern in order: 00, 01, 10, 11. Convert each to decimal: 0, 1, 2, 3. Repeat for three bits. There should be 8 patterns, numbered 0–7. Before using a formula, ask the learner to justify why the last label is one less than the number of possible patterns.
Stage 2 — generalise
Calculate the number of codes and maximum unsigned code for 8 bits. Answer: 28 = 256 possibilities and maximum 255. For 12 bits the values are 4,096 possibilities and maximum 4,095. Confirm by adding one to the maximum. The rule is not unique to an Arduino; it applies to a zero-based unsigned binary code of the stated width.
Stage 3 — change the physical span
A 10-bit reading of 600 under the illustrative endpoint model with 3.3 V reference gives 600 × 3.3 ÷ 1,023 ≈ 1.9355 V. If the same code is interpreted with a 5.0 V reference, the corresponding estimate is 600 × 5.0 ÷ 1,023 ≈ 2.9326 V. The code alone is not enough to establish voltage; the reference assumption must travel with the number. Students should label the two estimates as approximate.
Stage 4 — independent transfer
Present a fictional temperature sensor whose documentation says its usable output range is 0.5–2.5 V. A student is handed code 600 but not told the ADC reference. Can the student identify a precise temperature? No. They lack at least the reference and the sensor’s voltage-to-temperature mapping, and must also consider calibration. A good answer states what information is missing rather than inventing a temperature from the count.
What progress should look like in an actual classroom
At the first check, many learners can state 210 but cannot explain why the maximum is 1,023. After teaching, ask for an explanation rather than another bare number: ‘The ten bits create 1,024 patterns; zero is one pattern, so the last zero-based label is 1,023.’ A week later, change the context to a 12-bit converter or an 8-bit unsigned image value. A transfer success is a correct range with the counting reason, not just a memorised 1,023.
For parents, a simple code table is more useful than buying new equipment. Invite the child to write the 00–11 patterns and explain how a new bit doubles the possibilities. For teachers, pair a code-range question with a measurement-accuracy question and look for pupils who can separate them. For pupils building circuitry, protect the device: exceeding a rated pin voltage is an electrical safety issue that no maths answer can resolve.
Did you know? More output codes do not automatically mean a more truthful sensor
Even a theoretically finer quantiser can yield weak measurement data if the voltage reference drifts, the sensing element is noisy, the circuit is badly connected or the signal lies outside the usable span. A converter’s resolution describes the granularity of its possible digital representations. Its accuracy, noise and effective number of bits describe different real-world performance limits. The output code is evidence from a system, not the entire system.
A published Arduino explanation states that ten-bit analogue reads return integers from 0 to 1,023 on the relevant boards. Other boards and libraries can support different resolutions. Read Arduino’s explanation of analogue inputs and its resolution reference, then check the documentation for the actual device being used.
Frequently asked questions
Does ’10-bit’ mean ten decimal digits?
No. It means ten binary positions. Ten decimal digits have a very different set of possibilities.
Is 1,024 always the value used in voltage calculations?
No. The number 1,024 is the count of codes and appears in ideal bin-width models; 1,023 may appear in endpoint-rescaling conventions. The precise relation between input voltage and code depends on the converter and its documented transfer characteristics. Always state which model you are using.
Could a sensor output an integer outside 0–1,023?
A program might rescale readings, set a different ADC resolution or report a calibrated engineering unit. The raw result of a particular ten-bit zero-based unsigned converter is within 0–1,023, but not every number displayed by sensor software is that raw code.
Should pupils memorise maximum values for every bit depth?
It is faster in the long run to understand the general rule: count = 2n; maximum unsigned zero-based value = 2n − 1. Then check by counting from zero.
From a correct code to an independent thinker
The deeper purpose is to teach students to ask what a number counts and what it measures. That habit travels from Arduino boards to spreadsheets, cameras, laboratory instruments and exam questions. The next time a pupil sees 1,024 and 1,023 side by side, they can explain both without treating either as an error.
Continue with the Core Aim guide to digital-scale readability versus accuracy, the eduKate Education Hub, and the Secondary 1 Mathematics explanation-first tutorial reference. Each helps the learner move from a displayed answer to the reason underneath it.
