Learning Center

Beginning Robotics Programming: From Scratch to Arduino to Python

🤖 Robotics DeskBy Servo Sam 8 min read
Tamiya Microcomputer Robot Kit Wheeled Type with BBC micro:bit
Hobbyists since 1978 Written by our staff who race, fly and build Questions? 678-513-4450
🤖 Robotics DeskBy Servo SamUpdated May 29, 20269 min read
Tamiya Microcomputer Robot Kit Wheeled Type with BBC micro:bit
Tamiya's Microcomputer Robot runs on a BBC micro:bit, which makes it a handy bridge from block code to real hardware. — view at Atlanta Hobby

Every robot starts life as a very expensive paperweight. The motors, wheels and sensors only turn into a robot when somebody tells them what to do, and the "somebody" is usually a kid with a laptop and a lot of questions. The good news is that the path from "my first loop" to "my robot avoids the dog" is well worn. The bad news is that most families start at the wrong step, either with a text language that frustrates a seven-year-old or with drag-and-drop blocks that bore a fourteen-year-old.

This guide lays out the ladder we coach students up at the robotics desk: picture blocks, then logic blocks on a real microcontroller, then Arduino C++, then Python on hardware. For each rung you get the ages it fits, the free tools, the board to plug in, and a first project that actually moves something. Specs and age ranges come from the publishers' own pages, linked as we go.

The Short Answer

Start with block coding (ScratchJr for ages 5 to 7, Scratch for 8 and up), make it physical with a BBC micro:bit, then move to Arduino C++ for direct hardware control and MicroPython when typed code clicks.

  • Blocks first: they teach loops, conditionals and variables without typos getting in the way.
  • Go physical early: a micro:bit runs block code, JavaScript or Python, so one board covers several steps.
  • Arduino next: the classic UNO teaches pins, timing and libraries with thousands of examples to copy and modify.
  • Python last (or alongside): MicroPython puts Python 3 on boards like the micro:bit, Raspberry Pi Pico and Arduino Nano ESP32.

1. Stage One: Blocks Teach the Thinking

Programming a robot is mostly logic: do this, repeat that, react when a sensor changes. Block editors teach exactly that, and they make syntax errors impossible because the pieces only snap together in legal ways. Here is the full ladder before we climb it.

