Skip to content
elevatedevco

Robotics & IoT

Building simple robots

Learn Building simple robots: 34 practice questions and answers with an interactive quiz — from the offline AI Learning app.

Intermediate34 questions34 quiz questions

Questions & Answers

Tap a question to reveal its answer. Written for self-study and interview preparation.

What is a robot, and what three basic abilities does a simple robot usually need?

A robot is a machine that can sense its surroundings, make a decision, and then act on its own. The three basic abilities are sensing (using sensors), thinking (using a controller or program), and acting (using motors or other outputs). Together these let a robot respond to the world instead of just doing one fixed motion.

In the 'sense-think-act' loop, what is the job of a sensor?

A sensor gathers information from the environment and turns it into data the robot's computer can read, such as distance, light, or temperature. It is the 'sense' part of the loop. Without sensors, a robot would be blind to the world and could only follow a fixed program.

Which part of a robot is the 'actuator', and what does it do?

An actuator is the part that produces movement or action, such as a motor that spins wheels or a servo that turns a robotic arm. It carries out the 'act' step of the sense-think-act loop. Actuators convert electrical signals from the controller into physical motion.

What is a microcontroller (like an Arduino) in a simple robot?

A microcontroller is a small, cheap computer on a single chip that reads sensors and controls actuators by running a program you upload to it. It acts as the robot's 'brain' for the think step. Boards like Arduino make it easy for beginners to connect sensors and motors and write simple code.

How does an ultrasonic distance sensor help a robot avoid bumping into walls?

An ultrasonic sensor sends out a sound pulse that humans cannot hear and measures how long the echo takes to bounce back. The robot uses that time to calculate the distance to an object. If the distance is small, the program tells the robot to stop or turn before it crashes.

A line-following robot uses sensors that detect light and dark. Why does following a black line on a white floor work well?

A black line absorbs most light while a white floor reflects it, so the sensor gets very different readings over each surface. The robot uses this difference to tell whether it is on the line or off it, then steers to stay on the line. High contrast between line and floor makes the decision reliable.

What is the difference between rule-based control and machine learning in a robot?

In rule-based control, a human writes exact 'if-then' instructions, like 'if distance < 10 cm, turn left'. In machine learning, the robot instead learns patterns from many examples and figures out its own rules. Rule-based is simple and predictable, while machine learning can handle messier situations but needs lots of example data.

Why do robots that use machine learning need 'training data'?

Training data is a collection of examples that shows the robot what the right output is for different inputs, like images labeled 'cat' or 'dog'. The learning algorithm studies these examples to find patterns it can use on new, unseen inputs. Without enough good training data, the robot cannot learn to make accurate decisions.

What is a simple if-then statement, and how might it control a robot motor in Python-like code?

An if-then statement makes the robot do something only when a condition is true, which is the basis of rule-based decision making. For example, the robot can stop its motor when an obstacle is very close. This keeps the robot's behavior clear and predictable.

distance = read_sensor()
if distance < 10:
    stop_motor()
else:
    move_forward()
What does it mean for a robot to be 'autonomous'?

An autonomous robot can make its own decisions and act without a human controlling it moment by moment. It uses its sensors and program to respond to changes in its environment. A remote-controlled car is not autonomous, but a robot that finds its own way around a room is.

Why is a feedback loop important when a robot tries to drive in a straight line?

A feedback loop means the robot keeps checking its actual behavior and correcting any error, instead of just sending one command and hoping. If one wheel drifts, the sensor data reveals the robot is turning, and the program adjusts the motors to straighten out. This constant 'measure and correct' cycle keeps the robot on course.

How can a camera plus machine learning let a robot recognize objects?

The camera captures images, and a trained machine learning model looks at the pixels to predict what object is shown, like a ball or a cup. The model learned these patterns earlier from many labeled training images. The robot can then act differently depending on what it 'sees'.

What is the role of a battery in a mobile robot, and why does its capacity matter?

The battery stores the electrical energy that powers the microcontroller, sensors, and motors so the robot can run without wires. A higher-capacity battery lets the robot operate longer before it needs recharging. Designers must balance battery size and weight against how long the robot needs to work.

What is the difference between a DC motor and a servo motor in robotics?

A DC motor spins continuously and is great for driving wheels, but it does not easily know its exact position. A servo motor can rotate to and hold a specific angle, which is useful for robotic arms or steering. Choosing between them depends on whether you need continuous spinning or precise positioning.

Why might a robot need to combine data from more than one sensor (sensor fusion)?

One sensor alone can be fooled or limited; for example, a camera struggles in the dark while an ultrasonic sensor still measures distance. Combining several sensors gives a more complete and reliable picture of the environment. This idea, called sensor fusion, helps the robot make better decisions.

What is a 'label' in a training dataset used to teach a robot's vision model?

A label is the correct answer attached to an example, such as tagging a photo with the word 'apple'. During training, the model compares its guesses to the labels and adjusts itself to make fewer mistakes. Good, accurate labels are essential because the model can only be as correct as the labels it learns from.

Why is testing a robot in many different conditions important before trusting it?

A robot might work perfectly in one room but fail with different lighting, floors, or obstacles it never saw during testing. Trying many conditions reveals weaknesses so you can fix them before the robot does something wrong. Thorough testing makes the robot safer and more dependable.

