← QCE Digital Solutions Unit 3

Analogue versus digital input and output signals

Analogue signals vary smoothly over a range; digital signals have fixed values like on/off (1/0). Systems convert between them, e.g. ADC at a sensor input, DAC at a speaker output.

Understanding Analogue versus digital input and output signals in QCE Digital Solutions Unit 3

What it does: adc.read() stands for an analogue-to-digital converter turning a smooth sensor voltage into a digital value the processor can handle. A switch gives a digital signal because it only has two states, on (1) or off (0), with nothing in between. A push button is already digital (1 or 0). The gradually changing light reading is analogue and needs an ADC first. Digital signals use fixed values such as on/off or 1/0. Smoothly varying values in between describe analogue signals. The button has two states, pressed (1) and not pressed (0), so it is a digital input.

Common mistakes: A button is a switch with only two states, pressed or not pressed (1 or 0), so it is a digital input. The message should say digital, not analogue. A temperature sensor gives a smoothly varying analogue signal, so it must be read through an ADC with read_adc(). A digital read would only return 0 or 1 and lose the detail.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 15–119) and word search (Modules 15–176).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
A light switch is either ON or OFF. What type of input signal is this?
Analogue: it varies smoothly over a rangeDigital: it has only two fixed values
Matches
switch_state = 0.63
↓
A switch is a digital input, so it can only be 0 or 1. A value like 0.63 suggests a smooth analogue range.
Applying
Meanings
Term
analogue vs digital
Meaning
Analogue signals vary smoothly over a range; digital signals have fixed values like on/off (1/0). Systems convert between them, e.g. ADC at a sensor input, DAC at a speaker output.
Practice
switch <- DIGITAL_READ(button)
Testing
Gaps
state = (switch)
Check Answer
Spots
2if button == 1:
3 print("analogue: pressed")

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Octopus' badge — Multi-Tasker, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. A light switch is either ON or OFF. What type of input signal is this?
A. Analogue: it varies smoothly over a range
B. Digital: it has only two fixed values ✓
A switch gives a digital signal because it only has two states, on (1) or off (0), with nothing in between.
2. A temperature sensor outputs a voltage that rises smoothly as a room warms up. What type of signal is this?
A. Analogue ✓
B. Digital
The voltage can take any value within a range, so it is an analogue signal.
3. A microprocessor can only work with 1s and 0s. What must a system add to use a smoothly varying sensor signal?
A. A digital-to-analogue converter (DAC)
B. An analogue-to-digital converter (ADC) ✓
An ADC changes the analogue sensor signal into digital values the microprocessor can process. A DAC goes the other way.
4. Which signal needs no conversion before it reaches a microprocessor?
A. A push-button press (on/off) ✓
B. A light sensor reading that changes gradually
A push button is already digital (1 or 0). The gradually changing light reading is analogue and needs an ADC first.
5. A phone stores a song as digital data. Which converter lets the speaker play it as smooth sound waves?
A. Digital-to-analogue converter (DAC) ✓
B. Analogue-to-digital converter (ADC)
A DAC turns stored digital values into a smoothly varying analogue signal that drives the speaker.

Match the Pairs

temp = 23.7 → An analogue-style reading: a temperature can take any value in a smooth range, not just fixed steps
button_pressed = 1 → A digital signal: it has only two fixed values, 1 (on) or 0 (off)
An analogue sensor's smooth signal must be converted to a digital number before the microprocessor can use it → value = adc.read()
A digital output can be turned into a smooth analogue signal for a speaker using a DAC → dac.write(sound_level)
switch_state = 0.63 → A switch is a digital input, so it can only be 0 or 1. A value like 0.63 suggests a smooth analogue range.
light_level = 1 # analogue sensor → An analogue light sensor gives a range of values, not just 1 or 0. Showing only on/off treats it as a digital signal.

Key Term

analogue vs digital
Analogue signals vary smoothly over a range; digital signals have fixed values like on/off (1/0). Systems convert between them, e.g. ADC at a sensor input, DAC at a speaker output.

Fill in the Blanks

1. state = read_digital(switch) if state == 1: light_on()
Hint: Type the function name that reads an input with only two possible values, like a switch.
2. level = read_analogue(temp_sensor) print(level)
Hint: Type the function name that reads a sensor whose value varies smoothly over a range.
3. adc = ADC(Pin(34)) value = adc.read()
Hint: Type the abbreviation for the converter that turns a smooth sensor voltage into a digital number.
4. speaker = DAC(Pin(25)) speaker.write(volume)
Hint: Type the abbreviation for the converter that turns a digital number into a smooth voltage for a speaker.
5. pressed = switch.value() if pressed == 1: light.on()
Hint: Type the digital value that stands for a switch being on.

Spot the Error

Question 1
A button = read_pin(2)
B if button == 1:
C print("analogue: pressed")
Line C — A button is a switch with only two states, pressed or not pressed (1 or 0), so it is a digital input. The message should say digital, not analogue.
Question 2
A # temperature sensor is analogue
B raw = read_digital(0)
C temp = raw * 0.1
Line B — A temperature sensor gives a smoothly varying analogue signal, so it must be read through an ADC with read_adc(). A digital read would only return 0 or 1 and lose the detail.
Question 3
A # sensor voltage to number
B volts = 2.7
C number = dac(volts)
Line C — An analogue sensor voltage has to be turned into a digital number so the microprocessor can use it. That is the job of an ADC. A DAC goes the other way, from digital to analogue.
Question 4
A switch = read_adc(4)
B if switch == 1:
C motor_on()
Line A — A switch is a digital input with fixed on/off values, so it should be read with a digital read such as read_pin(). It does not need an ADC, which is for analogue signals.
Question 5
A digital_values = [0, 0.7, 1, 0.3]
B for v in digital_values:
C set_pin(7, v)
Line A — A digital signal only has fixed discrete values such as 0 and 1. Values like 0.7 and 0.3 vary smoothly and belong to an analogue signal. The list should be [0, 1, 1, 0].

Student with a class code? Join your class →