Learn
Learn Python by driving a robot in your browser. 409 free lessons for GCSE and A level computer science, robot clubs and university robotics. Matched to OCR, AQA, Edexcel and Eduqas.
Open the lessonsGCSE robotics and computer science lessons
The whole GCSE computer science course, matched to the OCR, AQA and Edexcel specifications. Pick this if you are working towards a GCSE.
Robot club: learn robotics for fun
Robots for the fun of it: driving, sensing, vision, behaviours, machine learning and robots that talk to each other. No exam specification, no marking, and…
A level computer science lessons with a robot
The whole A level computer science course, matched to the OCR, AQA and Eduqas specifications. Pick this if you are working towards an A level.
University robotics lessons
Robotics as a degree course teaches it: kinematics, odometry, filtering, control, estimation, mapping, planning and vision, written as programs that run on a…
Guides
One idea at a time, with a robot you can change and run on the page.
A* pathfinding explained
How A* finds the shortest route: g, h and f = g + h, the priority queue, and why the heuristic must never overestimate. Watch it search a mat with…
AprilTags explained
What is printed on an AprilTag, how a camera turns one into a range and a bearing, and how a tag in a known place corrects a robot that has drifted.…
Backpropagation explained
How a neural network shares out the blame for a wrong answer: the chain rule in plain words, one weight's share worked out in full, and why it is…
Behaviour trees explained
How games and robots organise behaviour in a tree: condition and action leaves, sequence and selector nodes, and what ticking from the top every…
Breadth-first and depth-first search explained
Breadth-first vs depth-first search explained with live robot demos: a stack or a queue, why BFS finds the shortest path and DFS may not, BFS vs DFS…
Big O notation explained
What Big O notation measures, what each of the common orders does when the data doubles, and what the notation throws away. Programs in your browser…
Bug algorithms: getting to a goal without a map
How a robot reaches a goal with no map, by driving at it and following the edge of whatever gets in the way. Bug 0, Bug 1 and Bug 2 compared, each…
HSV colour detection explained
Why a red > 150 test finds the whole room, what hue, saturation and value each measure, and how a ratio survives a change of light. Four demos run a…
Convolutions and CNNs explained
What a convolution is: a small kernel slid over a picture, what edge and blur kernels do to it, what a feature map holds, and why a CNN beats giving…
Dead reckoning and odometry explained
How dead reckoning and robot odometry work: the formula, why odometry drifts (noise, scale, gyro bias), how calibration and landmark fixes correct…
Differential drive kinematics explained
How two wheel speeds become a forward speed and a turn rate, where the instantaneous centre of curvature sits, and why a two wheeled robot has to…
Dijkstra's algorithm explained
The steps of Dijkstra's algorithm, a worked example traced in a table, and a robot that floods a mat to find the cheapest route round two walls.…
Distance sensors compared: ultrasonic, infrared and time of flight
What ultrasonic, infrared and time-of-flight sensors each measure, where each one fails (soft surfaces, sunlight, glass) and what a beam width costs…
Extended Kalman filter explained
Why a straight Kalman filter cannot take a range or a bearing, what linearising means, and what the Jacobian is, with all four entries of a 2 by 2…
Feedforward control explained
Why a proportional controller is always behind a moving target, and how sending the command the model already knows is needed fixes it. Runnable…
The fetch decode execute cycle explained
What a processor does with one instruction: the program counter, the MAR, MDR, CIR and accumulator, the three buses, and what a clock speed really…
Finite state machines explained
What a finite state machine is, how to draw its state transition diagram and table, and Mealy vs Moore, shown on a traffic light and a robot that…
Gradient descent explained
What gradient descent is, what the loss, the gradient and the learning rate each do, and what a rate that is too small or too big looks like. A…
Gyroscope vs accelerometer
What a gyroscope and an accelerometer each measure, why adding a turn rate up drifts while an absolute reading only jitters, and what a…
Hash tables explained
How a hash function turns a key into a slot, why look-up is about O(1), what a collision is and what the load factor costs. Programs in your browser…
How do robot vacuums know where to go?
How a robot vacuum finds its way round a room: bump and go, wall following and spirals, then knowing where it is, mapping the room and planning…
How do robots see and move?
How robots see and move, explained simply: time-of-flight distance sensors, depth grids, cameras and bump sensors, the motors that move them, and…
How transformers work: attention, with the numbers in it
Attention explained on numbers you can see: a robot's last twenty sensor readings, one query, twenty keys and values, the scores, the softmax and…
k-nearest neighbours explained
How the k-nearest neighbours algorithm classifies: distance to labelled examples, a vote among the k closest, and how k, scaling, wrong labels and…
Kalman filters explained
What a Kalman filter does, what the Kalman gain, Q and R each change, and how it fuses two sensors, shown on a robot measuring a wall with a noisy…
Line following robots explained
How a line following robot works: find the line, measure the error, turn to correct it. Run bang-bang, proportional and PD line follower code on a…
Linear search and binary search explained
Linear search and binary search for GCSE Computer Science: how each works, why binary search needs sorted data, and how many steps each takes. Watch…
Logic gates and truth tables explained
What each logic gate does, how to fill in a truth table in binary order, and how a safety rule written in English becomes a circuit. Four demos run…
LQR control explained
What a linear quadratic regulator is: price the error and the effort, and the gains fall out of the arithmetic instead of out of hand tuning. Drive…
Maze solving robots explained
How a maze solving robot finds the way out: the left hand rule, why it fails on some mazes, flood fill as used in micromouse, and planning the…
Model predictive control explained
What MPC does each tick: keep a model, try a set of plans a second or two ahead, score them against a cost, drive the first step of the best one.…
Motion profiles: trapezoidal and s-curve
How a trapezoidal profile splits a move into speeding up, cruising and slowing down, how to work out the time and distance of each phase, and what…
Moving average and low-pass filters explained
How a moving average and an exponential low-pass filter smooth noisy sensor readings, what the window size and alpha change, why a median copes with…
Neural networks explained
What a neural network is: inputs, weights, a bias and an activation, then training by gradient descent, shown on a robot that steers from its depth…
Occupancy grid mapping explained
How a robot builds an occupancy grid map from range readings: the inverse sensor model, log odds, binary grids and frontier exploration, with four…
Forward and inverse kinematics for omni wheel robots
How a holonomic robot with omni wheels moves in any direction: robot and world frames, the rotation matrix, and the X-drive forward and inverse…
Overfitting explained
What overfitting and underfitting look like, and how more data, fewer parameters and early stopping each help, shown on a robot that measures how…
Particle filters explained
How a particle filter works out where a robot is: scatter guesses, move them with the robot, weigh them against a sensor reading and resample. Watch…
PID control explained
What a PID controller does, what Kp, Ki and Kd each change, and how to tune one, shown on a robot turning to face a direction. Change the numbers,…
Potential field path planning explained
How artificial potential fields steer a robot: an attractive pull to the goal, repulsive pushes from obstacles, and the local minima where it gets…
Pure pursuit path following explained
How pure pursuit steers a robot along a path: the look-ahead point, the arc formula 2 sin a / L, cross-track error and how to choose the look-ahead…
PWM and motor control explained
How a percentage in a program becomes power at a motor: pulse width modulation, duty cycle, the dead band at the bottom, the ceiling at the top and…
Q-learning explained
How Q-learning works: states, actions, rewards, the Q table, the update rule and epsilon-greedy exploration, shown on a robot learning to wander a…
Recursion explained
A function that calls itself, the base case that stops it, the call stack that holds the calls that are waiting, and the backtracking that solves a…
Reward shaping explained
Why a sparse reward teaches a robot nothing, how shaping speeds learning up, and how a sensible looking reward gets gamed. Three searches with three…
RRT path planning explained
How a rapidly exploring random tree (RRT) finds a path: sample a point, extend the nearest node towards it, check for collisions, repeat. Watch the…
Sim to real: why a policy that works in simulation fails on the robot
What a simulator leaves out, and what it does to a controller tuned inside one: friction, delay, noise and every robot being different. Tune a…
SLAM explained: simultaneous localisation and mapping
Why a map needs a position and a position needs a map, and how a robot solves both at once. Three demos build an occupancy grid while the robot…
Sound sampling explained
How sound is stored as numbers for GCSE Computer Science: sampling, sample rate, bit depth and working out file size. See a sensor sampled fast and…
Stacks and queues explained
The difference between a stack and a queue, what push, pop, enqueue and dequeue do, and what each structure is for. A robot runs the same five…
Trace tables explained
How to complete a trace table for GCSE Computer Science: a column per variable, the output, and a new row when a value changes. Watch a robot…
Two's complement explained
How a byte holds a negative number: sign and magnitude and why it is awkward, two's complement, negating by flipping and adding 1, and what overflow…
Types of machine learning explained
What supervised, unsupervised and reinforcement learning are each given, what each produces, and which robot jobs suit which. The same robot problem…
AQA A level skeleton program 2027 explained: Piles O' Tiles
The June 2027 AQA Paper 1 skeleton program taken apart: what Piles O' Tiles does, the four classes and how they fit, one turn through the main loop,…
Python challenges
Every task in the course as a challenge you can open straight away, marked as you go: GCSE, A level, robot club and university.
Past papers
Real exam questions worked through step by step, each with a program you can run: past paper questions.
Glossary
Every term the lessons use, defined in plain words and linked to the lesson that teaches it: the glossary.
By exam board
- OCR GCSE Computer Science (J277) 26 of 26 sections
- AQA GCSE Computer Science (8525) 35 of 35 sections
- Pearson Edexcel GCSE Computer Science (1CP2) 66 of 66 sections
- OCR A Level Computer Science (H446) 24 of 24 sections
- AQA A-level Computer Science (7517) 151 of 151 sections
- WJEC Eduqas A Level Computer Science (A500QS) 16 of 16 sections