In this project, you will design, build, and test an autonomous Factory Robot. Your goal is to create a digital system that allows the robot to navigate a warehouse floor by following a line, stopping at stations, and handling parcels.
This project is designed to assess your ability to develop a digital technologies outcome (5 Credits). You will use electronics and programming to solve a real-world automation problem.
To succeed in this standard, you will follow an iterative process:
Define: Describe the robot’s purpose, users, and specific requirements.
Develop: Use digital tools (like Arduino C, circuit diagrams, and Trello) to build your robot's "brain" and sensor systems.
Test: Check your robot's functionality and use feedback to fix errors.
Refine: Improve your code and hardware to make the robot faster, more reliable, and more professional.
Electronic Research: Investigate components like microcontrollers, ultrasonic sensors, and motor controllers. You must justify why these parts are right for a warehouse robot.
Programming & Logic: Write code to manage navigation. You will start with a simple one-sensor line follower and progress toward a complex system that can handle distance sensing and line following simultaneously.
Conventions & Version Control: To achieve higher grades, you must use clear code comments, standard wiring colors, and save multiple versions of your software to show how it evolved.
Documentation: Maintain a Development Log with photos of your progress, screenshots of your code, and evidence of how you used feedback to improve your robot.
By the end of this project, you will have a working digital prototype that demonstrates the skills needed for a career in robotics and software engineering.
Before embarking on the line following robot project, students should possess a foundational understanding of key concepts and skills that will be essential for their success. This section outlines the initial knowledge and skills that students are expected to have, ensuring they are well-prepared to tackle the challenges of developing, building, and programming an autonomous robot for factory automation.
Students should have prior experience or familiarity with the following areas:
Basic Electronics: Understanding of fundamental electronic components such as resistors, capacitors, LEDs, and transistors, and other subsystems, along with the ability to read simple circuit diagrams, data sheets and assemble basic circuits.
Soldering: Proficiency in soldering techniques, including how to safely and effectively solder components onto a printed circuit board (PCB) or Vero board. Students should be comfortable using a soldering iron, tinning wires, and creating strong, reliable solder joints.
Programming: Proficiency in a programming language commonly used in robotics, such as Arduino C. Students should be comfortable writing, debugging, and testing code, as well as understanding basic programming concepts like loops, conditionals, and functions.
Microcontroller Basics: Knowledge of microcontrollers, such as Arduino, including how to interface with sensors and actuators, write and upload code, and troubleshoot common issues.
Sensors and Actuators: Familiarity with various types of sensors (e.g., IR sensors, ultrasonic sensors) and actuators (e.g., motors, servos) used in robotics, including how to connect and use them in a circuit.
Mechanical Assembly: Basic skills in assembling mechanical components, using tools, and understanding simple mechanical drawings. Experience with gears, motors, and chassis construction will be beneficial.
Testing and Measurement: Ability to use a multimeter to measure voltage, current, and resistance. Students should be capable of using a multimeter for diagnosing and troubleshooting basic circuit issues.
Problem-Solving and Critical Thinking: Ability to approach problems methodically, think critically about potential solutions, and iterate on designs based on testing and feedback.
Note to Teachers: By ensuring that students have these foundational skills and knowledge, they will be better equipped to engage with the project, apply their learning effectively, and innovate as they develop their line following robot. This groundwork will enable them to focus on the more advanced aspects of the project and achieve successful outcomes.
Te Whare Pūmanawa Electronics is a robotics company in the heart of Aotearoa. Today, a group of new graduates is joining the robotics team. They're excited about the challenge of creating a robot for an online electronics business that has been experiencing a surge in activity.
Guided by mentors, they will implement a design where they have the opportunity to add their own unique touch. In the end, only four of them will be chosen to leave a lasting impact where innovative ideas and values, including sustainability, come together. Welcome to a short but significant journey where they'll craft sustainable and reliable robots at Te Whare Pūmanawa Electronics!
"Te Whare Pūmanawa Electronics" translates to "The House of Innovation Electronics" in English. The name is a combination of Māori and English words. In Māori, "Te Whare" means "The House," "Pūmanawa" can be interpreted as "Innovation" or "Creative," and "Electronics" remains the same in both languages. The combination reflects a fusion of Māori cultural elements with a focus on innovation and technology within the field of electronics.
You are to build an automated robot system with the ability to follow a designated line on the warehouse floor using the following guidelines. The layout is as shown below. There are three stations: A. B and C. The idea is to pick up parcels from Station B and C and drop them off at Station A.
Although the most important function is the ability to follow the line, extra features such as the ability to stop at pickup stations, wait for package addition, continue to delivery stations, and return to the pickup station should be included. You must Include an indicator on the empty robot, like a green LED, to signal readiness for loading. You can add an extra display for instructions or status of the robot. All the initial designs are given to you.
Note to Teachers: This project can be modified to fit the resources available in your classroom. All components required for the line following robot are readily available online, allowing flexibility in procurement and adaptation to different educational environments.
In this section you are given the initial design and starter code for your project. All components will be available. You must add line following plus another function of your choice. The specifications are:
The Robot must
Follow a black line 32mm wide
Be less than 200 x 150 x 120mm
Have a mobile power source
Use recyclable materials
The Robot should
Be able to carry objects up to 100 grams (this is the maximum weight of a package), with a size (diameter) of up to 2 centimetres
Stop when an object is less than 30mm away
Show a green LED when it is ready for a package
The Robot could
Stop at Station A
Stop at Station B and C
Flash a light when it loses the line or crashes
We will start by building our circuit digitally in Tinkercad. This allows us to understand the layout and practice the wiring before handling the real components. Once you are confident with the simulation, we will move on to building the physical robot.
⚠️ Important Note: The tutorial below uses a slightly different looking motor controller than the one in your kit, but it uses the exact same pinout and ports.
Please double-check that your virtual robot uses the same pins as the diagram to the left. If your wiring doesn't match the diagram, your code will not work later on.It's Safe: You cannot "fry" a virtual component! In the real world, incorrect wiring can damage your motor driver or Arduino. In Tinkercad, it allows you to fail safely.
Easy Troubleshooting: It is much faster to move a virtual wire than to strip and reconnect real ones.
Code Verification: You can simulate your code to ensure the logic is correct before you ever upload it to the hardware.
Assembling the movement components of an Arduino robot is a foundational step towards creating a functional and versatile robotic platform.
To ensure proper wiring and ease of assembly, it's beneficial to add wires to the motors before starting the assembly process, if this step hasn't been completed yet. This allows you to handle and position the motors more conveniently during installation on the chassis, ensuring secure connections and minimizing the risk of wiring issues later on.
See this video on the right to assemble the hardware.
By focusing on these hints specifically related to movement, you can ensure that the motion components of your Arduino robot are assembled correctly and function as intended.
Carefully assemble the robot, keeping the following in mind:
Mount Motors & Wheels: Securely mount the motors to the chassis using brackets and firmly attach the wheels so they do not slip during operation.
Connect Wiring: Follow the wiring diagram and table to connect the motors and Arduino. Use flexible wire for the motors and Dupont wires for the Arduino pins, ensuring correct polarity.
Check Power: Ensure the motors receive the correct voltage and current without overloading the motor driver or Arduino.
Secure Connections: Tidy up all wiring with cable ties or adhesive mounts to prevent loose connections while the robot moves.
Test Movement: Test each motor individually with simple code to confirm the correct rotation direction and speed.
Fine-Tune: Adjust wheel alignment and motor settings as needed to ensure the robot moves smoothly.
First step is to test the left motor for speed and direction using this code:
digitalWrite( 7, HIGH);
digitalWrite( 6, LOW); // Swapping High and Low change direction
analogWrite (9, 160); // Speed 0 - to 255 (8 bit ADC)
Modify for the right wheel and test.
For movement you should create functions for each operation:
Forward
Backward
Turn Left
Turn Right
Rotate Left
Rotate Right
Create functions for various movements so it is easier to use it in the main loop. A good example is also to input variables for the speed so you have more control over the movement.
Example Code:
The HC-SR04 ultrasonic sensor is used to measure distance by sending out high-frequency sound waves and calculating how long they take to reflect back from an object. This allows it to detect obstacles with good accuracy, making it ideal for robotics and automation projects.
In this task, you will program your robot to navigate a circuit without colliding with objects or other robots. Your code should continuously check distances and adjust the robot’s movement accordingly.
To attach the sensor, you will need a mounting bracket. First, use a vernier caliper to accurately measure the dimensions of the HC-SR04 sensor. You will then design a custom bracket or enclosure using 3D modelling software and print it using a 3D printer. This process develops practical engineering and digital design skills.
A good resource to understand how the HC-SR04 works with Arduino is the tutorial: “Ultrasonic Sensor HC-SR04 with Arduino Tutorial”
To be able to do line following you will use the TCRT5000 infrared sensor or equivalent. Your first task is to check the value of the sensor for various surfaces. Most line sensors have 3 outputs but others may have four outputs.
Your first step will be to find the optimum distance for the line sensor for the line you want to measure. Connect to the Arduino using the wiring diagram on the right.
Hold the sensor over the black line with the diodes facing down. Move over black line and find the optimum distance from the surface for maximum value difference between black and white as read on the serial monitor. You have to mount the sensor that height from the surface using spacers etc.
Complete single sensor line following for Achieved. This tutorial will give you ideas about how to mount and program the robot. Start with deciding if you want to follow the line from the left or the right, then create the pseudo code.
Pseudocode for left-sided line following with a black line:
If sensor sees black
turn left (Don’t rotate as you want to make a slow turn to ensure you move forward. Both motors should be moving, one will be must slower, Motor A 50, Motor B 100)
if sensor sees white
turn right
Experiment with increased speed and variations until the most reliable line- follow.
Note: There are sensors that return a digital value but it needs to be calibrated. You can use any you like.
When you have done one-sensor line following, add another sensor. You may have to review the position of your sensors. There are lots of tutorials online for these.
On the left have a look at the position of the line sensors. You must experiment with the distance between them and the height to get the optimum performance.
Use spacers to adjust the height. This height was determined earlier and should be check for all line sensor as they are not all the same.
If you haven’t worked it out by now, using functions is a key strategy for success in this project. By grouping code into labeled blocks like goForward() or stopRobot(), you make your program much easier to read and troubleshoot. Instead of repeating the same motor commands over and over, you can just "call" the function whenever you need it. This keeps your main logic clean and organized, which is exactly what's required to meet the professional coding conventions for Achievement Standard 92005.
The robot is designed to carry objects weighing up to 100 grams, with a maximum diameter of 2 centimeters. The system includes three stations: A, B, and C. Its primary task is to pick up parcels from Stations B and C and deliver them to Station A.
The most critical function is the robot's ability to follow a line. Additionally, it should have features such as stopping at pickup stations, waiting for package loading, continuing to delivery stations, and returning to the pickup stations.
To enhance functionality, a green LED indicator should be included to signal the robot's readiness for loading when it is empty. An additional display can be added to provide instructions or display the robot's status.
Precision Calibration Weights from Aliexpress
50g 2x20g 10g 5g Mini Weight set. These scales work well as potential packages and students design their package holder around this.
As we use an Arduino it is important that we think about input and output. So the input is from the light via the voltage divider circuit to the analog input of the Arduino. We use an LED as an output on the Arduino.
Ensure that you calculate the value of R3 based on the specifications of your LED as the Forward Voltage of various colour LEDs are different. Go back to the Ohm's Law explanation if you are confused.
The housing for the package handler is 3D printed specifically to encase the light-dependent resistor (LDR) used in the Arduino robot.
Made from durable PLA material, the housing is designed to securely hold the LDR in place, ensuring accurate and reliable detection of whether the robot has a package.
The compact and lightweight structure allows for easy integration with the Arduino robot, ensuring it does not interfere with the robot's performance. The housing also features precise cutouts to facilitate wiring and connectivity, optimising the functionality of the LDR sensor in determining the presence of a package.
Additionally, the design is simple enough that students can easily create and customise their own housings, providing a hands-on learning experience in 3D modeling and printing.