Physical Computing with Raspberry Pi

About this unit:

Build circuits and control LEDs with code. Learn how screens work, what binary code is and how to create animated light shows that combine digital and physical systems.

National Curriculum Links - Computing KS3

The content of this plan cover the following National Curriculum strands: 

  • use two or more programming languages, at least one of which is textual, to solve a variety of computational problems; make appropriate use of data structures [for example, lists, tables or arrays]; design and develop modular programs that use procedures or functions
  • understand simple Boolean logic [for example, AND, OR and NOT] and some of its uses in circuits and programming; understand how numbers can be represented in binary, and be able to carry out simple operations on binary numbers [for example, binary addition, and conversion between binary and decimal]  
  • understand the hardware and software components that make up computer systems, and how they communicate with one another and with other systems 
  • understand how instructions are stored and executed within a computer system; understand how data of various types (including text, sounds and pictures) can be represented and manipulated digitally, in the form of binary digits 

Unit Resources

Lesson Slides

Detailed lesson slides for you to use when delivering this unit of work with your class

Unit Assessment Sheet

Use our simple assessment system to measure your students' success in this unit of work.

Lessons

Lesson 1

  • To set up a Raspberry Pi computer with some assistance
  • To know the name and purpose of a range of simple electrical components
  • Create build a simple circuit using components and a breadboard
  • To write, test and debug algorithms to control an LED light

Lesson 2

  • To set up a Raspberry Pi computer independently 
  • To understand and explain Morse code
  • To write, test and debug algorithms to make an LED flash a Morse code message

Lesson 3

  • To set up a Raspberry Pi computer independently 
  • To understand that screens are made up of lots of pixels and that each pixel must be controlled with code
  • To build a six LED circuit controlled by a Raspberry Pi
  • To write, test and debug algorithms to control all six LEDs

Lesson 4

  • To set up a Raspberry Pi computer independently 
  • To understand that all things on a computer are controlled by binary code
  • To use binary code to control GPIO pins on a Raspberry Pi
  • To write, test and debug algorithms to create LED light show patterns

Lesson 5

  • To set up a Raspberry Pi computer independently 
  • To use binary code to control GPIO pins on a Raspberry Pi
  • To write, test and debug algorithms to create LED light show patterns independently

Lesson 6

  • To set up a Raspberry Pi computer independently 
  • To understand that broadcast commands can trigger multiple actions
  • To write, test and debug algorithms to create LED light show patterns that synchronise with on screen animations

Full Computing Glossary

Take a look at our full computing glossary, plus key vocabulary for each age group.

Key computing vocabulary for this unit

Abstraction - Removing unnecessary detail to help you solve a problem (a computational thinking concept)

Algorithm – an unambiguous procedure or precise step-by-step guide to solve a problem or achieve a particular objective. A set of instructions for achieving a goal or solving a problem.

Animation - Combining a series of still images to give the illusion of movement when the images are shown as a sequence.

Binary - Binary is the language computers use. It is a series of 1s and 0s and is also used in mathematics.

Block –  a ‘chunk’ of programming or a particular graphic block or piece found in a graphical programming language such as Scratch. Blocks linked together are called a script in Scratch. To find out what a block does, right-click on it, then select help from the pop-up menu.

Blocks Palette – (in Scratch) – the library of blocks in most graphical programming languages.

Broadcast - A method of sending a message to trigger an event in a program. Often used between sprites or the stage in Scratch. 

Command – a step or line of programming.

Coordinate (noun) - Cartesian coordinates are a set of values that show an exact position. In a 2D environment, such as on a graph, two axis are needed, each with an equal number scale. The X axis represents the horizontal position of a point, the Y axis represents the vertical position of a point. Coordinates in a 3D environment require a third axis (Z) which represents depth. Coordinates can be commonly used in coding to position objects (sprites in Scratch) within a program’s visual environment. 

Costume – The costume is the appearance of a sprite on the screen. These are usually editable. A sprite can often have multiple costumes that are changed by programming the sprite.

CPU - (Central Processing Unit) The microprocessor is the brain of the computer. It deals with inputs, thinks what to do with them, and then sends commands to the outputs of the computer.  It is very smart and fast at calculating things, most processors will deal with millions of instructions per second. But all that hard work makes them get hot (bad for computers!) so the CPU usually has its own fan and heatsink to help keep it cool. Other factors come into it as well, but a better, faster CPU will help your computer run faster and let it carry out more tasks at the same time.

Debug – to detect and correct the errors in a computer program.

Decomposition - Breaking a problem down into smaller parts (a computational thinking concept)

Execute – to follow a series of instructions. The computer or robot follows the instructions in order to complete the program.

Hardware - Any part of your computer that has a physical structure, such as the keyboard, monitor or mouse. It also includes all of the computer's internal parts.

Input – data provided to a computer system, such as via a keyboard, mouse, microphone, camera or physical sensors. Information which is received by the computer from a keyboard, mouse or sensor e.g. pressing the left mouse button or space bar creates an input.

Logic - Predicting and analysing. Computational logic is used to allow a program to decide what to do and when. For example you may write code that says: “When the user clicks this button, perform this calculation.”

Logical reasoning – a systematic approach to solving problems or deducing information using a set of universally applicable and totally reliable rules.

Output – the information produced by a computer system for its user, typically on a screen, through speakers or on a printer, but possibly though the control of motors in physical systems. Also an action performed by the computer e.g. switching on a light, moving a turtle or sprite across the screen.

Patterns - Spotting and using similarities to solve problems (a computational thinking concept)

Program – (noun)  A sequence of instructions written to perform a specified task on the computer

Program - (verb)  To give a series of instructions to a machine so that it will perform a task automatically

Repetition (also known as  ‘Loop’ or ‘Iteration’) – a programming construct in which one or more instructions are repeated, perhaps a certain number of times, until a condition is satisfied or until the program is stopped.

Script – (In Scratch) blocks are snapped together into stacks, called scripts. When you click on a script, Scratch runs the blocks from the top of the script to the bottom. You can program sprites and the stage using scripts.

Selection – ‘when things happen’ - A programming construct in which the instructions that are executed are determined by whether a particular condition is met.

Sequence – to place programming instructions in order, with each executed one after the other.

Sprite – A graphical object that can be controlled by programming.

Stage – (in Scratch) - the Stage is where you see your stories, games, and animations come to life. Sprites move and interact with one another on the Stage. The Stage is 480 units wide and 360 units tall. It is divided into an x-y grid.

Variables – A variable is a piece of information in a program that we want to store, but are able to change, such as a score, the time left, or the user’s name.

Related units

Building Retro Games (Pac-Man)

Building Retro Games: Pick a project

About this unit Choose from 3 classic video game projects with this fantastic coding unit. Analyse the original games, build…

Computational Thinking – Alien Contact!

About this unit An unplugged unit to develop your students into strong computational thinkers by solving a wide range of…

Getting started with the BBC micro:bit

About this unit Introduce students to physical computing with a BBC micro:bit. Control the LED matrix and find out how…

LEGO Robotics

About this unit Introduce students to robotics with the awesome  LEGO Robots! Control their movement with precise calculations and coding,…

Python Minecraft

About this unit: Learn Python by hacking Minecraft on a Raspberry Pi! Extend learning into a text based programming language.…

Quiz time with Scratch

About this unit: A unit that takes the coding a bit further than previous game and animation projects. Investigate lists,…

Real Life Algorithms

What is a computer?

About this unit: Delve into what really makes a computer a computer. Is a TV a computer? Is a fridge…