This was my first ever personal project using arduino, and my goal was to gain hands on personal experience to elevate my knowledge in the field of mechatronics. There are many similar projects on the internet, and I tried my best to make my robot as unique as possible by incorporating ideas that weren't as common.
The core idea was to build an Arduino powered obstacle-avoiding robot using an ultrasonic sensor, servo motor, motor driver, and 12V battery pack. Sounds pretty simple but throughout the build I realized how important problem-solving is because I faced many challenges that I had to overcome.
Problem 1: Components didn’t fit on the chassis.I ran into spacing issues pretty quickly. The chassis was small, and with all the modules (Arduino, ultrasonic sensor, motor driver, servo, and wiring) it was overflowing. My fix? I created DIY component holders using popsicle sticks. I stacked them to elevate certain parts and free up chassis space without affecting stability. It was basic, but it worked.
Problem 2: Servo motor wasn’t getting enough power.The servo motor was acting erratic or not moving at all. After some testing, I realized it wasn’t getting enough current when everything else was running. I ended up powering the servo through a separate regulated 5V output, bypassing the Arduino’s limited current capacity, and grounding everything properly. That solved the issue.
Problem 3: Robot wouldn’t drive straight.Even when both motors were being powered equally, the robot kept drifting to one side. After inspecting the hardware, I realized the left and right motors weren’t delivering the same output, probably due to inconsistencies in cheaper DC motors. I fixed it by calibrating the PWM signals in the Arduino code. I sent slightly more power to the weaker motor until the robot could move forward in a straight line.
Other Fixes:Loose wires and disconnects: I secured all the jumpers with hot glue once I finalized connections.
Sensor jitter: The ultrasonic sensor sometimes returned faulty distances. I added basic averaging to smooth out readings.
Comments