Home · Academy · Robotics & Coding · What Are Robotics and Coding?

What Are Robotics and Coding?

Coding tells a system what to do with clear steps; robotics carries those instructions into the physical world with sensors, electronics and motion.

LESSON COMPASS

What will you use this page for?

Core idea

Robotics combines mechanics, electronics, sensing, control software, power and a user purpose in one system.

Evidence to produce

Turn one robot example into a block diagram covering input, process, output, power, mechanics and safety.

Control trap

Calling every moving automatic device a robot or reducing robotics to code alone.

Next connection

Use the Algorithms module to turn behaviour into explicit, testable steps.

Module sources: Arduino Learn · micro:bit lessons

LevelBeginner
Age10–16
Duration35–50 min
PrerequisiteNone
ContentIn-depth guide · 1,828 words
Last updated

One-sentence summary

Coding is how we tell a system what to do using clear, ordered steps; robotics is how those instructions are carried out in the physical world through sensors, electronic parts and moving mechanisms.

What will you learn in this lesson?

By the time you finish this lesson, you should be able to:

Why does it matter?

When we look at a robot, the first thing we usually notice is that it moves. But movement is only the visible last step. A robot first gathers information from its surroundings, then weighs up that information, and only after that produces a response. Coding builds the decision logic; the electronic parts carry the information; and the mechanical system performs the movement.

Learning robotics and coding together teaches more than how to build a device. It also teaches you to describe a problem clearly, to break a solution into small pieces, to try things out, to measure, and to fix mistakes.

What is coding?

Coding is the work of telling a computer, phone, game character or control board which steps to follow, using a particular programming language.

Imagine we want a game character to move forward when the right arrow key is pressed. As people, saying "go right" might seem enough. A computer, though, needs clearer logic:

If the right arrow key is pressed
  increase the character's x position by 10

This short example holds three important ideas:

  1. An event happens: the right arrow key is pressed.
  2. The system checks a condition.
  3. The character's position is changed.

Programming languages can look very different, but the core idea is the same: take an input, process it according to a rule, and produce an output.

What is robotics?

Robotics is the field concerned with building machines in which software, electronics and mechanical systems work together to sense their surroundings, make decisions and carry out a task.

A robotic system usually has these three stages:

1. Sensing

The system gathers information from its surroundings. It does this with sensors.

Examples:

2. Deciding

The control unit weighs up the information from the sensor according to the rules in the code.

If the distance is less than 15 centimetres
  stop
  turn right
Otherwise
  go forward

An Arduino, a micro:bit or a similar microcontroller can run this decision part.

3. Movement or output

The system passes the result of the decision into the physical world.

We can show these three stages in a short form like this:

SENSE → DECIDE → MOVE

The basic parts of a robot

Control unit

This is the robot's decision centre. It takes information from the sensors, runs the program, and controls the outputs. The Arduino and the micro:bit are examples of boards used for this purpose.

Sensors

These let the robot understand its surroundings. Without sensors, a robot cannot notice changes in the outside world.

Actuators

These are the parts that turn electrical energy into movement, sound or another physical output. A motor, a servo, a buzzer and some light systems are examples of actuators.

Power source

This supplies the energy the system needs to work. A battery or a suitable low-voltage adapter can be used. The voltage and current of the power source must match the board and components being used.

Mechanical structure

The chassis, wheels, connecting parts, gears and supporting body make up the robot's physical structure.

Software

This is the set of instructions that decides what the robot does in each situation.

Is every automatic machine a robot?

No. A device working automatically does not always make it a robot.

For example, a simple lamp that only switches on and off at set times can be automatic. But if it does not gather information from its surroundings and change its behaviour based on that information, whether it counts as a robotic system is open to debate.

A robotic system usually has some or all of the following:

Everyday examples of robotic systems

Robot vacuum

Automatic door

Smart irrigation system

Line-following robot

The difference between coding and robotics

Coding on its own can create a game, a calculation tool or a web page that runs on a screen. Robotics combines the code with physical components.

The difference between coding and robotics table
CodingRobotics
Mostly softwareIncludes software + electronics + mechanics
The output can be on a screenThe output can be physical movement or a measurement
A computer may be enoughA board, sensors, motors and power may be needed
Mistakes are mostly in the codeA fault can be in the code, the wiring, the power or the mechanics

These two fields are not separate from each other. A good robotics project needs a clear algorithm and correct code.

Mini activity: design a smart night light

