Store
Student home

Crack the Code

A NSW Technology Mandatory 7–8 unit of work: students design, produce and evaluate an Arduino-based alarm/alert system. Four hands-on Plug-Run-Play activities — Blink, Button, Analog input and Buzzer — build the coding skills (sequence, branching, variables, the Serial Monitor) the design project needs. Built around the Crack the Code Arduino kit with the MAAS ThinkerShield.

Your project brief

Utilising your skills in control technologies and coding, you are to design, produce and evaluate an alarm/alert system to inform you if someone has broken into something you own or care for — for example a bedroom, a box or a treasure chest.

What "done" looks like

The class refines the evaluation criteria to five key points. The finished project:

  1. is a control system (input → processing → output);
  2. is an alert/alarm system with a stated end-use application;
  3. uses a microcontroller (Arduino + ThinkerShield while prototyping, then a built circuit);
  4. includes working inputs (one or more sensors);
  5. includes working outputs (one or more actuators) that change with the input.

Start here

Weeks 1–2 · Understanding control technologies

Identify control technologies in the world around us, describe how they use inputs, processing and outputs, and explain what a microcontroller and a shield are.

My lessons

My activities

Each Plug-Run-Play activity builds one skill you'll use in your final project.

Glossary

61 terms

Every word you'll meet in this unit. They also pop up inline when you read a lesson.

