ROBOTICS MISSION 001
Smart House Lab
STAGE MODE • ARDUINO UNO
A JSS1 BUILD-AND-CODE ADVENTURE
Can we build a house that detects visitors?
A smart house that sees an approaching object, lights up, and sounds an alert.
APPROACH→MEASURE→DECIDE→ALERT
First, meet the finished design. Then we build this exact house together.
Generating concept image…
MISSION SIMULATION
Watch the smart house in action
This is a visual simulation, not a live hardware connection.
DISTANCE100 cm
VISITOR DETECTED!
Replay simulation
THE LOGIC LOOP
01APPROACHVisitor moves toward the door.
02MEASUREUltrasonic echo returns a distance.
03DECIDEThe program checks the 50 cm rule.
04ALERTLED stays on; one short beep marks a new approach.
THE BUILD KIT
Meet the components
Every part has one clear job in our smart house.
UNO
Arduino Uno
The brain: it reads the sensor and controls the alert.
HC-SR04 sensor
Sends a sound pulse and measures the returning echo.
LED
A visual alert that glows near the door.
Buzzer
Makes one short sound for each new approach.
Breadboard
A reusable platform for tidy connections.
Jumper wires
Electrical pathways between the parts.
Ω
220–330 Ω resistor
Protects the LED by limiting current.
Cardboard or foam board
The affordable house body and stable base.
PLAN BEFORE YOU CUT
Design the house blueprint
The sensor must face outward and stay clear of the cardboard.
SENSOR
faces outward
LED
ELECTRONICS
access compartment
WALLS
ROOF
FRONT DOOR
STABLE BASE
01Leave a doorway for the visitor.
02Mount the HC-SR04 above or beside the entrance.
03Keep Arduino and wiring accessible, not sealed inside.
BLUEPRINT → BUILD
CONSTRUCTION BAY
Build the cardboard house
Build the same simple, sturdy design shown in the reveal.
- 01
Measure and markMark walls, a door opening, and a roof on cardboard.
✓ - 02
Cut the panelsCut carefully, leaving clean edges for joining.
✓ - 03
Join the wallsMake a square body and attach the front panel.
✓ - 04
Attach roof and baseFix the roof to a stable base; leave the electronics accessible.
✓
!Safety first:use cutting tools carefully and under adult supervision.
WIRING 01 / INPUT
Connect the ultrasonic sensor
One wire at a time. Match every label to the correct Arduino pin.
ARDUINO
UNO5VGNDD9D10
HC-SR04VCCGNDTRIGECHO
Sensor pin map| Sensor pin | Arduino Uno |
|---|
| VCC | 5V |
| GND | GND |
| TRIG | D9 |
| ECHO | D10 |
)))Echo idea
The sensor sends a sound pulse and measures how long the returning echo takes.
WIRING 02 / LIGHT
Connect the LED
The LED sits beside the door so a visitor can see the alert.
D13
220–330 Ω
GND
D13 → resistor → LED long leg → LED short leg → GNDThe resistor must remain in the circuit to limit current and protect the LED.
WIRING 03 / SOUND
Connect the buzzer
A short beep announces a new approach, not every sensor reading.
Buzzer inside / beside entrance +Buzzer positive (+)D8
−Buzzer negative (−)GND
One approach = one short beepThe memory variable stops repeated beeps while someone remains close.
PRE-FLIGHT CHECK
Check the complete circuit
Trace the full path before connecting USB power.
✓Sensor power checked
✓Sensor pins checked
✓LED polarity checked
✓LED resistor present
✓Buzzer polarity checked
✓All grounds connected
POWER OFF WHILE WIRINGDisconnect USB power before changing a connection.
THE SOFTWARE LAB
Enter the PictoBlox lab
Visual blocks first: students build the logic without typing the program.
PictoBlox • Stage Mode
BLOCKS
when green flag clicked
forever
read distance
- 01Open PictoBlox.
- 02Select Block Coding and Arduino Uno.
- 03Connect the correct COM port.
- 04Select Stage Mode.
- 05Upload the required firmware if prompted.
- 06Keep Arduino connected while Stage Mode runs.
Interface shown as an illustration. PictoBlox block names can vary by version and extension.
BLOCK TOOLBOX
Find the required PictoBlox blocks
Look for the function, then match the closest supported label in your version.
EVENTS
when green flag clicked
CONTROL
forever
if then
if then else
wait
OPERATORS
< less than
= equals
VARIABLES
create someoneNear
set someoneNear to 0
ARDUINO / EXTENSION
ultrasonic distance in cm
digital pin HIGH / LOW
play tone, if available
VERSION CHECKBlock labels vary. Do not invent a block: if the tone block is unavailable, use the compatible Arduino-code backup or a documented supported alternative.
THE MEMORY SWITCH
Create the someoneNear variable
This tiny memory switch makes the alert feel intelligent.
0No current approach has beeped. A new visitor may trigger the buzzer.
1This approach already beeped. Keep LED on, but stay quiet.
0→1→0visitor arrives → visitor stays → visitor leaves
BLOCK PROGRAM / PRIMARY METHOD
Build the PictoBlox program
Arrange the visual logic in this order. These are intended functions; exact labels can vary.
when green flag clicked
set someoneNear to 0
set digital pin 13 output to LOW
forever
read ultrasonic distance: TRIG 9 / ECHO 10
if distance < 50 then
set digital pin 13 output to HIGH
if someoneNear = 0 then
set someoneNear to 1
play tone on pin 8: 1000 Hz / 0.3 s
else
set digital pin 13 output to LOW
set someoneNear to 0
wait 0.1 seconds
UNDER 50 CMLED stays ON.
FIRST DETECTIONOne short beep, then someoneNear becomes 1.
MOVES AWAYLED OFF; reset to 0 for the next approach.
ROBUSTNESS TIPTreat an invalid or missing reading as no detection when your blocks expose that condition.
THINK LIKE A PROGRAMMER
Understand the program logic
Follow the glowing path: the loop never stops checking.
START
↓
READ DISTANCE
↓
Is distance less than 50 cm?YESTURN LED ON
↓
Already beeped?NOBEEP ONCE
SET 1
YESSTAY QUIET
↻ REPEAT FOREVER
MISSION TEST
Upload and test in PictoBlox
The animation shows expected results; it does not read a real Arduino.
SIMULATION MONITOR
> distance = 72 cmLED OFF • SILENT
> distance = 38 cmLED ON • ONE BEEP
> distance = 91 cmLED OFF • RESET
- 01Confirm the Arduino board.
- 02Confirm the COM port and firmware.
- 03Check sensor and actuator connections.
- 04Start the PictoBlox program.
- 05Test with a hand or object at different distances.
EXPECTED RESULTSFarther than 50 cm: off and silent. Within 50 cm: LED on and one beep. Move away: off and ready again.
BACKUP WORKFLOW
Blocks missing? No problem.
This Arduino C++ sketch is a backup for a compatible Arduino programming workflow — not PictoBlox visual blocks.
arduino_backup.inoCopy code
MATCHED PINSTRIG 9, ECHO 10, LED 13, buzzer 8.
DISTANCE MATHpulseIn reads echo time; the formula converts it to centimetres.
MEMORYsomeoneNear prevents repeated beeps while an object stays close.
HOW TO USESwitch to a compatible workflow such as Arduino IDE, upload the sketch, then test.
ENGINEER'S DEBUG BAY
Troubleshooting engineers
Find the symptom, check the simplest cause, and test again.
?Sensor block missing
Confirm Arduino Uno and the correct extension. Check support in your PictoBlox version; use the backup when needed.
?Buzzer block missing
Check tone or actuator blocks. Digital HIGH/LOW is not automatically a proper tone.
!LED stays off
Check polarity, resistor, D13, and GND.
!Buzzer does not beep
Check polarity, D8, GND, and the selected programming method.
↺Distance is unreliable
Check TRIG, ECHO, sensor direction, power, and loose connections.
↺Program will not start
Check board selection, COM port, USB cable, and Stage Mode firmware.
MISSION COMPLETE
You designed it. You built it. You programmed it.
Now explain how your smart house detects an approaching visitor.
APPROACH→MEASURE→DECIDE→ALERT
![The completed smart house project]()
✓House constructed
✓Sensor installed
✓LED and buzzer connected
✓Blocks arranged and tested
✓Backup code available
Use ← → arrow keys to navigate