Connecting to Real Robots in Scratch: Simulation or Arduino
Connect Scratch to real robots: Use PictoBlox or Arduino to control LED/motors. Simple guide with steps and images.
6- Linking with real robots in Scratch
Welcome back! So far we’ve built digital projects inside Scratch. Today we bridge to the real world: connect Scratch to an **Arduino** board (or simulation) to control lights, motors, or small robots. This step turns programming from screen play into physical control.
Options for Connecting
| Option | Difficulty | What You Need | Best For |
|---|---|---|---|
| Simulation inside Scratch (no hardware) | Very easy | Scratch only | Beginners without hardware |
| PictoBlox (Scratch 3.0 with Arduino) | Easy-medium | Arduino Uno + USB + free PictoBlox | Kids and beginners |
| Scratch for Arduino (S4A) – Scratch 2.0 | Medium | Arduino + S4A | Simple projects |
We recommend **PictoBlox** because it supports Scratch 3.0, is user-friendly, and has good beginner support.
Today’s Project: Control an LED from Scratch via Arduino
Goal: Press a key in Scratch → a physical LED connected to Arduino lights up.
Step-by-step instructions (using PictoBlox):
- Download PictoBlox for free: https://thestempedia.com/product/pictoblox/ (Windows/Mac/Linux).
- Connect your Arduino Uno board to the computer via USB (drivers usually auto-install).
- In PictoBlox: Select “Board” → “Arduino Uno” → click “Connect”.
- Add a sprite and start a script:
- When green flag clicked → forever
- If space key pressed → set digital pin 13 to HIGH (turns on built-in LED on Arduino)
- Else → set digital pin 13 to LOW
- Test: Press space in PictoBlox → the LED on the board lights up!
- For external LED: Connect LED to pin 9 + 220Ω resistor + ground, then change pin to 9 in the block.
Congratulations! You’re controlling real hardware from Scratch.
Extra Experiments
- Motor control: Use PWM pins for speed.
- Simple robot car: Connect two motors → use “run motor” blocks for forward/backward.
- Sensor: Add light sensor → if light low → turn on LED.
- No hardware: Use PictoBlox simulator to test code virtually.
“Start with one LED project, then add one component at a time. Real robotics needs patience and testing.”
In the final article we give tips for parents/teachers + advanced home projects and your next steps.
→ Read Article 7: Tips for Parents and Teachers + Advanced Home Projects
Watch a short educational video that explains the lesson in action
Tip: If you’d like Arabic subtitles (ترجمة عربية), click the CC button at the bottom right of the video.
Then click the gear icon ⚙️ → Subtitles/CC → Auto-translate → select Arabic.
This works on most videos with auto-generated captions.
(Short video focused on basic setup for connecting Scratch to Arduino – perfect starting point)







