1
Factory Prime Studio
Lab Manual
Automation and Control Systems
For use with
Factory Prime Studio Software
August 2025
2
Factory Prime Studio
Version 1.0
Website:
https://www.FactoryPrimeStudio.com
All Rights Reserved
© 2025 Melaku Asrat. All rights reserved. No part of this manual, including text, images,
diagrams, or software descriptions, may be reproduced, distributed, transmitted, or used in
any form or by any means electronic, mechanical, photocopying, recording, or otherwise
without the prior written permission of the author.
This manual is provided for use with the commercial product Factory Prime Studio. Any
use beyond personal, educational, or institutional instruction directly associated with Factory
Prime Studio, including commercial distribution, modification, or resale, is strictly prohibited
under the laws of Ethiopia.
3
About the Author
Melaku Asrat, M.Sc., is an experienced electrical engineer specializing in automation, control
and embedded systems. He has a strong academic and professional background, having
served as a lecturer and instructor in electrical engineering. Through his teaching, he has
guided students in practical applications of sensors, actuators, control systems, and embedded
programming, fostering hands-on learning and technical proficiency.
In the industrial domain, Melaku has designed and implemented Arduino-based SCADA
systems for municipal water supply networks, connecting and monitoring multiple pump
stations for remote control and data acquisition. His expertise in real-time system monitoring,
sensor integration, and control logic directly informs the design of Factory Prime Studio,
ensuring the simulation environment reflects practical industrial automation scenarios.
Beyond academia and industrial automation, Melaku is also an innovative game developer.
He has created over ten interactive arcade-style games, emphasizing user engagement,
immersive experiences, and intuitive interfaces. This experience in designing interactive and
responsive systems contributed to the development of Factory Prime Studio, making the
software not only realistic in simulating industrial processes but also engaging, intuitive, and
student-friendly.
By combining academic instruction, industrial SCADA implementation, and interactive
software design, Melaku brings a unique perspective to Factory Prime Studio. His work
ensures that learners gain both the theoretical understanding and practical skills necessary to
excel in modern automation, robotics, SCADA and embedded control systems, all within a
safe, scalable, and engaging virtual lab environment.
4
Contents
About the Author ............................................................................................................................................... 3
About This Manual........................................................................................................................................... 9
Purpose of the Manual .................................................................................................................. 9
Target Audience ............................................................................................................................ 10
Scope and Use Cases .................................................................................................................... 11
Overview of the Software and Hardware Setup ............................................................... 11
Why This Setup? ........................................................................................................................... 13
Why Arduino? ............................................................................................................................... 13
Lab 1: One Conveyor Belt with One Sensor ......................................................................................... 15
Overview .......................................................................................................................................... 15
Session 1: Introduction to Digital Output Controlling the Conveyor Belt .............. 15
Session 2: Introduction to Digital Input Reading the Sensor State ......................... 16
Session 3: Sensor-Based Motor Control .............................................................................. 17
Session 4: Time-Based Conveyor Control after Sensor Trigger ................................. 17
Session 5: Toggle Mode Conveyor Using Sensor as a Switch ...................................... 18
Session 6: Emergency Stop Logic Simulation ................................................................... 18
Lab 2: Dual Conveyor Belt with One Box and Three Sensors ....................................................... 19
Overview .......................................................................................................................................... 19
Session 1: Independent Control of Two Conveyors ....................................................... 19
Session 2: Reading and Monitoring Three Sensor Inputs ............................................ 20
Session 3: Sequential Box Transfer between Two Conveyors ................................... 21
5
Session 4: Sensor-Based Stop Points and Hold Logic .................................................... 21
Session 5: Conveyor Start Only When Box is Present ................................................... 22
Session 6: Fault Handling Missing Sensor Event ........................................................... 22
Lab 3: Four Conveyor Belts with Continuously Coming Boxes .................................................... 23
Overview .......................................................................................................................................... 23
Session 1: Basic Control of Multiple Conveyor Belts ..................................................... 23
Session 2: Continuous Flow Keeping All Belts Moving ................................................ 24
Session 3: Smart Conveyor Management Based on Box Position ............................. 24
Session 4: Buffer Zone Handling and Delays between Belts ....................................... 25
Lab 4: Water Tank with Float Sensor and Controlled Pump ......................................................... 26
Overview .......................................................................................................................................... 26
Session 1: Controlling the Pump Manually ........................................................................ 26
Session 2: Reading the Float Sensor State ......................................................................... 27
Session 3: Auto Pump ON When Water Is Low ................................................................ 27
Session 4: Add a Manual Override Switch .......................................................................... 28
Session 5: Implement Logging of Pump Activity over Serial ...................................... 28
Lab 5: PID-Controlled Tanker with Inlet Valve .................................................................................. 30
Overview .......................................................................................................................................... 30
Session 1: Reading Analog Water Level Sensor ............................................................... 30
Session 2: Manual ON/OFF Control of Inlet Valve .......................................................... 31
Session 3: Implement Basic Threshold Control (Bang-Bang Logic) ........................ 31
Session 4: Implement Proportional Control (P-only) .................................................... 32
Session 5: Full PID Control of Water Level ........................................................................ 32
6
Session 6: Compare PID vs. Threshold Control ............................................................... 33
Lab 6: Single Pole Traffic Light System.................................................................................................. 34
Overview .......................................................................................................................................... 34
Session 1: Basic LED Control for Traffic Lights ................................................................ 34
Session 2: Create a Time-Based Light Sequence ............................................................. 35
Session 3: Replace delay() with millis() for Non-Blocking Control ......................... 35
Session 4: Implement a State Machine for Traffic Light Logic ................................... 36
Lab 7: Elevator System across 3 Floors ................................................................................................. 37
Overview .......................................................................................................................................... 37
Session 1: Manual Control of Elevator Motor Direction ............................................... 37
Session 2: Read and Interpret Car Position Sensors ...................................................... 38
Session 3: Floor-to-Floor Travel with Stop Logic ............................................................ 38
Session 4: Read Up/Down Call Buttons for Each Floor ................................................ 39
Session 5: Implement Internal Request Handling with Queue .................................. 39
Session 6: Directional Priority Handling ............................................................................ 40
Session 7: Display Current Floor over Serial .................................................................... 40
Lab 8: Ball Balancing Using Servo and Ultrasonic Sensor (PID) .................................................. 42
Overview .......................................................................................................................................... 42
Session 1: Reading Distance from the Ultrasonic Sensor ............................................. 42
Session 2: Manual Control of Servo to Tilt Platform ...................................................... 43
Session 3: Implement Proportional Control (P-Control) ............................................. 43
Session 4: Full PID Control for Ball Balancing .................................................................. 44
Session 5: Introduce Disturbances and Observe Recovery ......................................... 44
7
Session 6: Log Ball Position vs Time Data for Analysis ................................................. 45
Lab 9: Box Sorting by Height with Four Conveyors .......................................................................... 46
Overview .......................................................................................................................................... 46
Session 1: Measure Box Height Using Ultrasonic Sensor ............................................. 46
Session 2: Control the Sorting Conveyor Manually ........................................................ 47
Session 3: Sorting Boxes Based on Their Height ............................................................. 47
Lab 10: 2-Joint, 2D Planar Robotic Arm (IK) ....................................................................................... 49
Overview .......................................................................................................................................... 49
Session 1: Basic DC Motor Control for 2D Arm Joints ................................................... 49
Session 2: Reading Joint Angles and Visualizing Arm Position .................................. 50
Session 3: Understand 2D Arm Geometry and Forward Kinematics ...................... 50
Session 4: Implement Inverse Kinematics (IK) for Position Control ....................... 51
Session 5: Move to Target Point via IK-Based Control .................................................. 52
Session 6: Implement PID Control on Each Joint for Smooth Motion .................... 52
Session 7: Trace a Path by Moving Through Multiple Target Points ....................... 53
Lab 11: 3-Joint, 2D Planar Robotic Arm (IK) ....................................................................................... 54
Overview .......................................................................................................................................... 54
Session 1: Basic DC Motor Control for 3 Arm Joints ....................................................... 54
Session 2: Reading Joint Angles and Visualizing Arm Position .................................. 55
Session 3: Understand 3-Joint Arm Geometry and Forward Kinematics ............... 55
Session 4: Implement Inverse Kinematics (IK) for Position Control ....................... 56
Session 5: Move to Target Point via IK-Based Control ................................................... 57
Session 6: Implement PID Control on Each Joint for Smooth Motion ...................... 57
8
Session 7: Draw or Trace Complex Paths ............................................................................ 58
Lab 12: Full 4-Way Traffic Light System ............................................................................................... 59
Overview .......................................................................................................................................... 59
Session 1: GPIO Testing and Individual LED Control ................................................... 59
Session 2: Full Traffic Light Cycle Implementation ........................................................ 60
Session 3: Timing Countdown Display on Serial Monitor ........................................... 60
Session 4: Emergency Stop with Smooth Phase Termination .................................... 61
Lab 13: 3-Joint 3D Robotic Arm................................................................................................................ 62
Overview .......................................................................................................................................... 62
Session 1: Basic DC Motor Control for 3D Arm Joints ................................................... 62
Session 2: Reading Joint Angles and Visualizing 3D Arm Position........................... 63
Session 3: Understanding 3D Arm Geometry and Forward Kinematics ................ 63
Session 4: Implement Inverse Kinematics (IK) for 3D Position Control ................. 64
Session 5: Move to Target Point via IK-Based Control .................................................. 64
Session 6: Implement PID Control on Each Joint for Smooth Motion ..................... 65
Session 7: Draw a 3D Path through Multiple Target Points ........................................ 65
Lab 14: Line Following Robot ................................................................................................................ 67
Overview .......................................................................................................................................... 67
Session 1: Reading Infrared (IR) Sensors
................................................................... 67
Session 2: Basic Motor Control ............................................................................................... 68
Session 3: Implement Simple Line Following Logic ........................................................ 68
Session 4: Implement Proportional Control for Steering ............................................. 69
Session 5: Full PID Control for Line Following ................................................................. 69
9
About This Manual
Purpose of the Manual
This manual serves as a comprehensive guide for understanding, programming, and
experimenting with automation, robotics, and control systems using the Factory Prime
Studio platform. It provides detailed, systematic instructions across 14 laboratory
exercises, enabling students to
develop
practical skills in digital and analog input/output
(I/O), sensor integration, motor control, proportional-integral-derivative (PID) regulation,
and robotic kinematics. The manual bridges theoretical concepts with hands-on
programming experience within a safe, simulated environment, fostering a deep
understanding of industrial automation principles.
The primary purpose of this manual is to deliver a structured and thorough resource for
learning and practicing industrial automation, robotics, and control system concepts
through simulated laboratory exercises. It is designed to support students, trainees, and
engineers by:
Understanding fundamental principles of sensors, actuators, motor control, PID
regulation, and kinematics in a controlled and secure virtual environment.
Developing programming and system integration skills through direct interaction
with Arduino-based control systems within the simulation, eliminating the need
for physical hardware.
Gaining practical experience in automation and robotics by implementing, testing,
and refining control logic for diverse industrial processes, including conveyor
systems, water tanks, traffic lights, and robotic arms.
Bridging the gap between theory and practice by enabling experimentation with
real-world control scenarios that are typically expensive, complex, or unsafe to
replicate physically.
Facilitating self-paced and guided learning through structured lab sessions,
complete with clearly defined objectives, learning outcomes, and hands-on
exercises.
This manual acts as an indispensable reference for both instructors and students, offering
10
the necessary context, guidance, and exercises to master modern automation and robotics
concepts efficiently, safely, and cost-effectively.
Target Audience
This manual is tailored for a diverse group of learners and professionals engaged in
automation, robotics, and control system engineering. The following audiences will derive
significant benefits from this resource:
1. Undergraduate and Graduate Students in Electrical, Computer, Software, and
Mechatronics Engineering
Why
: Provides practical, hands-on experience with control systems, sensors,
actuators, and robotics concepts that complement theoretical coursework.
Students can experiment safely without the need for costly hardware setups.
2. Vocational and Technical Trainees in Industrial Automation
Why
: Equips trainees with industry-relevant skills such as programmable logic
controller (PLC)/Arduino programming, sensor integration, and motor control,
preparing them for real-world automation environments.
3. Professional Engineers and Technicians in Automation and Control
Why
: Serves as a refresher and practical guide for implementing, testing, and
optimizing control logic and industrial processes using simulation before
deployment on actual equipment.
4. Researchers in Robotics, Mechatronics, and Industrial Systems
Why
: Offers a flexible simulation environment to prototype, test, and analyze
new control algorithms, PID tuning strategies, and robotic arm kinematics without
the constraints of physical hardware.
5. Educators and Instructors in Automation and Robotics
Why
: Provides a structured curriculum with well-defined learning objectives and
exercises, enabling effective teaching of automation and robotics concepts in
laboratory or virtual classroom settings.
6. Hobbyists and Makers Interested in Robotics and Automation
11
Why
: Allows experimentation with Arduino programming, motor control, and
sensor feedback systems in a safe, cost-effective, and guided environment.
Overall, this manual accommodates learners at various skill levels from beginners to
advanced users delivering a structured, hands-on approach to mastering automation and
robotics concepts without requiring expensive or cumbersome physical lab setups.
Scope and Use Cases
The laboratories outlined in this manual encompass a broad spectrum of industrial
automation topics, ranging from basic conveyor control and water tank management to
advanced 3D robotic arm control and line-following robots. Each lab focuses on
programming Arduino boards to interface with virtual sensors and actuators within the
Factory Prime Studio environment. This methodology allows learners to experiment
freely, test multiple control strategies, and analyze results without the risk of hardware
damage. The skills acquired through these exercises are directly applicable to real-world
automation, robotics, and supervisory control and data acquisition (SCADA) projects.
Overview of the Software and Hardware Setup
The Factory Prime Studio laboratory is a hybrid virtual-physical training platform that
integrates real hardware control via Arduino microcontrollers with a high-fidelity
industrial simulation. This combination delivers a hands-on learning experience while
mitigating the high costs, space requirements, and safety concerns associated with
traditional physical automation labs.
Software Setup
Factory Prime Studio:
o
A Unity-based 3D simulation environment featuring 14 unique
industrial and robotics labs, including conveyor systems, traffic
lights, water tanks, and robotic arms.
o
Realistic physics and animations to accurately replicate real-world
industrial operations.
o
Built-in communication with Arduino hardware to execute real
control logic developed by students.
12
Arduino IDE:
o
Utilized to program the student Arduino board with control
algorithms for sensors, actuators, and process control.
o
Supports C/C++ programming for maximum flexibility.
Factory.h Arduino Library:
o A dedicated Arduino library provided for Factory Prime Studio that
simplifies communication between the student Arduino and the
simulation through the driver Arduino board.
o Provides prebuilt functions to read sensor states, control actuators, and
send/receive data seamlessly with the virtual lab environment.
o Ensures consistent and safe interfacing, allowing students to focus on
implementing control logic rather than low-level communication
protocols.
Serial Communication Interface:
o
Facilitates seamless real-time data exchange between the Arduino
boards and the simulation.
Hardware
Setup
Two Arduino UNO Boards:
o
Arduino 1 Hardware Driver: Acts as an interface between the students
Arduino and the Factory Prime Studio software, ensuring smooth data flow
and proper control execution.
o
Arduino 2 Programmable Unit: Controlled by students to run their logic,
process sensor readings, and send control signals to the simulation.
PC / Laptop: Recommended minimum specifications:
o
CPU: Quad-core 2.5 GHz or higher
o RAM: 8 GB or higher
13
o
GPU: Dedicated graphics card recommended for Unity scenes
o
USB Ports: At least two for connecting Arduinos
USB Connections:
Both Arduino boards connect via USB to the computer running the simulation.
Simulated I/O Devices:
Each lab includes virtual sensors (e.g., proximity sensors, ultrasonic sensors, float
sensors) and actuators (e.g., motors, valves, pumps, servos, lights) that emulate
the behavior of real devices.
Why This Setup?
Constructing
a physical version of this laboratory would necessitate large industrial
machinery, substantial space, and significant costs for equipment, installation, and
maintenance. Additional considerations include:
Many experiments involve moving parts that could present safety hazards in a real
lab.
Certain systems (e.g., multi-joint robotic arms, continuous conveyor flows)
require expensive calibration and precise mechanical setups.
Scaling for multiple students would demand duplicating costly hardware.
By simulating the physical setup and integrating it with real Arduino programming,
students gain equivalent problem-solving and coding experience to that of a physical lab
without the associated cost, space, or safety limitations.
Why Arduino?
Arduino boards are selected as the core hardware interface for this laboratory for several
compelling reasons. First, Arduino offers a low-cost and widely available platform, making it
accessible to students and educational institutions without the need for expensive industrial
equipment. Second, it provides user-friendly programming and interfacing capabilities,
allowing learners to focus on control logic, sensor integration, and actuator operation without
dealing with complex hardware configurations.
In the Factory Prime Studio environment, the Arduino setup serves two distinct roles:
Arduino #1 acts as a hardware driver, facilitating secure and reliable communication between
14
the students’ Arduino and the simulation software, while Arduino #2 is fully programmable
by students to implement control logic and interact with simulated lab equipment. This dual-
Arduino design allows students to experiment freely in a safe virtual setting while mastering
real-world concepts such as digital and analog I/O, pulse-width modulation (PWM) control,
and sensor feedback loops.
Moreover, Arduino’s compatibility with a wide range of sensors, actuators, and
communication protocols mirrors real industrial systems, giving students hands-on
experience in embedded control and automation. Using Arduino within a fully simulated
environment eliminates the high costs, space requirements, and safety concerns of
constructing full-scale physical systems, making advanced industrial concepts more
accessible, scalable, and safe for educational purposes.
Notes
All labs are self-contained, with pin configurations provided within the software
for easy reference.
Students are not required to physically wire sensors or actuators; the virtual setup
accurately reflects real-world connections.
The environment supports real-time observation, debugging, and logging,
facilitating safe experimentation without hardware risk.
15
Lab 1: One Conveyor Belt with One Sensor
Overview
This lab introduces students to the foundational concepts of digital input/output control in an
industrial automation environment. The system consists of a single conveyor belt driven by a
motor and monitored by a single proximity or optical sensor positioned along its path.
Students will learn how to interface the sensor with a microcontroller, detect the presence or
absence of an object, and use the sensor’s signal to control the conveyor motor in real-time.
Through systematic exercises, they will explore the relationship between physical
components and their software control logic, including basic ON/OFF switching, timed
operations, and event-triggered responses. This lab also provides an opportunity to practice
signal monitoring through the Serial Monitor, implement basic conditional logic in code, and
simulate common industrial processes such as part detection, quality inspection triggers, or
automated sorting initiation.
By the end of this lab, students will have a practical understanding of how sensors and
actuators interact in a simple yet realistic automation scenario, setting the stage for more
complex multi-sensor and multi-actuator systems in later labs.
Session 1: Introduction to Digital Output Controlling the Conveyor Belt
In this session, students will focus on controlling the conveyor motor using the digital output
of the Arduino within the Factory Prime Studio environment. All sensors, actuators, and the
16
Arduino board are pre-connected, and the pin configurations are provided in the software for
reference, so no hardware wiring is required. Students will write code to turn the conveyor
motor ON and OFF, observe the simulated movement, and understand how software
commands translate to actuator behavior. This hands-on exercise introduces the basic
principles of digital output control and prepares students for sensor-based automation tasks in
subsequent sessions.
Objectives:
Understand digital output from Arduino.
Control an actuator (conveyor motor) using digitalWrite.
Learn serial communication basics with Factory Prime Studio.
Learning Outcomes:
Turn the conveyor motor ON/OFF using Arduino code.
Identify and use the correct pin for output.
Session 2: Introduction to Digital Input Reading the Sensor State
In this session, students will learn how to read the state of the proximity sensor using the
Arduino’s digital input functions. They will write code to continuously monitor the sensors
ON/OFF status and display the readings on the Serial Monitor. Since all connections are
already made in the virtual lab, students can immediately test their programs and see how the
conveyor responds when an object passes the sensor, reinforcing the concept of digital input
reading.
Objectives:
Understand how to read a digital input (e.g., IR or limit sensor).
Use digitalRead to monitor sensor status.
Debug and monitor via Serial Monitor.
Learning Outcomes:
Read and interpret the sensor state.
Explain sensor behavior in proximity of an object.
17
Build logic to trigger a response when the sensor is activated.
Session 3: Sensor-Based Motor Control
In this session, students will combine motor control and sensor monitoring to create a simple
automation sequence where the conveyor runs only when the sensor detects an object. They
will implement conditional statements in their Arduino code to link sensor feedback with
actuator control, achieving a basic example of event-driven automation. The real-time
simulation allows them to visually confirm their logic without any physical setup.
Objectives:
Implement logic to start the conveyor when the sensor is activated.
Learn basic if-condition structures.
Learning Outcomes:
Automate the conveyor based on sensor input.
Write control logic for sensor-actuator systems.
Explain timing issues or signal bouncing.
Session 4: Time-Based Conveyor Control after Sensor Trigger
In this session, students will extend their automation by incorporating time delays into
conveyor operation. They will modify their code so that the conveyor continues running for a
set duration after an object is detected, using Arduino’s timing functions. This introduces
them to the concept of time-based control and prepares them for more advanced automation
strategies in future labs.
Objectives:
Use
millis
or delay for time-based logic.
Stop the conveyor after a set period post-sensor activation.
Learning Outcomes:
Integrate timing logic into control systems.
Create reactive time delays.
Understand non-blocking delays for real-time control.
18
Session 5: Toggle Mode Conveyor Using Sensor as a Switch
In this session, students will program the conveyor system to operate in a toggle mode, where
the proximity sensor acts like an ON/OFF switch rather than simply detecting objects. When
the sensor is triggered once, the conveyor will start running and continue until the sensor is
triggered again, at which point it will stop. This requires students to implement logic that
detects sensor state changes and maintains a stored motor state between activations. Through
this exercise, students will gain experience with edge detection, state variables, and logic
design, all within the pre-connected Factory Prime Studio environment.
Objectives:
Use the sensor as a toggle switch for ON/OFF conveyor control.
Implement state machines using Boolean ags.
Learning Outcomes:
Write toggle behavior logic with digital inputs.
Understand state transitions.
Avoid issues like sensor bounce.
Session 6: Emergency Stop Logic Simulation
In this session, students will implement an emergency stop function for the conveyor system,
allowing the motor to halt immediately when a predefined safety signal is received. The stop
command will be triggered through the Serial Monitor, simulating a real-world emergency
button press. Students will integrate this safety logic alongside existing sensor control to
ensure that the conveyor remains stopped until explicitly reset. This exercise introduces the
concept of safety interlocks, multiple input handling, and prioritizing critical commands over
normal operations essential elements in industrial automation design.
Objectives:
Add an emergency stop condition (e.g., via serial command).
Integrate multiple input signals for safety logic.
Learning Outcomes:
Code safety overrides in control systems.
19
Simulate industrial safety mechanisms.
Explain priority logic in digital control.
Lab 2: Dual Conveyor Belt with One Box and Three Sensors
Overview
This lab builds on the fundamentals of Lab 1 by introducing multiple actuators and sensors
working together in a coordinated process. The system consists of two conveyor belts
arranged in sequence, transporting a single box from the first belt to the second. Three
strategically placed sensors detect the box at different stagessuch as entry, transfer point,
and exit. Students will learn how to process multiple sensor inputs, control more than one
motor independently, and implement logic for sequential operations. The exercises guide
them in synchronizing belt movements to ensure smooth transfer of the box between
conveyors, introducing concepts such as interlocking control, staged activation, and
conditional delays. Additionally, they will simulate buffering or inspection zones by
controlling belt speeds or pauses based on sensor detection, mimicking real-world material
handling workflows.
By the end of this lab, students will have hands-on experience in integrating multiple sensors
and actuators, managing timing issues, and designing control logic that supports multi-stage
industrial processes.
Session 1: Independent Control of Two Conveyors
20
In this session, students will program two separate conveyor belts to operate independently,
each controlled by its own logic. The goal is to understand how multiple actuators can run
simultaneously without interfering with each other’s operation. Students will write code to
start and stop each conveyor using predefined conditions or commands, allowing them to
explore parallel control structures. This exercise helps in building the foundation for
coordinating multi-device systems, which is common in real-world manufacturing lines.
Objectives:
Control multiple actuators from Arduino.
Use digitalWrite for two conveyors separately.
Learning Outcomes:
Activate each conveyor independently.
Understand multi-output control.
Demonstrate multi-actuator coordination.
Session 2: Reading and Monitoring Three Sensor Inputs
In this session, students will read and monitor signals from three different sensors positioned
along the conveyor system. Each sensor will be used to detect the presence or position of the
moving box, with readings displayed on the Serial Monitor for real-time feedback. Students
will practice writing code that continuously checks sensor states and responds accordingly,
laying the groundwork for event-driven automation. This activity emphasizes input handling,
condition checking, and accurate detectionessential skills in industrial process control.
Objectives:
Identify sensor roles and read their states.
Use digitalRead to monitor sensors.
Display status in Serial Monitor.
Learning Outcomes:
Read and log three sensor inputs over Serial Monitor.
Explain object tracking via sequential sensor activation.
21
Map sensor state to object location.
Session 3: Sequential Box Transfer between Two Conveyors
In this session, students will program logic to transfer a single box from the first conveyor to
the second in a controlled sequence using the three sensors. The sensors will detect when the
box reaches the transfer point, stop the first conveyor, and then start the second conveyor to
move the box forward. This activity focuses on synchronizing two actuators based on sensor
input, ensuring smooth handover of the object between conveyors without collisions or
misalignment.
Objectives:
Transfer a box from Conveyor 1 to Conveyor 2.
Activate Conveyor 1 until Sensor 2 triggers, and then switch to Conveyor 2.
Learning Outcomes:
Write sequential automation logic.
Demonstrate timed and sensor-based coordination.
Describe event-driven transitions.
Session 4: Sensor-Based Stop Points and Hold Logic
In this session, students will implement a control program where the box stops precisely at
specific sensor locations and remains stationary until a release condition is met. Using the
three sensors as positional checkpoints, the logic will halt the conveyors at predetermined
points and resume movement based on programmed triggers or commands. This exercise
emphasizes precision stopping, timed holds, and controlled resumption, mimicking industrial
processes that require inspection, labeling, or other intermediate tasks.
Objectives:
Stop the box at Sensor 2 for a short period (e.g. 5 seconds).
Use millis for pause implementation.
Learning Outcomes:
Integrate time delay with sensor triggers.
22
Understand real-time vs. blocking delays.
Simulate buffering/inspection zones.
Session 5: Conveyor Start Only When Box is Present
In this session, students will design a control logic that keeps the conveyors idle until a box is
detected on the first sensor. Once the presence of a box is confirmed, the conveyors will start
automatically to move it forward. This approach simulates energy-saving and wear-reduction
strategies used in real-world conveyor systems by running only when necessary, reinforcing
the concept of event-driven automation.
Objectives:
Keep conveyors OFF until box detection at rst sensor.
Implement
energy-saving
logic.
Learning Outcomes:
Demonstrate condition-based actuator engagement.
Understand resource eciency.
Explore object-based event activation.
Session 6: Fault Handling Missing Sensor Event
In this session, students will implement a fault-handling routine that detects and responds to
cases where a sensor fails to detect the passing box within an expected time frame. The
system will use timers or counters to monitor sensor response times, and if a sensor event is
missed, the conveyors will stop, and an error message will be sent to the Serial Monitor. This
simulates industrial fault detection methods, ensuring reliability and safety in automated
material handling.
Objectives:
Simulate missing object scenario.
Implement timeout/failure detection logic.
Learning Outcomes:
Add robustness to control algorithms.
23
Detect and respond to faulty sensor behavior.
Lab 3: Four Conveyor Belts with Continuously Coming Boxes
Overview
This lab advances students’ understanding of conveyor automation by introducing a system
of four interconnected belts handling a continuous flow of boxes. Unlike previous labs, each
conveyor must operate only when a box is present, requiring students to implement real-time
monitoring and counting logic to track box presence on each belt. Sensors detect the position
of boxes, enabling dynamic responses such as starting, stopping, or pausing belts based on the
number of boxes currently on them. Students will learn to coordinate multiple conveyors,
ensuring smooth flow while preventing idle operation, collisions, or jams. Key concepts
covered include intelligent sensor-based decision-making, state machines, and buffer zone
management to maintain consistent throughput.
By the end of this lab, students will be able to design and implement automated conveyor
systems that efficiently manage continuous product flow, a foundational skill for modern
industrial sorting and packaging operations.
Session 1: Basic Control of Multiple Conveyor Belts
In this session, students will learn to control four conveyor belts individually using Arduino
outputs. Each belt can be started and stopped independently, allowing students to practice
motor control logic and verify correct wiring and pin assignments provided in the software.
Objectives:
Control four conveyors independently.
24
Test sequential ON/OFF logic.
Learning Outcomes:
Control and test multiple outputs.
Identify pin assignments for actuators.
Create modular code for belt control.
Session 2: Continuous Flow Keeping All Belts Moving
Students will program the system to keep all four conveyors running continuously, simulating
an uninterrupted production line. This helps them understand synchronous motor control and
ensures they can maintain steady object movement across multiple stages.
Objectives:
Keep all belts running in sync for continuous box ow.
Monitor system responsiveness and box behavior.
Learning Outcomes:
Manage simultaneous output control.
Simulate assembly line ow.
Analyze throughput and efficiency.
Session 3: Smart Conveyor Management Based on Box Position
In this session, students will use sensor feedback to ensure that each conveyor belt operates
only when there is a box present on it. They will implement counters to track the number of
boxes on each conveyor, allowing the system to determine whether a belt should run or
remain stopped. This logic ensures that conveyors move only when necessary, preventing idle
operation while maintaining smooth material flow. Students will develop decision-making
algorithms, such as counters combined with conditional checks, to simulate intelligent
industrial conveyor systems and understand efficient resource usage.
Objectives:
Use sensor data to move boxes only when necessary.
Minimize conveyor usage while maintaining ow.
Learning Outcomes:
25
Simulate intelligent conveyor systems.
Build decision trees or state machines.
Understand throughput vs. power efficiency.
Session 4: Buffer Zone Handling and Delays between Belts
Students will simulate industrial buffer zones by adding intentional delays between
transferring boxes from one conveyor to the next. This creates spacing between items for
processes like inspection, scanning, or packaging.
Objectives:
Introduce delays at belt transitions for inspection zones.
Use millis for non-blocking delays.
Learning Outcomes:
Learn non-blocking delay techniques.
Simulate buffer control for high-volume systems.
Understand asynchronous control loops.
26
Lab 4: Water Tank with Float Sensor and Controlled Pump
Overview
This lab introduces students to analog sensor monitoring and basic process control using a
water tank setup. The tank is equipped with a float sensor that detects water levels and a
pump that fills or stops based on sensor readings. Students will learn to read the sensor’s
analog signals and use them to control the pump in real time. Exercises include manual
pump operation, automatic filling when water levels fall below a threshold, and
implementing safety overrides to prevent overfilling. Through this lab, students gain
experience in event-driven control, threshold-based automation, and basic feedback loops.
By the end of the session, students will understand how sensors and actuators interact in
fluid systems, laying the foundation for more advanced control strategies like PID in
subsequent labs.
Session 1: Controlling the Pump Manually
In this session, students will manually control the water pump using the Arduino’s digital
output within the Factory Prime Studio environment. Since all sensors, actuators, and pin
configurations are pre-connected, no hardware setup is required. Students will write code to
turn the pump ON and OFF, observing the simulated water flow in real time. This exercise
introduces basic actuator control, familiarizes students with digital output programming, and
provides hands-on experience with controlling a physical process through software.
27
Objectives:
Activate the pump using digital output.
Test ON/OFF control via Arduino.
Learning Outcomes:
Gain experience with actuator control.
Write basic pump operation code.
Verify correct pin wiring and output usage.
Session 2: Reading the Float Sensor State
In this session, students will read water level information from the float sensor using the
Arduino’s analog input. The sensor data will be interpreted and displayed on the Serial
Monitor as a percentage of tank fullness. With all connections pre-configured in the software,
students can focus on programming logic to monitor water levels in real time. This exercise
reinforces understanding of analog sensor reading, data interpretation, and provides the
foundation for automated water level control in later sessions.
Objectives:
Understand oat sensor operation.
Read sensor state with analog Read.
Display water level status on Serial Monitor in percentage.
Learning Outcomes:
Interpret sensor input correctly.
Observe real-time water level changes.
Integrate sensor monitoring.
Session 3: Auto Pump ON When Water Is Low
In this session, students will implement automated control logic for the water pump based on
float sensor readings. The pump will automatically turn ON when the water level drops below
a set threshold (e.g., 15%) and turn OFF when it reaches a higher level (e.g., 85%). With all
hardware pre-connected in the software environment, students can focus on writing the
28
control program and observing the system response. This session introduces basic closed-
loop feedback, enabling students to understand automated fluid level regulation and the
concept of maintaining target process conditions.
Objectives:
Turn pump ON whenoat sensor indicates low water (e.g. 15%).
Stop pump when water level is sufficient (e.g. 85%).
Learning Outcomes:
Write automated control logic.
Simulate uid level regulation.
Explain closed-loop feedback systems.
Session 4: Add a Manual Override Switch
In this session, students will enhance the automated pump control by adding a manual
override option via the Serial Monitor. The system will prioritize manual commands over
automatic logic, allowing the pump to be turned ON or OFF instantly for emergency or
maintenance purposes. Students will program dual-mode operation, combining automated
level-based control with manual intervention. This exercise teaches students how to integrate
safety and override features into control systems, a critical aspect of real-world industrial
design.
Objectives:
Combine automatic pump control with manual override (using Serial Monitor).
Prioritize manual control for emergency/maintenance.
Learning Outcomes:
Implement
dual-mode
operation.
Build
mode-switching
logic.
Understand safety/override design.
Session 5: Implement Logging of Pump Activity over Serial
In this session, students will implement a data logging system that records pump events and
29
water level readings along with timestamps. All activities, such as pump ON/OFF actions and
level changes, will be sent to the Serial Monitor for real-time monitoring and traceability.
Students will write code to capture, format, and display this information, simulating industrial
logging practices. This exercise helps students understand the importance of runtime data
collection, system monitoring, and analyzing process behavior for debugging or performance
assessment.
Objectives:
Send pump events and water level states with timestamps.
Learn data logging and traceability.
Learning Outcomes:
Implement runtime data logging.
Interpret pump behavior via logs.
Simulate industrial logging.
30
Lab 5: PID-Controlled Tanker with Inlet Valve
Overview
This lab builds on Lab 4 by introducing advanced feedback control using a PID
(Proportional-Integral-Derivative) system. The setup consists of a water tank equipped with
an analog water level sensor and an inlet valve controlled by a motor. Students will first
implement basic threshold (bang-bang) control, then progress to proportional control, and
finally apply full PID control to maintain precise water levels. They will learn to read
continuous analog sensor data, calculate control outputs, and adjust the inlet valve to stabilize
the water level. Exercises also include comparing the performance of threshold versus PID
control and observing system responses to disturbances.
By the end of this lab, students will understand how PID controllers improve stability, reduce
overshoot, and provide smooth, reliable control in fluid-level automation systems.
Session 1: Reading Analog Water Level Sensor
In this session, students will use the Arduino’s analog input to monitor the water level in the
tanker. They will calibrate the sensor readings to correspond with actual tank levels,
displaying the data on the Serial Monitor for real-time observation. With all connections pre-
configured in Factory Prime Studio, students can focus on interpreting sensor values
accurately. This exercise introduces analog input handling, sensor calibration, and real-time
monitoring, forming the foundation for subsequent control strategies like threshold and PID
regulation.
31
Objectives:
Use analog Read to monitor water level.
Calibrate sensor readings to tank level.
Learning Outcomes:
Interpret analog sensor values.
Understand sensor calibration.
Build real-time monitoring.
Session 2: Manual ON/OFF Control of Inlet Valve
In this session, students will manually control the inlet valve of the tanker using Arduino
outputs within the pre-configured simulation environment. They will write code to open and
close the valve, observing the resulting changes in tank water level in real time. This exercise
reinforces basic actuator control, provides hands-on practice with threshold-based operations,
and helps students understand the direct relationship between valve actuation and fluid level
changes.
Objectives:
Operate inlet valve (analog output).
Practice manual lling control.
Learning Outcomes:
Control inlet valve via code.
Test threshold-based control.
Observe tank lling behavior.
Session 3: Implement Basic Threshold Control (Bang-Bang Logic)
In this session, students will implement a simple threshold-based control system for the
tanker. The inlet valve will open when the water level falls below a lower threshold and close
when it rises above an upper threshold (e.g., aiming for a set-point around 75%). Students
will incorporate hysteresis to prevent rapid switching and observe how the system maintains
the desired water level. This exercise introduces basic closed-loop control and provides a
32
foundation for comparing simple bang-bang logic with more advanced PID control in later
sessions.
Objectives:
Open valve below lower threshold; close above upper threshold.
Try to maintain a certain water level (set-point value e.g. 75%)
Learning Outcomes:
Implement hysteresis to prevent toggling.
Simulate industrial level control.
Compare with PID control later.
Session 4: Implement Proportional Control (P-only)
In this session, students will implement a proportional (P-only) control system to regulate the
tanker’s water level. They will adjust the proportional gain (Kp) and observe how the system
responds to deviations from the set-point. Students will learn how P-control reduces steady-
state error compared to basic threshold control, but may still exhibit overshoot or oscillation.
This exercise introduces the concept of proportional feedback, demonstrates its effect on
system stability, and prepares students for implementing full PID control in the following
session.
Objectives:
Apply P-control.
Adjust Kp and observe response.
Learning Outcomes:
Implement P-control and test effects.
Understand proportional gain impacts.
Identify steady-state error.
Session 5: Full PID Control of Water Level
In this session, students will implement a full PID control system, incorporating proportional
33
(P), integral (I), and derivative (D) terms, to regulate the tanker’s water level. They will tune
the Kp, Ki, and Kd parameters to achieve stable and accurate level control with minimal
overshoot and oscillation. Students will observe the dynamic response of the system under
different disturbances, learning how PID control provides smooth and precise regulation. This
exercise reinforces closed-loop control concepts and demonstrates the advantages of PID over
simpler threshold-based methods.
Objectives:
Implement full PID with P, I, D terms.
Tune Kp, Ki, Kd for stable level control.
Learning Outcomes:
Build closed-loop PID system.
Tune for minimal overshoot.
Session 6: Compare PID vs. Threshold Control
In this session, students will run both the PID-controlled and basic threshold (bang-bang)
control strategies on the same tanker system. They will observe and compare the stability,
accuracy, and responsiveness of each method, noting differences in overshoot, oscillation,
and settling time. This exercise helps students understand the practical advantages of PID
control in maintaining precise water levels, and encourages reflection on optimization
techniques and control strategy selection for industrial applications.
Objectives:
Run PID and threshold control on the same system.
Compare stability, accuracy, responsiveness.
Learning Outcomes:
Evaluate PID vs. bang-bang control.
Justify PID for complex applications.
Reflect on optimization techniques.
34
Lab 6: Single Pole Traffic Light System
Overview
This lab introduces students to sequential control, timing, and state-based logic through a
simple traffic light system. The setup consists of a single pole with Red, Yellow, and Green
LEDs representing the traffic signals. Students will learn to control the LEDs using digital
outputs, implement timed sequences, and replace blocking delays with non-blocking
programming techniques. Exercises include creating a basic light cycle, using a state machine
for smooth transitions, and understanding timing considerations for real-world traffic
applications.
By the end of this lab, students will be able to design and implement a functional, reliable
traffic light controller while gaining foundational experience in time-based and state-driven
automation logic.
Session 1: Basic LED Control for Traffic Lights
In this session, students will manually control the Red, Yellow, and Green LEDs of a single-
pole traffic light using Arduino digital outputs within the Factory Prime Studio environment.
They will write simple code to turn each LED ON and OFF using digitalWrite() with
delays, creating basic sequences. This exercise introduces GPIO usage, multiple output
control, and the fundamentals of traffic light sequencing, helping students understand how
individual signals can be manipulated to simulate real-world traffic systems.
35
Objectives:
Control Red, Yellow, Green LEDs.
Practice digitalWrite with delays.
Learning Outcomes:
Operate multiple LEDs.
Understand GPIO usage.
Create hardcoded sequences.
Session 2: Create a Time-Based Light Sequence
In this session, students will program a full traffic light cycle, transitioning through Green,
Yellow, and Red states using timed delays. They will implement realistic durations for each
light, simulating actual traffic signal timing. This exercise reinforces time-based control,
demonstrates temporal coordination of multiple outputs, and helps students understand the
importance of proper sequencing for traffic safety.
Objectives:
Implement Green Yellow Red cycle.
Use delay for timing.
Learning Outcomes:
Program realistic timing sequences.
Demonstrate temporal control.
Explain traffic safety timing.
Session 3: Replace delay() with millis() for Non-Blocking Control
In this session, students will update their traffic light program to use millis() instead of
delay() for timing, enabling non-blocking control. This allows the system to perform other
tasks concurrently while maintaining accurate light cycles. Students will learn event-based
timing, background task management, and how to avoid code delays that freeze execution,
which is essential for scalable and responsive control systems.
Objectives:
36
Transition to millis-based timing.
Allow
background
tasks.
Learning Outcomes:
Write non-blocking timing logic.
Understand event-based timing.
Prepare for scalability.
Session 4: Implement a State Machine for Traffic Light Logic
In this session, students will structure the traffic light program using a state machine, defining
GREEN, YELLOW, and RED states and switching between them based on timing. This
approach modularizes the logic, improves code clarity, and makes it easier to modify or
extend. Students will gain hands-on experience applying state machine concepts to a practical
control system, preparing them for more complex automation tasks in industrial applications.
Objectives:
Define GREEN, YELLOW, RED states.
Switch states based on time.
Learning Outcomes:
Apply state machine concepts.
Modularize traffic light logic.
Improve code clarity.
37
Lab 7: Elevator System across 3 Floors
Overview
This lab provides students with hands-on experience in multi-level automation, control logic,
and sensor integration through a three-floor elevator system. The setup includes an elevator
car, motors for vertical movement, and sensors to detect the car’s position on each floor.
Students will learn to read sensor states, control motor direction, and implement logic to
move the elevator accurately between floors. Exercises cover manual control, automated
floor-to-floor travel, handling multiple simultaneous requests, and prioritizing movement
direction based on queued calls. Additionally, students will program the system to respond to
up/down call buttons, manage request queues, and display the current floor status via the
Serial Monitor. This lab emphasizes real-time decision-making, event-driven programming
and the importance of coordinated control in multi-actuator systems.
By the end of the lab, students will understand how to design robust control logic for
automated vertical transport, a foundational skill for complex industrial and building
automation systems.
Session 1: Manual Control of Elevator Motor Direction
In this session, students will manually control the elevator motor to move the car upward or
downward using Arduino outputs within the Factory Prime Studio environment. They will
implement basic movement commands and stop logic, simulating direct motor control. With
38
all sensors and actuators pre-configured, students can focus on understanding bidirectional
motor operation, testing safe switching between directions, and observing the elevator’s
movement in real time. This session lays the foundation for automated floor-to-floor control
in subsequent exercises.
Objectives:
Drive elevator motor upward/downward.
Implement movement and stop control.
Learning Outcomes:
Understand bidirectional control.
Test safe motor switching.
Simulate manual motion.
Session 2: Read and Interpret Car Position Sensors
In this session, students will monitor the elevator’s position using three digital sensors
corresponding to the ground, first, and second floors. The sensor states will be read and
displayed on the Serial Monitor in real time. Students will learn to map sensor values to
actual elevator positions, differentiate between floors, and build a foundation for automated
control. This exercise emphasizes real-time feedback interpretation and prepares students for
floor-to-floor travel logic in later sessions.
Objectives:
Use three digital inputs for oor detection of the car.
Monitor sensor status via Serial monitor.
Learning Outcomes:
Map sensor values to elevator positions.
Build real-time feedback.
Differentiate oor presence.
Session 3: Floor-to-Floor Travel with Stop Logic
In this session, students will implement automated movement of the elevator to a selected
39
target floor. The elevator motor will run until the corresponding floor sensor is triggered, at
which point the motor stops. Students will also program the door to open for a set duration
(e.g., 5 seconds) and then close automatically. This session teaches goal-based motion,
sensor-driven decisions, and basic elevator door management, simulating real-world point-to-
point control in multi-floor systems.
Objectives:
Move elevator to target oor.
Stop when target oor sensor triggers.
Open the Elevator Door and wait for a certain time (e.g. 5 seconds)
After the waiting time, close the Elevator Door
Learning Outcomes:
Implement goal-based movement.
Practice sensor-based decisions and elevator door management.
Simulate point-to-point control.
Session 4: Read Up/Down Call Buttons for Each Floor
In this session, students will program the elevator to respond to call buttons on each floor.
When a button is pressed, the system reads the input and moves the elevator to the requested
floor. This exercise teaches integration of user requests into automated control, reinforces
sensor and input handling, and simulates typical elevator call behavior in real-world systems.
Objectives:
Read call buttons of each oor.
Move elevator to requested oor.
Learning Outcomes:
Integrate user requests.
Understand elevator call behavior.
Session 5: Implement Internal Request Handling with Queue
In this session, students will implement a queuing system to manage multiple floor requests
40
in the order they are received (e.g., floors 1 3 2). The elevator will execute requests
sequentially, ensuring no requests are missed. This exercise introduces memory-based request
handling, reinforces structured programming, and allows students to compare different
queuing strategies for efficient elevator operation.
Objectives:
Queue oor requests (e.g., 1 3 2).
Execute requests in order.
Learning Outcomes:
Structure request queues.
Explore memory-based handling.
Compare
queuing
logic.
Session 6: Directional Priority Handling
In this session, students will enhance the elevator control system by prioritizing requests
based on the current direction of travel. The elevator will serve all requests in the current
direction before reversing, avoiding unnecessary direction changes. This exercise teaches
students how to implement efficient movement logic, simulating real-world elevator group
control, optimizing flow patterns, and improving system responsiveness.
Objectives:
Prioritize requests based on direction.
Avoid unnecessary direction reversal.
Learning Outcomes:
Simulate elevator group control.
Enhance efficiency via directional logic.
Implement
ow
patterns.
Session 7: Display Current Floor over Serial
In this session, students will program the elevator system to display its current floor in real
time on the Serial Monitor. As the elevator moves and stops at different floors, the display
will update accordingly. This exercise reinforces real-time feedback, enhances user interface
41
design, and provides students with experience in monitoring and reporting system status for
operational clarity.
Objectives:
Show current oor in Serial Monitor.
Update display in real time.
Learning Outcomes:
Output elevator status.
Enhance user feedback.
Build display interfaces.
42
Lab 8: Ball Balancing Using Servo and Ultrasonic Sensor
(PID)
Overview
This lab introduces students to real-time feedback control and dynamic system stabilization
using a ball-balancing platform. The system consists of a platform controlled by a servo
motor and an ultrasonic sensor that measures the ball’s position. Students will first learn to
read sensor data, then manually control the platform to understand the relationship between
tilt and ball movement. The lab progresses to implementing proportional control and finally
full PID control to maintain the ball at a target position automatically. Exercises also include
introducing disturbances to observe the system’s response and tuning PID parameters for
optimal performance.
By the end of this lab, students will understand the principles of closed-loop control, how
sensors and actuators interact in dynamic systems, and how PID controllers provide stability
and smooth responses in real-time applications.
Session 1: Reading Distance from the Ultrasonic Sensor
In this session, students will use the Arduino’s analog input to measure the distance between
the ramp platform and the ball using an ultrasonic sensor. They will calibrate the sensor
readings and display real-time distance values on the Serial Monitor. Students will observe
how the ball behaves on the ramp and how the sensor readings respond to movement. This
exercise introduces ultrasonic sensing, timing, basic noise considerations, and filtering
43
techniques, forming the foundation for subsequent servo control and PID balancing.
Objectives:
Measure distance to ball using analog Read command in your Arduino.
Calibrate and test with Serial output.
See behavior of the ball on the ramp and reading of the ultrasonic sensor.
Learning Outcomes:
Obtain distance values in meters/centimeters.
Understand ultrasonic timing/noise.
Apply basic filtering.
Session 2: Manual Control of Servo to Tilt Platform
In this session, students will manually control the servo to tilt the platform and position the
ball at a desired location. They will map servo angles to platform inclination and observe how
PWM values affect servo movement. This exercise helps students understand the relationship
between platform tilt and ball movement, practice precise servo control, and visually relate
angle adjustments to motion, preparing for proportional and PID-based automated balancing
in later sessions.
Objectives:
Use manual control to tilt the platform to a desired position to balance the ball at desired
position.
Map servo angle to inclination.
See the response of the servo driver with certain PWM values.
Learning Outcomes:
Control servo motion.
Observe angle effects on ball position.
Relate angle to motion.
Session 3: Implement Proportional Control (P-Control)
44
In this session, students will implement a proportional (P) control system to automatically
adjust the servo based on the ball’s position error. They will experiment with different Kp
values and observe how the system responds to maintain the ball near the desired position.
This exercise introduces proportional feedback, helps students understand the effects of gain
on system stability, and allows them to identify oscillation or overshoot issues before moving
on to full PID control.
Objectives:
Apply P-control
Observe system response with Kp.
Learning Outcomes:
Control servo based on position error.
Understand proportional gain effects.
Identify oscillation issues.
Session 4: Full PID Control for Ball Balancing
In this session, students will implement full PID control, incorporating proportional (P),
integral (I), and derivative (D) terms to stabilize the ball on the tilting platform. They will
tune the Kp, Ki, and Kd parameters to achieve smooth and continuous balancing with
minimal overshoot. This exercise allows students to build a closed-loop control system,
analyze the contributions of each PID term, and maintain the ball at the target position under
normal conditions.
Objectives:
Implement full PID with P, I, D terms.
Tune for stable ball balancing.
Learning Outcomes:
Build closed-loop PID system.
Analyze PID term effects.
Achieve continuous balancing.
Session 5: Introduce Disturbances and Observe Recovery
45
In this session, students will deliberately introduce disturbances by moving the ball on the
platform and observe how the PID-controlled system rebalances it. They will evaluate
recovery time, stability, and response behavior. This exercise teaches students to assess the
robustness of the PID controller, fine-tune parameters for minimal overshoot, and understand
system stability under dynamic conditions.
Objectives:
Move ball and observe rebalancing.
Evaluate recovery time/stability.
Learning Outcomes:
Assess PID controller robustness.
Fine-tune for minimal overshoot.
Understand stability under disturbances.
Session 6: Log Ball Position vs Time Data for Analysis
In this session, students will log the ball’s position over time to an Excel file or compatible
format while the PID system is running. They will use the collected data to analyze the
system’s dynamic response, performance, and stability. This exercise introduces runtime data
acquisition, response curve analysis, and diagnostic techniques, helping students evaluate
controller effectiveness and optimize PID parameters for precise ball balancing.
Objectives:
Log ball position vs time as excel file.
Use data for performance analysis.
Learning Outcomes:
Implement runtime data acquisition (in excel file format).
Analyze
response
curves.
Learn diagnostic methods.
46
Lab 9: Box Sorting by Height with Four Conveyors
Overview
This lab focuses on automated sorting and decision-making using sensor-based detection. The
system consists of four conveyor belts and an ultrasonic sensor that measures the height of
each box passing through the system. Students will learn how to read sensor data, interpret
measurements, and implement control logic to direct boxes to the correct conveyor based on
their height. Exercises include manual motor control for sorting, programming automatic
routing, and handling multiple objects in sequence.
By the end of this lab, students will understand how to integrate sensors and actuators for
classification tasks, implement decision-based control logic, and simulate industrial sorting
operations commonly used in packaging, logistics, and manufacturing environments.
Session 1: Measure Box Height Using Ultrasonic Sensor
In this session, students will use an ultrasonic sensor to measure the distance between the
sensor and the top of each box on the conveyor. By comparing the measured distance with a
reference point, they will calculate the box height and display it on the Serial Monitor. This
exercise introduces real-time measurement, sensor calibration, and noise handling, forming
the foundation for automated sorting based on height in subsequent sessions.
Objectives:
47
Get distance readings from ultrasonic sensor.
Calculate box height from reference distance.
Learning Outcomes:
Convert readings to box height.
Calibrate sensor readings.
Account for measurement noise.
Session 2: Control the Sorting Conveyor Manually
In this session, students will manually operate the sorting conveyor using Arduino outputs,
testing both forward and reverse movement. They will learn how to control the conveyor belt
direction and speed while observing its response. This exercise helps students understand
actuator control, implement reusable conveyor functions, and verify that the sorting
mechanism responds correctly before automating height-based sorting in the next session.
Objectives:
Operate the soring conveyor with analog output.
Test forward and reverse control of the sorting conveyor.
Learning Outcomes:
Understand controlling the sorting conveyor belt forward and backward.
Write reusable conveyor functions.
Verify actuator response.
Session 3: Sorting Boxes Based on Their Height
In this session, students will implement automated sorting logic to classify boxes by height.
Using ultrasonic sensor readings, they will determine whether a box is small or large and
direct it to the appropriate conveyor pathleft for small boxes and right for large boxes. This
exercise introduces decision-making logic using switch statements or conditional structures,
allows students to design simple classification algorithms, and simulates an industrial height-
based sorting system.
Objectives:
48
Detect boxes and their heights
Identify their route based on their heights
Control the sorting conveyor to move small boxes to left and large boxes to the right
paths.
Learning Outcomes:
Implement decision trees/switch statements.
Design classification algorithms.
49
Lab 10: 2-Joint, 2D Planar Robotic Arm (IK)
Overview
This lab introduces students to robotic arm control, forward and inverse kinematics,
and actuator programming in a 2D plane. The system consists of a two-joint robotic
arm with DC motors for each joint and angle sensors to provide feedback on joint
positions. Students will first learn to control each joint manually and read angle values
to visualize arm positions. The lab progresses to implementing forward kinematics to
compute the end-effectors position and inverse kinematics (IK) to calculate joint
angles for desired target positions. Exercises also include moving the end-effector to
specific points, integrating sensor feedback, and implementing PID control to ensure
smooth motion.
By the end of this lab, students will understand the principles of planar robotic
motion, coordinate transformation, and precise joint control, providing a foundation
for more complex multi-joint and 3D robotic systems.
Session 1: Basic DC Motor Control for 2D Arm Joints
In this session, students will control each joint of the 2D robotic arm independently using DC
motors. They will test different angles and movements to understand how the motors drive
the arm joints. This exercise provides hands-on experience with motor actuation, familiarizes
students with angle range limits, and allows them to visualize joint motion, laying the
foundation for subsequent kinematics and control exercises.
50
Objectives:
Control each joints (DC motors) independently.
Test various angles and joint movement.
Learning Outcomes:
Control two DC motors for robotic joints.
Understand angle range limits.
Visualize angular movement.
Session 2: Reading Joint Angles and Visualizing Arm Position
In this session, students will read joint angle values from the 2D arm using analog sensors
connected to the Arduino. They will relate these readings to the physical positions of the arm
and display the angles on the Serial Monitor. This exercise helps students understand how
analog sensor data maps to actual joint positions, visualize arm movement in real time, and
build a foundation for implementing forward and inverse kinematics in later sessions.
Objectives:
Read joint angle values using analogRead() from angle sensors.
Relate sensor readings to the physical arm position.
Display angle values on the Serial Monitor.
Learning Outcomes:
Understand how analog sensor readings map to angular positions.
Visually interpret arm movement based on sensor feedback.
Build a foundation for motion control and kinematics.
Session 3: Understand 2D Arm Geometry and Forward Kinematics
In this session, students will implement forward kinematics (FK) for the 2D robotic arm by
writing Arduino code with hardcoded target angles θ1 and θ2. They will calculate the
expected X and Y coordinates of the end-effector and print these values to the Serial Monitor.
Students will then drive the joint motors toward the target angles, continuously monitoring
the actual joint angles via sensors. Finally, they will compare the simulated end-effector
51
position in the simulation with their FK calculations, learning how to validate theoretical
models against real system behavior. This exercise reinforces the relationship between
mathematical modeling, sensor feedback, and motor control while preparing students for
inverse kinematics and motion planning.
Objectives:
Compute end-effector position from joint angles.
Implement forward kinematics to see end effector position (X-coordinate, Y-coordinate).
Learning Outcomes:
Understand trigonometric relationships.
Verify geometric calculations.
Prepare for inverse kinematics.
Session 4: Implement Inverse Kinematics (IK) for Position Control
In this session, students will calculate the required joint angles (θ1 and θ2) for a given target
X, Y position of the end-effector using inverse kinematics formulas (law of cosines/sines).
On the Arduino, they will write code to compute these angles in real time and command the
DC motors to move the joints accordingly. Students will monitor the joint angles via sensors
and adjust the motor outputs until the end-effector reaches the desired position in the
simulation. This exercise helps students understand coordinate-to-angle transformations,
apply trigonometric solutions for 2-joint arms, and validate the accuracy of inverse
kinematics in practice.
Objectives:
Compute joint angles for target (X, Y).
Use trigonometry (law of cosines/sines).
Learning Outcomes:
Solve IK for 2-joint arm.
Convert coordinates to motor commands.
Understand
workspace
limits.
52
Session 5: Move to Target Point via IK-Based Control
In this session, students will extend their inverse kinematics implementation to accept
dynamic target positions via the Serial Monitor. The Arduino will compute the necessary
joint angles for each target point and drive the motors to move the end-effector accordingly.
Students will continuously read the joint angles via sensors and verify that the end-effector
reaches the desired positions in the simulation. This exercise teaches real-time IK-based
motion control, reinforces the connection between coordinate targets and joint commands,
and allows students to explore the workspace and reachability of the 2D robotic arm.
Objectives:
Accept target positions via Serial.
Move end-effector to positions.
Learning Outcomes:
Execute position-based control.
Explore kinematic reachability.
Session 6: Implement PID Control on Each Joint for Smooth Motion
In this session, students will replace abrupt joint movements with smooth transitions by
implementing PID control for each DC motor joint. Using the Arduino, they will read the
current joint angles from sensors, compute the PID output for each motor, and drive the
motors to reach the desired angles with minimal overshoot and oscillation. Students will tune
the Kp, Ki, and Kd parameters to optimize motion smoothness and monitor performance via
the Serial Monitor. This exercise teaches closed-loop control, motion damping, and simulates
industrial robotic arm behavior with precise, controlled movements.
Objectives:
Replace angle jumps with PID-controlled transitions.
Tune Kp, Ki, Kd for each motor.
Learning Outcomes:
Implement smooth joint motion.
Understand motion damping.
53
Simulate industrial arm behavior.
Session 7: Trace a Path by Moving Through Multiple Target Points
In this session, students will program the 2D robotic arm to follow a sequence of target points
using their previously implemented IK and PID control. On the Arduino, they will calculate
joint angles for each point, drive the motors smoothly using PID, and continuously read
sensor feedback to verify joint positions. Students will observe the end-effector tracing paths
in the simulation and compare the actual movement to the desired trajectory. This exercise
integrates motion planning, real-time control, and path execution, allowing students to
simulate drawing, inspection, or pick-and-place operations commonly found in industrial
applications.
Objectives:
Store/move through target point sequences.
Use IK and PID for smooth motion.
Learning Outcomes:
Create motion sequences.
Integrate motion with point tracking.
Simulate drawing/inspection paths.
54
Lab 11: 3-Joint, 2D Planar Robotic Arm (IK)
Overview
This lab expands on the concepts learned in Lab 10 by introducing a third joint to the planar
robotic arm, increasing its degrees of freedom and workspace. The system consists of three
DC motors controlling each joint and angle sensors providing real-time feedback. Students
will begin by controlling each joint independently and reading sensor data to visualize arm
positions. The lab then introduces forward kinematics for a 3-joint system, allowing students
to compute the end-effector’s position in 2D space. Inverse kinematics exercises guide
students in calculating joint angles for specific target positions and moving the end-effector
accordingly. PID control is applied to ensure smooth, precise motion across all joints.
By the end of this lab, students will be able to coordinate multiple joints, implement advanced
motion control strategies, and handle complex trajectories, preparing them for 3D robotic arm
applications in subsequent labs.
Session 1: Basic DC Motor Control for 3 Arm Joints
In this session, students will learn to control each of the three DC motor joints of the 2D
planar robotic arm independently. Using the Arduino, they will write code to drive each
motor to specific angles, observe the response, and test joint movement across its full range.
Students will monitor joint positions via analog sensors and ensure that each motor moves
correctly without interference from the others. This exercise helps students understand multi-
joint coordination; angle limits for each joint, and lays the foundation for implementing
55
forward and inverse kinematics in later sessions.
Objectives:
Control each joint (three DC motors) independently.
Test various angles and joint movement.
Learning Outcomes:
Control three DC motors for robotic joints.
Understand angle range limits for each joint.
Visualize coordinated movement in 3-joint systems.
Session 2: Reading Joint Angles and Visualizing Arm Position
In this session, students will focus on reading the angular positions of all three joints using
analog sensors connected to the Arduino. They will write code to map sensor readings to
actual joint angles and display these values on the Serial Monitor in real time. By observing
the simulated arm in Factory Prime Studio, students will relate the sensor feedback to the
physical arm configuration. This session builds a foundation for precise multi-joint control,
helping students understand how sensor readings reflect actual motion and preparing them for
forward and inverse kinematics implementations.
Objectives:
Control each joint (3 DC motors) independently.
Test various angles and joint movement.
Learning Outcomes:
Map analog sensor readings to angular positions for all joints.
Visually interpret multi-joint movement based on feedback.
Build a foundation for advanced motion control and kinematics.
Session 3: Understand 3-Joint Arm Geometry and Forward Kinematics
In this session, students will implement forward kinematics for the 3-joint planar arm on the
56
Arduino. They will use hardcoded joint angles to calculate the expected X and Y coordinates
of the end-effector and then drive the motors to these angles. By monitoring the joint angles
via sensors and observing the arm’s position in the simulation, students can compare the
calculated coordinates with the actual end-effector location. This exercise reinforces
trigonometric relationships in multi-joint systems and prepares students for inverse
kinematics and advanced motion planning.
Objectives:
Compute end-effector position from three joint angles.
Implement forward kinematics to see the end-effector position (X-coordinate, Y-coordinate).
Learning Outcomes:
Understand trigonometric relationships in multi-joint systems.
Verify geometric calculations for 3-joint arms.
Prepare for inverse kinematics in higher DOF arms.
Session 4: Implement Inverse Kinematics (IK) for Position Control
In this session, students will program the Arduino to compute the joint angles required for the
3-joint arm to reach a desired (X, Y) target position. They will use trigonometric and
geometric decomposition methods to solve the inverse kinematics problem and send
commands to the motors to achieve the calculated angles. Students will observe the
simulation to verify that the end-effector accurately reaches the target. This session teaches
handling redundancy, understanding workspace limits, and converting spatial coordinates into
motor control commands.
Objectives:
Compute joint angles for a target (X, Y) position with 3 degrees of freedom.
Use trigonometry and geometric decomposition methods.
Learning Outcomes:
Solve IK for a 3-joint planar arm.
Convert target coordinates to joint motor commands.
57
Understand redundancy and workspace limits.
Session 5: Move to Target Point via IK-Based Control
In this session, students will program the Arduino to accept target (X, Y) positions via the
Serial Monitor and use the inverse kinematics calculations to move the end-effector to the
specified points. They will verify the arm’s motion in the simulation, ensuring that all three
joints coordinate correctly to reach the target. This exercise reinforces position-based control,
tests the accuracy of IK algorithms, and introduces handling of reachable and unreachable
points within the arm’s workspace.
Objectives:
Accept target positions via Serial input.
Move the end-effector to specified positions.
Learning Outcomes:
Execute position-based control using IK.
Explore kinematic reachability and redundancy handling.
Session 6: Implement PID Control on Each Joint for Smooth Motion
In this session, students will enhance their Arduino code by replacing abrupt joint movements
with PID-controlled transitions. They will tune Kp, Ki, and Kd values for each motor to
achieve smooth and precise motion of the 3-joint arm. Students will observe the simulation to
see reduced overshoot and stabilized end-effector movement. This session teaches practical
PID implementation, motion damping, and simulates realistic industrial robotic arm behavior.
Objectives:
Replace abrupt angle changes with PID-controlled motion.
Tune Kp, Ki, Kd values for each joint motor.
Learning Outcomes:
Achieve smooth joint transitions and precise positioning.
Understand motion damping and overshoot control.
Simulate realistic industrial arm behavior.
58
Session 7: Draw or Trace Complex Paths
In this session, students will program the Arduino to store and execute a sequence of target
points for the 3-joint arm. Using inverse kinematics and PID-controlled motion, the arm will
move smoothly between waypoints to draw or trace a path in the simulation. Students will
monitor joint angles and end-effector positions to ensure accuracy and continuity. This
session integrates multi-joint coordination, trajectory planning, and real-time control,
simulating industrial applications such as inspection, painting, or pick-and-place operations.
Objectives:
Store and execute sequences of target points.
Use IK and PID to move smoothly between waypoints.
Learning Outcomes:
Create coordinated multi-joint motion sequences.
Perform continuous path drawing or inspection operations.
Integrate real-time control with programmed trajectories.
59
Lab 12: Full 4-Way Traffic Light System
Overview
This lab introduces students to multi-signal coordination, timing logic, and real-time
monitoring through a complete 4-way traffic light system. The setup includes four sets of
Red, Yellow, and Green LEDs representing an intersection, with control via a
microcontroller. Students will first test GPIO pins and individually control LEDs to ensure
proper connections. They will then implement full traffic light cycles, coordinating all
directions to simulate real-world traffic flow. Exercises include displaying timing
countdowns on the Serial Monitor and programming smooth transitions for emergency stop
commands received via Serial input.
By the end of this lab, students will understand complex sequential and conditional logic,
time-based control, and safe handling of asynchronous commands, providing a strong
foundation for traffic management systems and multi-output automation projects.
Session 1: GPIO Testing and Individual LED Control
In this session, students will test each GPIO pin connected to the Red, Yellow, and Green
LEDs of the 4-way traffic light system using Arduino. They will write simple Arduino code
to turn each LED on and off individually, verifying correct pin mapping and functionality.
Students will observe the LEDs lighting up according to their commands, ensuring all
connections are correct and learning the basics of digital output control. This foundational
session prepares students for implementing coordinated traffic light sequences in later
60
sessions.
Objectives:
Test all GPIO pins connected to traffic light LEDs.
Turn each LED (Red, Yellow, and Green) ON/OFF individually.
Learning Outcomes:
Verify wiring and pin mapping.
Understand basic digital output control for LEDs.
Session 2: Full Traffic Light Cycle Implementation
In this session, students will program the Arduino to implement the complete 4-way traffic
light logic. They will coordinate Red, Yellow, and Green phases for all four directions,
ensuring proper timing and sequencing. Students will test the full cycle in the simulation,
observing synchronized light changes and verifying that conflicting directions do not turn
green simultaneously. This session teaches time-based multi-output control and introduces
students to the concept of coordinated system logic for real-world traffic management.
Objectives:
Implement complete 4-way traffic light logic.
Coordinate Red, Yellow, Green phases for all four directions.
Learning Outcomes:
Create time-based control for multiple outputs.
Ensure correct synchronization between all lights.
Session 3: Timing Countdown Display on Serial Monitor
In this session, students will enhance their traffic light Arduino program to display the
remaining time for each signal phase on the Serial Monitor. The countdown updates in real-
time, reflecting the duration of Green, Yellow, and Red lights for all directions. Students will
learn to integrate time-tracking logic with the existing traffic light sequence and verify that
the countdown aligns with the simulated light phases. This session emphasizes real-time
feedback and monitoring, a key skill in SCADA and embedded control systems.
Objectives:
61
Display remaining time for each signal phase on the Serial Monitor.
Update countdown in real-time.
Learning Outcomes:
Implement time tracking in traffic light logic.
Provide live status feedback via serial communication.
Session 4:
Emergency Stop with Smooth Phase Termination
In this session, students will program the Arduino to detect an emergency stop command via
the Serial Monitor. When triggered, the system will complete the current phase for each road
before safely stopping all traffic lights, avoiding abrupt changes. Students will implement
interrupt-based or conditional logic to handle emergency events while maintaining smooth
transitions between states. This session teaches safe emergency handling, real-time control
adjustments, and the importance of orderly system shutdowns in industrial or traffic control
applications.
Objectives:
Detect emergency command from the Serial Monitor.
Gracefully stop all roads by completing their current phase before halting traffic.
Learning Outcomes:
Implement interrupt-based control for emergencies.
Manage smooth state transitions without abrupt signal changes
62
Lab 13: 3-Joint 3D Robotic Arm
Overview
This lab introduces students to spatial robotic control, 3D kinematics, and multi-joint
coordination using a three-joint robotic arm. The system consists of three DC motors controlling
each joint, angle sensors for feedback, and a 3D workspace for the end-effector. Students will
begin by controlling each joint individually and reading sensor values to visualize the arm’s
position in three-dimensional space. Forward kinematics exercises allow computation of the end-
effector’s (X, Y, Z) position, while inverse kinematics guides students in calculating the joint
angles needed to reach target points in 3D. PID control is applied to ensure smooth, precise
motion across all joints, and path-planning exercises teach students to move the arm through
multiple waypoints.
By the end of this lab, students will be capable of coordinating multi-joint movements in 3D,
implementing real-time feedback control, and understanding the principles of spatial robotic
manipulation used in industrial and research applications.
Session 1:
Basic DC Motor Control for 3D Arm Joints
In this session, students will independently control each of the three DC motors that drive the
robotic arm’s joints. Using the Arduino, they will write code to rotate each joint to specific
angles and observe the resulting 3D arm movement within the simulation. Students will
practice setting motor speeds, directions, and limits, while visualizing how individual joint
63
motions combine to create complex arm positions. This session establishes the foundation for
understanding joint control in three-dimensional robotic systems and prepares students for
integrating sensor feedback and kinematic calculations in later sessions.
Objectives:
Independently control each of the three DC motors for the arm’s joints.
Test various angles and joint movement ranges.
Learning Outcomes:
Operate three DC motors individually.
Understand angular limits and mechanical constraints for each joint.
Visualize motion in 3D space.
Session 2:
Reading Joint Angles and Visualizing 3D Arm Position
In this session, students will read angle values from sensors attached to all three joints using
analogRead() on the Arduino. They will map these sensor readings to actual joint angles and
display them in the Serial Monitor. By comparing sensor data with the 3D simulation,
students will learn to visualize the arm’s posture in real time, understanding how each joint’s
position contributes to the overall end-effector location. This session lays the groundwork for
implementing forward and inverse kinematics in subsequent exercises.
Objectives:
Read angle values from sensors on all three joints using analogRead().
Relate sensor readings to actual 3D arm positions.
Display angles on the Serial Monitor.
Learning Outcomes:
Map analog readings to angular positions.
Interpret arm posture in real time from sensor feedback.
Build a foundation for kinematics calculations.
Session 3:
Understanding 3D Arm Geometry and Forward Kinematics
64
In this session, students will use the joint angles read from sensors to compute the 3D
position (X, Y, Z) of the arm’s end-effector using forward kinematics formulas. They will
implement the calculations in Arduino, print the resulting coordinates on the Serial Monitor,
and compare them with the simulated arm position in the software. This hands-on activity
helps students understand spatial relationships between joints, verify geometric calculations,
and prepare for solving inverse kinematics in three dimensions.
Objectives:
Compute end-effector (X, Y, and Z) position from joint angles.
Implement forward kinematics to display position in real time.
Learning Outcomes:
Apply trigonometric and geometric relationships for 3D space.
Verify accuracy of geometric calculations.
Prepare for 3D inverse kinematics.
Session 4:
Implement Inverse Kinematics (IK) for 3D Position Control
In this session, students will write Arduino code to calculate the necessary joint angles to
reach a given target point in 3D space using inverse kinematics techniques. They will input
target coordinates via the Serial Monitor, compute corresponding joint angles, and command
the motors to move accordingly in the simulation. This exercise helps students understand the
relationship between spatial positions and joint configurations, explore workspace limitations,
and prepare for precise 3D motion control using both IK and PID.
Objectives:
Compute joint angles for a given (X, Y, Z) target position.
Apply 3D trigonometry and geometry methods.
Learning Outcomes:
Solve IK for 3-joint 3D arms.
Convert target coordinates to joint motor commands.
Understand workspace limits in 3D.
Session 5:
Move to Target Point via IK-Based Control
In this session, students will implement Arduino code to accept target positions for the 3D
65
robotic arm via the Serial Monitor and move the end-effector to these positions using the
previously calculated inverse kinematics. They will observe the arm’s motion in the
simulation, verify that the target points are reached accurately, and explore the arm’s
reachable workspace. This exercise reinforces position-based control and prepares students
for multi-point and path-following tasks.
Objectives:
Accept target positions from Serial input.
Move the arm’s end-effector smoothly to the specified position.
Learning Outcomes:
Execute precise position-based control.
Explore reachable workspace in 3D.
Session 6:
Implement PID Control on Each Joint for Smooth Motion
In this session, students will integrate PID controllers for each of the three joints to replace
abrupt angle changes with smooth, controlled motion. They will tune the proportional (Kp),
integral (Ki), and derivative (Kd) gains for each joint motor, observe the reduction of
overshoot and oscillation, and evaluate the stability of the arm’s movements. The Arduino
code will continuously read joint angles and apply PID corrections to achieve precise and
realistic motion, simulating industrial-grade robot behavior.
Objectives:
Use PID controllers to replace abrupt movements with smooth transitions.
Tune Kp, Ki, Kd values for optimal control.
Learning Outcomes:
Achieve stable and smooth motion on all joints.
Reduce overshoot and oscillation.
Simulate realistic industrial robot motion.
Session 7:
Draw a 3D Path through Multiple Target Points
In this session, students will program the 3-joint 3D robotic arm to move through a series of
predefined target points in 3D space. Using the previously implemented inverse kinematics
66
and PID control, the arm will interpolate smoothly between each waypoint. Students will
learn to store sequences of target coordinates, execute coordinated motion across all joints,
and simulate tasks such as pick-and-place or inspection paths. The session reinforces multi-
point trajectory planning, precise control, and integration of real-time kinematics with smooth
joint actuation.
Objectives:
Store and move through a sequence of 3D target positions.
Combine IK and PID for smooth multi-point movement.
Learning Outcomes:
Create continuous 3D motion sequences.
Simulate real-world pick-and-place or inspection paths.
67
Lab 14: Line Following Robot
Overview
This lab introduces students to mobile robotics, sensor-based navigation, and closed-loop
control. The system consists of a robot equipped with infrared (IR) sensors to detect a line
path and two motors for differential drive. Students will first learn to read sensor data and
control the motors manually to understand the relationship between sensor input and robot
movement. The lab progresses to implementing basic line-following logic, proportional
control for smoother steering, and finally full PID control to maintain accurate tracking along
complex paths. Exercises also include testing the robot’s response to sharp turns,
intersections, and disturbances on the track.
By the end of this lab, students will understand sensor integration, feedback-based motion
control, and strategies for precise autonomous navigation in mobile robotic systems.
Session 1: Reading Infrared (IR) Sensors
In this session, students will connect and read digital signals from the infrared sensors on the
line-following robot. They will calibrate the sensors to differentiate between the black line
and the white floor surface, ensuring reliable detection. Students will observe the real-time
sensor output via the Serial Monitor and understand how the sensor states reflect the robot’s
position relative to the line. This session provides foundational knowledge of sensor
interfacing, thresholding, and preparing data for navigation and control logic in subsequent
68
sessions.
Objectives:
Read digital signals from IR sensors.
Calibrate for line (black) vs. oor (white).
Learning Outcomes:
Understand sensor signals.
Implement thresholding.
Prepare for navigation.
Session 2: Basic Motor Control
In this session, students will control the two motors of the line-following robot,
experimenting with forward, backward, and turning movements. They will learn to use PWM
signals to adjust motor speed and understand how differential drive affects motion. Students
will implement simple motor control functions and observe the robot’s response to various
commands, establishing a foundation for integrating sensor input with movement in later
sessions.
Objectives:
Control two motors for movement.
Use PWM for speed control.
Learning Outcomes:
Learn differential drive control.
Map signals to motor behavior.
Build movement functions.
Session 3: Implement Simple Line Following Logic
In this session, students will combine IR sensor readings with motor control to make the
robot follow a predefined line. They will implement basic conditional logic to adjust motor
speeds depending on whether the robot is on the line or deviating. This exercise helps
students understand reactive control loops, sensor-based decision-making, and real-time
69
feedback, forming the foundation for more advanced control techniques like proportional and
PID control in later sessions.
Objectives:
Implement logic to follow a line.
Adjust motor speeds for tracking.
Learning Outcomes:
Create reactive control loops.
Understand
sensor-based
decisions.
Simulate feedback navigation.
Session 4: Implement Proportional Control for Steering
In this session, students will use the error signal from the IR sensorsthe difference between
the robot’s current position and the line’s centerto adjust motor speeds proportionally. By
applying proportional control, the robot will steer more smoothly along curves and reduce
overshoot. Students will learn how proportional gain affects responsiveness and stability,
gaining practical insight into tuning feedback loops for precise line-following behavior.
Objectives:
Use sensor error for proportional motor adjustment.
Improve smoothness of line following.
Learning Outcomes:
Apply proportional control.
Improve steering accuracy.
Observe feedback benets.
Session 5: Full PID Control for Line Following
In this session, students will implement a complete PID control loop to adjust the motor
speeds of the line-following robot. They will combine proportional, integral, and derivative
terms to minimize positional error, smooth out oscillations, and respond effectively to curves
and disturbances. Students will tune Kp, Ki, and Kd values through experimentation,
observing how each parameter affects tracking performance. This session provides hands-on
70
experience in advanced feedback control and demonstrates how PID controllers optimize
precision in real-world robotic navigation.
Objectives:
Implement PID for motor speed adjustment.
Tune Kp, Ki, Kd for smooth tracking.
Learning Outcomes:
Develop advanced feedback control.
Achieve precise line following.
Analyze control parameters.