Robotics Lecture Series: Lesson 2

Robotics Lecture Series

Robotics Lecture Series Lesson 2 - Controllers and Sensors

Robotics Lecture Series: Lesson 2 - Controllers (The Robot Brain) and Sensors

Subtitle: Understanding the brain and senses of a humanoid robot — microcontrollers, single-board computers, and how robots perceive the world.

Controllers – The Robot Brain

A robot needs a brain to make decisions. When a sensor detects something, the brain decides what to do.

Example:

Obstacle Detected → Controller → Stop Motor / Turn Right / Continue Moving

Without a controller, a robot is just metal and motors.

Types of Robot Brains

1. Arduino

Think of Arduino as a simple nervous system.

Advantages:

  • Cheap
  • Easy to learn
  • Great for beginners

Used for: Reading sensors, Controlling motors, Learning robotics

Popular board: Arduino Uno

2. ESP32

A more powerful microcontroller.

Advantages:

  • Built-in Wi-Fi
  • Built-in Bluetooth
  • More processing power than Arduino Uno

Used for: IoT robots, Mobile-controlled robots, Wireless sensors

Many hobby robots use ESP32 today.

3. Raspberry Pi

A small computer. Unlike Arduino, it can:

  • Run Linux
  • Run Python
  • Process camera images
  • Run AI models

Popular board: Raspberry Pi 5

Microcontroller vs Computer

FeatureArduinoRaspberry Pi
Runs LinuxNoYes
Boots instantlyYesNo
Camera processingLimitedExcellent
AI applicationsLimitedGood
CostLowHigher

How Future Humanoids Work

A humanoid often has multiple brains.

Low-Level Brain (Arduino/ESP32): Handles motors, sensors, real-time control.

High-Level Brain (Raspberry Pi or industrial computer): Handles vision, AI, speech, navigation.

Example Architecture for Your Future Humanoid

Camera → Raspberry Pi (Decision Making) → ESP32 Controllers → Motors

This is similar to how many advanced robots are designed.

What I Would Buy First

For your learning journey:

  1. Arduino Uno
  2. Breadboard Kit
  3. Servo Motor
  4. Ultrasonic Sensor

After a few months:

  1. ESP32
  2. Raspberry Pi
Important Engineering Principle: When building a robot, never choose the most powerful component first. Choose the simplest component that can solve the current problem. Professional engineers follow this rule constantly.

Combined Review Quiz

  1. Q1 What does voltage represent?
  2. Q2 What is the unit of current?
  3. Q3 Which is more important for lifting heavy objects? • Speed • Torque
  4. Q4 Which battery type is commonly used in drones?
  5. Q5 Which controller would you use first as a beginner? • Arduino • Raspberry Pi
  6. Q6 Which device can run Linux? • Arduino Uno • Raspberry Pi

Your First Milestone

Before Lesson 4, I want you to achieve this:

  • ✅ Install Arduino IDE
  • ✅ Understand Lessons 1–3
  • ✅ Answer the quiz

We go deeper for Arduino, ESP32, Raspberry Pi. Understanding the difference between Arduino, ESP32, and Raspberry Pi is one of the most important foundations in robotics.

Imagine You Are Building a Humanoid

Think of the robot like a human body.

HumanRobot
BrainController/Computer
EyesCamera
EarsMicrophone
MusclesMotors
NervesWires
MemoryStorage

1. Arduino

What is Arduino? Arduino is a microcontroller board. A microcontroller is a tiny computer designed to do one job repeatedly.

Example: If obstacle detected → Stop motor. Arduino can execute this loop thousands of times every second.

Advantages: Cheap, Easy to learn, Great for robotics beginners, Huge community

Limitations: No camera processing, Cannot run Linux, Cannot run AI models, Very little memory

Typical Specifications (Arduino Uno):

  • CPU: 16 MHz
  • RAM: 2 KB
  • Flash Memory: 32 KB

For comparison, your laptop probably has 8–16 GB RAM — millions of times more.

Typical Uses: Reading sensors, Controlling motors, Home automation, Small robots

2. ESP32

ESP32 is like Arduino's stronger and smarter cousin.

What Makes ESP32 Special? Built-in Wi-Fi and Bluetooth. No extra module required.

Example: Phone controls robot via Bluetooth → ESP32 → Motors. This is extremely common.

Advantages: Fast, Cheap, Wi-Fi, Bluetooth, More memory

Limitations: Not suitable for advanced AI, Camera processing is limited

Typical Specifications:

  • CPU: up to 240 MHz
  • RAM: ~520 KB

Typical Uses: Smart robots, IoT devices, Wi-Fi sensors, Mobile-controlled robots

3. Raspberry Pi

Now we move from microcontrollers to an actual computer.