In machine learning, what does 'overfitting' mean and why is it a problem for a robot?

Overfitting happens when a model memorizes its training examples too closely instead of learning general patterns. Such a robot does great on data it has seen but performs poorly on new situations. The goal is a model that generalizes, so it still works when the real world looks a little different.

What is a robotic 'arm with degrees of freedom', and what does more degrees of freedom allow?

Degrees of freedom are the number of independent ways a robot arm can move, such as each joint that can rotate or bend. More degrees of freedom let the arm reach more positions and angles, making it more flexible. However, more joints also make the arm harder to build and control.

How does a robot use a simple loop in code to keep checking its sensors?

A loop repeats the same block of instructions again and again, letting the robot continuously read sensors and react. This is how a robot stays responsive instead of acting only once. The loop usually runs the sense-think-act steps over and over.

while True:
    distance = read_sensor()
    if distance < 10:
        turn_left()
    else:
        move_forward()
What is the difference between 'input' and 'output' devices on a robot? Give one example of each.

Input devices bring information into the robot, such as a distance sensor or a button. Output devices let the robot affect the world, such as a motor, an LED light, or a buzzer. The controller reads inputs and decides which outputs to activate.

Why might a robot make a mistake even when its program has no bugs?

The real world is messy: sensors can give noisy or wrong readings, lighting can change, or an object might look different from the training examples. A machine learning model also only predicts likely answers, so it can be wrong sometimes. This is why robots need safety checks and human oversight.

What does 'calibration' mean when setting up a robot's sensor?

Calibration means adjusting or measuring a sensor so its readings match real values accurately. For example, you might tell a light sensor what 'white floor' and 'black line' look like before a race. Good calibration makes the robot's decisions more reliable.

How can a robot 'learn from examples' to sort objects by color without being told exact rules?

You show the robot many labeled examples of each color, and a machine learning model finds the patterns in the color data that separate them. Later, when it sees a new object, it predicts the color based on what it learned. This avoids hand-writing precise color rules for every possible shade.

What is one important safety rule when building and testing a robot with spinning motors or arms?

Keep fingers, hair, and loose clothing away from moving parts and have an easy way to cut power, like an off switch. Spinning gears and arms can pinch or hit you unexpectedly. Always test new code at low speed first and watch the robot carefully.

Why is it useful to start with a flowchart before writing a robot's program?

A flowchart shows the steps and decisions of the robot's behavior as a simple diagram before you write any code. It helps you spot mistakes in your logic and plan the sense-think-act flow clearly. Once the flowchart is correct, turning it into code is much easier.

What is the difference between 'training' a model and 'using' (inferring with) a model on a robot?

Training is the learning phase where the model studies many examples and adjusts itself, which usually needs lots of data and computing power. Using the model, called inference, is when the trained model makes quick predictions on new inputs while the robot runs. Robots are often trained once on a big computer, then just do fast inference on the robot.

How does a wheel encoder help a robot know how far it has traveled?

An encoder counts how many times a wheel turns, and since you know the wheel's circumference, you can calculate distance traveled. This gives the robot feedback about its own movement. It is useful for driving a set distance or keeping two wheels in step.

Why should you think about privacy when a robot uses a camera or microphone?

Cameras and microphones can record people without them knowing, which can invade their privacy. A responsible builder asks permission, avoids storing personal data unnecessarily, and tells people when recording is happening. Thinking about privacy is part of building ethical technology.

What does it mean for training data to be 'biased', and how could that affect a robot?

Biased data means the examples are not balanced or representative, like teaching a robot to recognize hands using only one skin tone. The robot then works well for the examples it saw but poorly for groups it rarely saw. Collecting varied, fair data helps the robot treat everyone and everything more equally.

How can a simple threshold turn noisy sensor numbers into a clear yes/no decision?

A threshold is a chosen cutoff value; if the sensor reading is above it you decide one way, and below it the other. This converts a continuously changing number into a simple decision the robot can act on. Choosing a good threshold often comes from testing and calibration.

light = read_light_sensor()
threshold = 500
if light < threshold:
    print('on the black line')
else:
    print('on the white floor')
What is the advantage of giving a robot 'memory' of past sensor readings instead of only the current one?

Remembering past readings lets the robot detect changes and trends, like noticing it has been stuck against a wall for several seconds. With only the current reading, it cannot tell whether things are getting better or worse. Using a short history helps the robot make smarter decisions.

Why is it a good idea to break a robot's program into small functions like 'move_forward()' and 'read_sensor()'?

Small named functions make the program easier to read, test, and reuse, because each one does a single clear job. If something breaks, you can check just that function instead of the whole program. This also lets you build complex behavior by combining simple, reliable pieces.

def move_forward():
    set_motors(left=100, right=100)

def read_sensor():
    return get_distance()

if read_sensor() > 20:
    move_forward()
What is the main difference between a robot and a regular electric appliance like a toaster?

A toaster always does the same fixed action when you switch it on, with no sensing or decision making about its surroundings. A robot senses its environment and changes its behavior based on what it detects. The ability to sense, decide, and adapt is what makes something a robot.

Put it into practice with AI Learning

This topic — and hundreds more — comes from our free, offline AI Learning app. Practice Q&A, quizzes and cheat sheets anywhere, no account needed.

  • Free
  • No account
  • Works offline
Coming soon toGoogle Play