Evan Klein

Hallway Robot

Overview

For my second project as part of my Fall 2025 “Mechatronics” class, I was tasked with putting together a robot that could travel down a hallway without hitting any walls, and, when it reached the end, had to do a full 180 degree turn and come back. Like my first project where I had to build a mini traffic light system, this project was a test for us to put all our knowledge and skills we had been learning throughout the semester together to complete a more complicated task.

Objective

This project tasked me with building and programming a small robot car that can roll down a hallway autonomously without hitting any walls. The car should consist of three DC motors, two in the back and one in the front, along with a stepper motor attached to the front DC motor to steer the vehicle, and at least three ultrasound sensors to detect its surroundings. When the car reaches the end of the hallway, it should use the stepper motor to make a 180-degree turn on the spot, without hitting any of the walls around it. Along with these requirements, when the car is moving forward, 2 clear LEDs should turn on as headlights, and when the car is turning left or right, a respective yellow led on the side of the car should light up.

Method

As the car moves forward down the hallway, it will use one ultrasound sensor on the right side and one on the left side to read how far away each wall is. If one distance gets a little too bigger than the other one, meaning its straying from the center line of the hallway and getting close to a wall, the stepper motor should turn on to turn the car back towards the center line, then straighten back out. In conjunction with the side ultrasound sensors, an ultrasound mounted on the front facing forward will check if the car is approaching the end of the hallway, and if it gets within a certain distance, the car will stop then complete a 180-degree turn. The car will then come back down the hallway towards its starting point, and if the front ultrasound sensor detects getting too close to an object again or if the car has been traveling back for the same time duration it took to go down the hallway, the car will stop all operations.

Results

This was a much more complex project compared to my first one because of all the different motors and moving parts I had to make work together. Again, this was a no-team project, so when problems arose, like how to connect my stepper motor to the front wheel so my robot could steer, I had to figure out how to solve them myself. This project showed me the importance and art of troubleshooting and how beneficial keeping your wires and code organized can be. Even with all the planning and thought I put in before I even started connecting wires, if I had tried to present my project without first testing it I would have failed miserably. Testing and troubleshooting are a part of the engineering process, and getting to really have to put in the time to make this robot work taught me a very practical skill.