What is Raspberry Pi? A complete Linux computer the size of a credit card. You can run Linux, Python, connect a monitor, keyboard, use a camera, and run AI software.

Example: Humanoid sees a bottle → Camera → Raspberry Pi → OpenCV → Identifies bottle → Commands arm. Arduino cannot do this.

Advantages: Runs Linux, Supports Python, Supports AI, Supports cameras, Supports ROS2

Limitations: More expensive, Uses more power, Longer boot time

Typical Specifications (Raspberry Pi 5):

  • CPU: Quad Core ARM
  • RAM: 4–16 GB

Comparison

FeatureArduinoESP32Raspberry Pi
Beginner Friendly⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
CostLowLowMedium
Wi-FiNoYesYes
BluetoothNoYesYes
LinuxNoNoYes
Camera ProcessingNoLimitedExcellent
AINoLimitedYes
Motor ControlExcellentExcellentGood

Which One Will Your Humanoid Use?

Eventually: Camera → Raspberry Pi (AI & Vision) → ESP32 Controllers → Motors

What I Recommend For You

First Purchase: 1. Arduino Uno, 2. Breadboard, 3. Servo Motor, 4. Ultrasonic Sensor

Second Purchase: 5. ESP32

Third Purchase: 6. Raspberry Pi 5

This sequence saves money and teaches concepts in the correct order.

Teacher's Assignment

Imagine your future humanoid sees a box and decides to pick it up. Tell me:

  1. Which device would handle camera image processing?
  2. Which device would handle AI decision making?
  3. Which device would handle reading a distance sensor?
  4. Which device would handle moving the arm motor?

Answer in your own words. Don't worry if you're wrong; the goal is to think like a robotics engineer.

Sensors – How Robots See, Hear, and Feel

A robot without sensors is like a human with closed eyes and ears. Sensors provide information about the environment.

Human vs Robot Sensors

Human OrganRobot Sensor
EyesCamera
EarsMicrophone
SkinTouch Sensor
Inner Ear (balance)IMU
Sense of distanceUltrasonic/LiDAR

1. Ultrasonic Sensor (Robot's Distance Vision)

A very popular sensor for beginners is the HC-SR04 ultrasonic sensor.

How it works:

  1. Sends a sound wave.
  2. Sound hits an object.
  3. Sound returns.
  4. Sensor calculates distance.

Similar to how bats navigate.

Applications: Obstacle avoidance, Distance measurement, Robot navigation

Typical range: 2 cm to 400 cm

2. Infrared (IR) Sensor

Uses infrared light.

Applications: Line follower robots, Obstacle detection, Proximity sensing

Example: A robot follows a black line on the floor.

3. Camera (Robot Eyes)

A camera allows robots to detect faces, recognize objects, read QR codes, and navigate environments.

Usually processed by Raspberry Pi or industrial computers using Python and OpenCV.

4. IMU (Inertial Measurement Unit)

Very important for humanoids. Measures acceleration, rotation, and orientation.

Examples: MPU6050, BNO055

A humanoid uses IMU to avoid falling. Your future robot will likely have IMUs in torso, legs, and arms.

5. Force Sensors

Measure applied force.

Applications: Detect grip pressure, Measure weight, Balance while walking

A 70 kg humanoid will almost certainly require force sensors in its feet and hands.

6. Encoders

Encoders tell the robot: “How much has the motor rotated?”

Without encoders, the robot doesn't know joint position. With encoders, the robot knows exact angle.

Humanoid robots require encoders in almost every joint.

Sensor Fusion

Advanced robots combine multiple sensors (Camera + IMU + Encoders + Force Sensors) → Robot Brain → Safe Walking. This process is called Sensor Fusion.

How Your Future Humanoid May Work

Camera → Raspberry Pi (Vision & AI) → ESP32 Controllers → Motors + Encoders → Movement

IMU + Force Sensors → Balance Correction

Mini Case Study

Suppose your robot is carrying a 70 kg box. Suddenly it starts tilting.

  1. IMU detects tilt.
  2. Controller calculates correction.
  3. Motors adjust leg position.
  4. Robot regains balance.

This entire process may happen hundreds of times every second.

Homework

  1. Q1 Which sensor is most useful for measuring distance?
  2. Q2 Which sensor helps a humanoid maintain balance?
  3. Q3 Which component acts as the robot's eyes?
  4. Q4 What is the role of an encoder?
  5. Q5 Why might a 70 kg humanoid need force sensors in its feet?
Preview of Next Lesson: Actuators and Robot Joints. We will study servos, DC motors, BLDC motors, gearboxes, harmonic drives, and how knees and elbows of humanoids are designed. This lesson will directly connect to your dream of building a heavy-lift humanoid robot.