Robotics and Intelligent Systems Program (RISP)
Workshop #3: Microcontrollers &
Robot Firmware Development
Post-Workshop Activity
Robotics and Intelligent Systems Program (RISP)
Activity Title
Distance-Based Reactive Steering Subsystem for Mobile Robots
Problem Statement
Mobile robots must sense obstacles and react immediately to avoid collisions. A common embedded
subsystem in robotics is a reactive obstacle-avoidance/steering module. This subsystem continuously
measures distances to the left and right of the robot and commands the steering actuators to turn
away from nearby obstacles.
In this activity, you will design and simulate a simplified reactive steering subsystem using an Arduino,
two ultrasonic sensors (left and right “eyes”), and two servo actuators representing left/right steering
outputs. The subsystem must decide whether to turn left, turn right, or stop based on where the
obstacle is detected.
System Overview
This subsystem is commonly used as a first autonomy layer in:
• Differential-drive and Ackermann-style robots (reactive avoidance layer)
• Autonomous navigation pipelines (used as a safety layer before path planning)
• Sensor-based steering mechanisms (e.g., steering fins / servo steering linkages)
It is designed around a standard robotics control loop:
Sense → Decide → Act
Fixed System Requirements
All students must use the same components and behavior defined below. Custom or alternative
designs are not allowed for this activity.
Required Platform
• Tinkercad Circuits
• Arduino Uno
Required Components
• Ultrasonic Sensor #1 (HC-SR04) – LEFT sensor (left “eye”)
• Ultrasonic Sensor #2 (HC-SR04) – RIGHT sensor (right “eye”)
• Servo #1 – LEFT servo (left steering output)
• Servo #2 – RIGHT servo (right steering output)
• Breadboard and jumper wires
Robotics and Intelligent Systems Program (RISP)
Note:
Mount/assume the ultrasonic sensors are facing slightly outward (left sensor looks to the left-front
region, right sensor looks to the right-front region).
Required System Behavior
Define the following distance thresholds (in centimeters):
• SAFE: distance ≥ 30 cm
• CAUTION: 15–29 cm
• DANGER: < 15 cm
The subsystem must behave exactly as follows (based on LEFT and RIGHT distance readings):
A) Path clear (SAFE on both sensors)
• Condition: Left ≥ 30 AND Right ≥ 30
• Action: Keep steering neutral
- Left servo = 90°
- Right servo = 90°
B) Obstacle on RIGHT → Turn LEFT
• Condition: Right < 15 AND Left ≥ 15
• Action: Turn left
- Left servo = 120°
- Right servo = 60°
C) Obstacle on LEFT → Turn RIGHT
• Condition: Left < 15 AND Right ≥ 15
• Action: Turn right
- Left servo = 60°
- Right servo = 120°
D) Obstacle IN FRONT / BOTH SIDES → STOP
• Condition: Left < 15 AND Right < 15
• Action: Stop / hold steering (indicate stop)
- Left servo = 90°
- Right servo = 90°
- Also print: "STOP" to Serial Monitor
Important: Your code must continuously update the decision in real time (Sense → Decide → Act).
Firmware Requirements
Your Arduino code must be modular and structured. The following functions are mandatory:
Robotics and Intelligent Systems Program (RISP)
Mandatory Functions
1) readDistanceLeft()
2) readDistanceRight()
3) decideState(int leftCm, int rightCm)
4) updateActuators(state)
5) loop()
Function expectations:
• readDistanceLeft()/readDistanceRight(): trigger sensor, measure echo, convert to cm
• decideState(): return CLEAR / TURN_LEFT / TURN_RIGHT / STOP using the exact thresholds
• updateActuators(): set both servos and print state + distances
Additional coding rules:
• Use setup() correctly
• Use clear variable names and comments
• Avoid placing all logic directly inside loop()
• Prefer non-blocking timing (millis()) for printing/updates when possible
• You can learn from AI but do not let him do all the work. Practice Makes Perfect.
System Design Drawing (Two Options)
Option A: System Block Diagram (Sensor, MCU, Actuator, signal flow)
OR
Option B: Finite State Machine (CLEAR, WARNING, OBSTACLE states)
Submission Requirements
Submit ONE PDF file including:
• System description
• Tinkercad circuit screenshot
• Arduino code
• Function explanations
• Diagram or FSM
• Keep it with you, we will develop this file later!
Robotics and Intelligent Systems Program (RISP)
Submission Instructions
Submission via Google Form (link will be shared in the group).
This activity is part of your RISP assessment and verify your attendance for semester 1.
Deadline
Deadline for submission: 26 January at 3:00pm.
Important Note
This activity prepares you for upcoming workshops on locomotion, control systems, and autonomous
navigation.