actuator
A component that performs a task or action when given a command — for example a servo motor in a remote-control car that turns the steering.
analogRead
A command that converts an input voltage in the 0–5 V range to a number between 0 and 1023, using an analog-to-digital converter (ADC) inside the microcontroller.
analogue input
An input voltage on Arduino anywhere between 0 and 5 volts (as opposed to digital, which is only off or on — 0 or 5).
analogue output
An output voltage on Arduino anywhere between 0 and 5 volts (as opposed to digital, which is only off or on).
analogWrite
Writes an analog value to a pin — used to light an LED at varying brightness or drive a motor at various speeds. The value ranges from 0 to 255.
anode
The positive leg of an LED. An LED only conducts (and lights) when current flows from the anode to the cathode.
Arduino
A small, easy-to-use programmable microcontroller board (and the company that makes the boards and the software to program them).
binary
A base-2 counting system using only 0 and 1. All data in a computer is stored in binary because the hardware is electronic — on (1) or off (0).
bit
A single binary digit — a 1 or a 0.
board
A surface that electronic components are attached to. It must not conduct electricity.
branching
An instruction that causes different actions depending on specified conditions. Flowcharts show branching with diamond decision symbols.
byte
A block of eight bits. A byte represents a number from 0 to 255 (256 values, but counting starts at 0).
camel case
Joining words together and capitalising the start of each word after the first — e.g. `pinMode`, `digitalWrite`, ThinkerShield. Commands are case-sensitive.
cathode
The negative leg of an LED. If an LED is in the wrong way round, swap the connections.
coding
Another word for computer programming — writing the instructions (the *code*) that tell a computer or microcontroller what to do.
comments
Notes added next to lines of code to explain them. In Arduino, comments start with `//`; the compiler ignores everything after the `//` on that line.
compile
Translating a sketch into the machine language the microcontroller runs. The Arduino IDE compiles a sketch (and checks it for syntax errors) before uploading it.
component
An electronic part that on its own generally has no function, but which can perform a task when combined with others into a circuit.
conductive
Able to carry electric current — e.g. copper wire. Don't rest a board on a conductive surface.
const
Short for *constant* — a value the programmer does not want changed, e.g. `const int ALARMSOUNDER = 3;`.
control technology
An electronic device that uses inputs to create outputs — for example traffic lights, a dishwasher, or a TV remote control.
declaration
Defining the type of a variable (and optionally its initial value). In an Arduino sketch the declarations sit before `void setup()`.
digital input
An input that is only on or off — it can't gradually turn on or off.
digital output
An output that can only be switched on or off (HIGH or LOW), not set to a percentage — though PWM pins can fake a percentage by switching very fast.
digitalRead
Reads a HIGH or LOW signal from a pin that has been set as an input.
digitalWrite
Sends a HIGH or LOW signal to a pin that has been set as an output.
electrical circuit
A path that allows electricity to flow. A circuit must be *closed* (no breaks) for current to flow all the way around.
false
Not true — no electrical current present. Also called OFF, LOW or 0.
for loop
A loop that runs a fixed number of times and then stops — e.g. `for (i = 0; i < 10; i++) { … }`. Unlike `void loop()`, it doesn't run forever.
function
A named block of code that does a particular job — e.g. `setup()` and `loop()`, or built-ins like `digitalWrite()` and `tone()`.
hardware
The physical parts of the system — the electrical circuit, components and the microcontroller (Arduino).
HIGH
ON / true / 1 — electrical current present (up to 5 V on an Arduino Uno).
IDE (Integrated Development Environment)
The software you write, check and upload a sketch in — for Arduino, the Arduino IDE. Different IDEs use different programming languages.
if statement
A conditional that lets the program decide what to do based on a condition — e.g. turn an LED on *if* a button is pressed. Often paired with `else`.
Input, Processing and Output (IPO) chart
A simple map of the input and output components of a control system, making it easier to understand and design.
integer (int)
A whole number. The `int` command declares an integer variable — often used to give a pin an intuitive name, e.g. `int ledPin = 12;`.
light dependent resistor (LDR)
A component whose resistance changes with the amount of light falling on it — used to detect light or dark.
light emitting diode (LED)
A component that emits light and only lets current pass one way (anode → cathode). Available in many colours; usually wired with a series resistor.
LOW
OFF / false / 0 — no electrical current present.
microcontroller
A small programmable computer that can run code. Once programmed it doesn't need a computer attached. Also called a programmable logic controller (PLC).
multimeter
A tool that measures a range of electrical values — current (amps), continuity, resistance and voltage — on circuits and components.
piezo buzzer
Makes a buzzing sound when current is applied. It isn't a speaker, but it still outputs sound — driven by the `tone()` command.
port
A connection point on the Arduino (or ThinkerShield) where a sensor or actuator plugs in. (Also: the COM/serial port the board appears on when plugged into a computer.)
potentiometer
A resistor whose resistance changes when you turn a knob or move a slider — like the volume control on a radio. Marked POT A5 on the ThinkerShield.
power supply
Supplies the circuit with power — from small batteries (like in a watch) to mains power packs. Lets a microcontroller run independently of a computer.
pseudocode
Writing, in plain English, line by line, what you want a program to do — explicit, step-by-step instructions in a logical sequence.
pulse width modulation (PWM)
Dimming an output (like an LED) by switching it on and off very fast. Available on Arduino pins marked `~` (3, 5, 6, 9, 10, 11); controlled with a value 0–255.
resistor
A component that reduces (resists) the current in a circuit. An LED is usually wired with a 220 Ω resistor in series so it doesn't burn out.
sensor
A device connected to the microcontroller that detects a change in its environment and provides that data to the microcontroller — e.g. a button, an LDR, a motion sensor.
serial monitor
A window in the Arduino IDE that shows data the sketch prints with `Serial.print` / `Serial.println` — useful for checking what a program is doing.
shield
A board that fits onto the microcontroller via its analog and digital pins, adding an easy-to-use interface or built-in components. The MAAS ThinkerShield is an example.
sketch
Arduino's name for a program — the code you write in the Arduino IDE and upload to the board.
syntax
The spelling and grammar of code. It must be exactly right or the computer won't know what to do. Commands are case-sensitive.
tactile switch
A switch operated by a person — e.g. a pushbutton.
ThinkerShield
An Arduino shield developed by the Museum of Applied Arts & Sciences (MAAS, Sydney) with on-board LEDs, a button, a potentiometer, an LDR and a buzzer — so you can learn to code without first learning electronics.
tone
An Arduino command, `tone(pin, frequency, duration)`, that drives a piezo buzzer at a given frequency (Hz) for a given time (ms).
true
ON / HIGH / 1 — electrical current present (up to 5 V on an Arduino Uno).
variable
A named storage location for a value that can change while the program runs (e.g. `buttonState`). Declared with a type, such as `int`.
void loop
The section of an Arduino sketch that runs after `void setup` and then repeats forever (until the power is removed or new code is uploaded).
void setup
The section of an Arduino sketch that runs once at the start, used to prepare the board (e.g. set pin modes). The sketch won't run correctly without it.
volts (voltage)
The unit of electrical 'pressure' — how hard the current wants to flow. An Arduino Uno works at up to 5 V.
Maddy, co-founder of Little Bird

Need help? We're here for you!

Hi, I'm Maddy. My team and I are ready to help with your order or any questions.