Stage Ages Tool What it teaches Good first robot task
1. Picture blocks 5-7 (MIT's range) ScratchJr Sequence, cause and effect Make a character drive across the screen and stop
2. Logic blocks 8 and up (MIT: 8-16) Scratch, MakeCode for micro:bit Loops, if/else, variables, events Back up and turn when a sensor sees a wall
3. Typed C++ About 11+ (our pick) Arduino IDE Syntax, pins, timing, libraries Steer a servo with a potentiometer
4. Typed Python About 12+ (our pick) MicroPython (micro:bit, Pico, Nano ESP32) Functions, lists, live testing at a prompt Log sensor readings and react to thresholds

ScratchJr vs Scratch

MIT's Scratch FAQ says Scratch is "designed especially for young people ages 8 to 16," and points younger kids to ScratchJr, "a simplified version of Scratch designed for ages 5 to 7." ScratchJr uses picture blocks, so a pre-reader can still build a sequence. Scratch adds variables, broadcasts, math and sensing, which are the parts that matter for robots later.

Make the blocks move something

Screen-only coding gets stale fast. The micro:bit Educational Foundation lists official ways to program its board that include Microsoft MakeCode blocks, a Python editor, and Scratch integration. In MakeCode you can "switch to JavaScript to see the text-based code behind the blocks," which is a gentle first look at typed code. The board has buttons, LEDs and sensors built in, so a first program can react to a shake or a button press with no wiring at all.

The concepts to check off

Before moving on, a student should be able to explain four ideas in their own words: a loop (forever, or repeat 10), a conditional (if the distance is under 10 cm, turn), a variable (a score or a speed setting), and an event (when button A is pressed). If they can build a program that uses all four, they are ready for hardware that does not hold their hand.

A robot that bridges the gap

Tamiya's Microcomputer Robot (Wheeled Type) is one way to get there with real gears. It ships with a BBC micro:bit preloaded with an obstacle-avoiding program, uses an ultrasonic sensor and two Type 130 motors, and runs on two AA batteries (not included). Once it is built, students can rewrite its behavior in the free MakeCode block editor. Plan on a computer, an internet connection and a micro USB cable for the coding part.

Tamiya Microcomputer Robot Kit Wheeled Type with BBC micro:bit
The Tamiya Microcomputer Robot includes a micro:bit, so the same kit takes a student from building to block coding. View at Atlanta Hobby

2. Stage Two: Arduino and Real C++

Arduino is where a student stops dragging blocks and starts typing. Every sketch has a setup() that runs once and a loop() that runs forever, and the Arduino IDE compiles that C++ and uploads it over USB. The official built-in examples are public domain, so kids can open one, change a number and watch what happens.

Which board to start with

The classic UNO R3 uses an ATmega328P at 16 MHz with 32 KB of flash, 2 KB of SRAM and a 20 mA limit per I/O pin, according to Arduino. The newer UNO R4 Minima keeps the same footprint but moves to a Renesas RA4M1 (Arm Cortex-M4) at 48 MHz with 256 KB of flash, 32 KB of SRAM and a USB-C port. Either is fine for a beginner; most starter tutorials are written for the UNO layout.

Three first sketches, in order

  1. Blink. Turns the on-board LED (pin 13 on the UNO) on and off once a second. Change the delay(1000) values and you have written your first edit.
  2. AnalogReadSerial. Wire a potentiometer to A0, open the Serial Monitor and watch the number move. This is how a robot "sees" a sensor.
  3. Knob. The Servo library example reads the potentiometer (0 to 1023), uses map() to scale it to 0 to 180 degrees, and moves a servo to match. That is a robot joint under your control.

Power the servos properly

The Arduino Servo library notes that servos "draw considerable power," and recommends a separate supply if you drive more than one or two, with the grounds tied together. A standard servo such as the Hitec HS-311 is rated up to 800 mA at stall, which is far more than a USB port wants to give. Brownouts that reset the board in the middle of a move are the number one "my code is broken" ticket we see, and the code is almost never the problem.

What C++ teaches that blocks can't

Typed code forces precision: semicolons, braces, data types like int and float, and reading compiler errors. That frustration has a payoff. Students learn to read documentation, include libraries, and debug by printing values to the Serial Monitor, which are the same habits they will use in any language.

Hitec HS-311 standard size servo
A standard servo like the Hitec HS-311 is the classic first output for the Arduino Knob and Sweep examples. View at Atlanta Hobby

3. Stage Three: Python on a Microcontroller

Python is the language many students meet in school, and MicroPython brings it to small boards. The Raspberry Pi documentation describes MicroPython as "a full implementation of the Python 3 programming language that runs directly on embedded hardware," with an interactive prompt over USB.

Where it runs

Three easy entry points: the micro:bit Python editor in a browser; the Raspberry Pi Pico, where you hold BOOTSEL while plugging in and copy a MicroPython UF2 file to the drive that appears; and the Arduino Nano ESP32, which launched in July 2023 with both Arduino and MicroPython support. The classic UNO R3 is too small for MicroPython, which is one reason it stays a C++ board.

Why the prompt matters

With C++, every change means compile, upload, wait. With MicroPython, a student can type one line at the prompt to read a sensor or flip a pin and see the result instantly. That makes it very good for experimenting with thresholds and calibration, and for students who already know Python from class.

Arduino or Python: which one first?

For a robot that needs tight timing, lots of example code and the widest choice of shields, start with Arduino C++. For a student who already knows Python, or a project that is more about logic and data than precise motor timing, MicroPython gets results faster. Many of our students learn both, and the concepts from Stage One carry straight across.

A twelve-week plan

A pace that works for a motivated 11- to 14-year-old: weeks 1 to 3 in Scratch or MakeCode building games and micro:bit reactions; weeks 4 to 8 on Arduino with LEDs, a potentiometer, a servo and a distance sensor; weeks 9 to 12 rebuilding one of those projects in MicroPython. Rebuilding the same project in a new language is the fastest way to see what is language and what is logic.

Conclusion

The order matters more than the tool. Blocks build the logic, a micro:bit makes it physical, Arduino teaches precise control of pins and timing, and Python adds speed of experimenting. Skip a rung and you usually end up climbing back down to it. Let the student's frustration level, not their age, decide when to move up.

Need a robot to code, servos for a first Arduino arm, or advice on where your student should start? Stop by our Cumming showroom, browse our robotics kits and servos, or contact us with questions.

Gear Mentioned in This Guide

Tamiya Microcomputer Robot Kit Wheeled Type with BBC micro:bit

Tamiya Microcomputer Robot Kit, Wheeled Type

Build it, run the preloaded obstacle-avoid program, then rewrite it in block code on the included micro:bit.

Shop now
Hitec HS-311 standard size servo

Hitec HS-311 Standard Servo

The classic first servo for an Arduino Knob or Sweep sketch.

Shop now
Hitec HS-81 micro analog servo

Hitec HS-81 Micro Servo

Small and light for grippers, sensor turrets and desk-sized robots.

Shop now
Hitec HS-485HB standard servo with Karbonite gears

Hitec HS-485HB Standard Servo

A sturdier standard servo with Karbonite gears and a ball bearing for arms that get bumped.

Shop now

Frequently Asked Questions

What age should a child start coding robots?

Children as young as 5 can start with ScratchJr, which MIT designed for ages 5 to 7. Scratch is aimed at ages 8 to 16. In our experience, typed languages like Arduino C++ usually click around 11 or 12, depending on reading and typing comfort.

Is Arduino or Python better for beginners?

Both work. Arduino C++ has the most robot examples and precise timing, so it is a strong first typed language for hardware. MicroPython is easier to experiment with because of its interactive prompt, and it suits students who already know Python.

Can Scratch control a real robot?

Yes. Scratch extensions can program physical devices such as the BBC micro:bit. The micro:bit can also be coded in MakeCode blocks, JavaScript or Python, so it covers several stages with one board.

Which Arduino board should I buy first?

An UNO-style board is the standard starting point because most tutorials use its pin layout. The UNO R3 uses an ATmega328P at 16 MHz; the UNO R4 Minima uses a faster 48 MHz Arm chip with more memory and USB-C. Either handles beginner projects.

Can an Arduino UNO run Python?

Not the classic UNO R3; it is too small for MicroPython. Boards like the Raspberry Pi Pico, the BBC micro:bit and the Arduino Nano ESP32 run MicroPython.

Why does my Arduino reset when the servo moves?

Usually the servo is pulling too much current from the board's 5V supply. Power servos from a separate supply sized for their stall current and connect its ground to the Arduino ground.

Sources and Further Reading

Atlanta Hobby

Talk to a real hobbyist.

Our staff have been racing, flying and building since 1978. Call, stop by the store, or bring it in for repair.