Skip to content
Computing · Year 6 · Physical Computing and Robotics · Summer Term

Inputs: Sensing the Environment

Students program microcontrollers to respond to various sensors (e.g., light, sound, touch) as inputs.

National Curriculum Attainment TargetsKS2: Computing - Programming and AlgorithmsKS2: Computing - Computer Systems and Networks

About This Topic

Students investigate sensors as inputs that enable computers to detect environmental changes, acting as the system's senses. They program microcontrollers like the Crumble or BBC micro:bit to read signals from light, sound, and touch sensors, then trigger outputs such as LEDs or buzzers. A core task involves creating a program where a light sensor activates an LED in low light conditions, aligning with KS2 objectives for programming algorithms that process inputs and understanding computer systems.

This topic builds computational thinking through decomposition of sensor data into readable values, pattern recognition in environmental triggers, and abstraction in conditional code. Students differentiate sensor types by their applications, such as light sensors for automatic lighting or sound sensors for noise monitors, connecting to real-world systems like security alarms or smart homes. These skills support progression to more complex networks and control systems.

Active learning shines here because students wire circuits, code responses, and test in real time. Iterating through failures during paired debugging turns abstract inputs into observable events, boosting problem-solving confidence and retention through tangible cause-and-effect experiences.

Key Questions

  1. Analyze how sensors act as the 'senses' of a computer system.
  2. Differentiate between different types of sensors and their applications.
  3. Construct a program that uses a light sensor to turn on an LED when it gets dark.

Learning Objectives

  • Analyze how different sensor types, such as light, sound, and touch, translate environmental stimuli into electrical signals for a microcontroller.
  • Classify sensors based on the physical property they detect and their common applications in computing systems.
  • Create a program for a microcontroller that uses a light sensor input to control an LED output based on a specific light threshold.
  • Explain the role of conditional statements (if/then) in programming microcontrollers to respond to sensor data.

Before You Start

Introduction to Programming Logic

Why: Students need to understand basic programming concepts like sequences and simple commands before introducing conditional logic based on sensor input.

Basic Circuitry and Components

Why: Familiarity with connecting basic electronic components like LEDs and power sources is necessary for understanding how sensors interact with microcontrollers.

Key Vocabulary

SensorA device that detects and responds to some type of input from the physical environment. The input can be light, heat, motion, moisture, or any one of a great number of other environmental phenomena.
InputInformation or signals sent into a computer system. For microcontrollers, sensors provide the input from the environment.
MicrocontrollerA small computer on a single integrated circuit containing a processor core, memory, and programmable input/output peripherals.
LEDLight Emitting Diode. A semiconductor device that emits light when an electric current passes through it, often used as an output indicator.
Conditional StatementA programming structure (like 'if...then') that performs different computations or actions depending on whether a programmer-specified boolean condition evaluates to true or false.

Watch Out for These Misconceptions

Common MisconceptionSensors directly control outputs without any programming.

What to Teach Instead

Sensors only provide data values; code interprets them to decide actions. Hands-on wiring and coding separates input from logic, while testing reveals why untuned programs fail, helping students through trial and error.

Common MisconceptionAll sensors detect changes in the same way.

What to Teach Instead

Light sensors measure intensity via resistance, sound via vibration amplitude, and touch via capacitance. Station rotations let students experiment with each, calibrating code to match unique outputs and building precise mental models.

Common MisconceptionComputers sense the environment without physical sensors.

What to Teach Instead

Software alone cannot detect real-world changes; hardware converts them to signals. Building circuits shows this dependency, with active failures prompting students to verify connections during group tests.

Active Learning Ideas

See all activities

Real-World Connections

  • Automatic streetlights use light sensors to detect darkness and turn on, saving energy and improving safety in cities like London.
  • Smart home devices, such as thermostats or security systems, use various sensors (temperature, motion, sound) to monitor and respond to household conditions, connecting to the internet for remote control.

Assessment Ideas

Quick Check

Present students with images of different devices (e.g., a doorbell with a button, a night light, a motion-activated camera). Ask them to identify the primary sensor input for each device and explain what output it might control. For example, 'What sensor does the night light use, and what does it turn on?'

Exit Ticket

Give each student a card with a scenario: 'Imagine you are programming a robot to water plants. What sensor would you use to know when the soil is dry, and what action (output) would the robot take?' Students write their sensor and action on the card.

Discussion Prompt

Facilitate a class discussion: 'How is a light sensor like a human's eyes? What are the limitations of a light sensor compared to eyes? Can you think of a situation where a computer needs to 'sense' something to work properly?'

Frequently Asked Questions

What microcontrollers work best for Year 6 sensor programming?
Crumble kits or BBC micro:bit suit this level with block-based coding via Crumble software or MakeCode. Both offer easy sensor connections through alligator clips and visual interfaces that reduce syntax barriers. Start with pre-wired templates to focus on logic, progressing to full builds for challenge.
How do I teach conditional programming with sensors?
Introduce if-then-else blocks using sensor values against thresholds, like 'if light < 50, turn LED on'. Demonstrate with live data readouts, then have students adjust code based on tests. Visual flowcharts first map logic before coding, ensuring understanding of sequences.
How can active learning help students grasp sensors as inputs?
Pairing wiring, coding, and immediate testing creates cycles of predict-observe-explain. Students debug real failures, like dim LEDs from poor thresholds, fostering resilience. Group shares reveal diverse solutions, while logging data patterns cements how inputs drive algorithmic decisions over passive reading.
How to differentiate sensor activities for mixed abilities?
Provide scaffolded code starters for some, full challenges for others. Extension tasks add multiple sensors or variables. Use peer teaching where advanced pairs lead stations, ensuring all access success through adjustable complexity and choice of outputs.