Goal: the LED lights up when the surroundings become dark, and switches off when they become bright.

The pieces to think through

Pseudocode

Start
Measure the light level
If the light level is less than 30
  turn the LED on
Otherwise
  turn the LED off
Repeat the measurement

Questions to think about

These questions show why testing and calibration matter in robotics.

Common mistakes

Thinking a robot is just a machine that moves

Even if a system does not move, it can still be a robotic system if it senses its surroundings, makes a decision and produces an output.

Not defining the problem before starting to code

"I am going to build a robot" is a very broad goal. "I am going to build a vehicle that stops 15 centimetres before an obstacle in front of it" is a clearer and more testable problem.

Overlooking the power source

The wrong voltage can damage the board or a component. Motors sometimes draw more current than the control board can supply. For this reason, a motor driver and a suitable power plan may be needed.

Looking for every fault in the code

In robotic systems, a problem does not come only from the code. A wire may be loose, a sensor connected the wrong way round, a battery weak, or a wheel jammed.

Safety note

The physical activities in this academy should only be carried out with safe, low voltage. Do not interfere with mains electricity, sockets or exposed wiring. Any work involving batteries, motors, soldering, cutting tools or hot surfaces needs adult supervision.

Review questions

  1. What are the three basic stages of a sense–decide–act system?
  2. Why is coding only one part of a complete robot?
  3. What makes a project goal testable?
  4. Which low-voltage safety habits belong in every electronics activity?
  5. Why is a failed first prototype useful evidence?
  6. What separates an educational project idea from a verified personal achievement?

Answers

  1. A sensor gathers input, a controller evaluates it with rules or a model, and an actuator produces a physical or visible output.
  2. A robot also depends on mechanics, power, electrical connections, sensors, actuators and safe physical design.
  3. It states an observable result, conditions and a measurable threshold rather than a vague wish.
  4. Disconnect power while wiring, check polarity and current limits, prevent shorts, use appropriate components and seek adult supervision when required.
  5. It reveals assumptions, boundary conditions and design weaknesses that can guide a controlled next change.
  6. A verified achievement has real build records, test evidence and approved media; an unbuilt idea must remain labelled as a proposed learning project.

Lesson summary

Check test

  1. What is coding for?
  2. What is the job of a sensor?
  3. Is a servo motor a sensor or an actuator?
  4. Explain a robot's "sense–decide–move" loop with an example.
  5. Why is not every automatic device counted as a robot?
  6. In a robotic system, which four different areas can a fault come from?
  7. In the smart night light, what are the input, the decision and the output?

Answers

  1. It tells a computer or control system the steps to follow and the decision rules to apply.
  2. It gathers data from the surroundings or from the system.
  3. It is an actuator; it produces a physical position based on the command it is given.
  4. For example, a distance sensor measures an obstacle, the board decides to stop if the distance is small, and the motors stop.
  5. Because a device that works only on a timer may not sense its surroundings or make decisions based on conditions.
  6. The code, the electronic wiring, the power source and the mechanical structure.
  7. The input is the light reading, the decision is whether the surroundings are dark, and the output is the LED switching on or off.

Source and verification note

For “What Are Robotics and Coding?”, verification focuses on whether the relationship between What will you learn in this lesson? and What is robotics? remains consistent across examples. The algorithms in this lesson are checked by tracing sample inputs by hand and comparing them with expected outputs. Pseudocode is used to make the reasoning sequence visible without tying it to one programming language.

End-of-lesson check

  1. How would you define What Are Robotics and Coding? in your own words?
  2. What is one normal use of the structure learned in this lesson?
  3. Which boundary or unexpected case would you test?
  4. How could you detect and correct one likely mistake?
  5. How would you adapt the same idea to another robotics or coding project?

End-of-lesson check — sample answers

  1. A good definition explains both the main idea and its purpose.
  2. The example should identify the input, the process and the resulting output.
  3. A boundary test can use the lowest or highest accepted value; an unexpected test can use missing or invalid input.
  4. Compare expected and actual results, change one thing at a time and repeat the test.
  5. Find the rule that remains the same, then adapt the steps to the new project’s input, tool and output.

Next lesson

What Is an Algorithm? — Learn how we set up the clear steps that a robot or a computer can carry out.

Start QuizBack to section
QUESTION POOL

Reinforce this lesson with 10 questions

This lesson has a pool of 20 questions. Each attempt selects 10 and reshuffles the choices.