How to make a wheeled self-balancing robot using ultrasonic sensors
Source: InternetPublisher:风向西瓜 Keywords: Robot Ultrasonic Sensor Arduino Updated: 2024/12/17
This is a wheeled self-balancing robot. Powered by Arduino UNO and balanced by ultrasonic sensors, it is able to maintain vertical balance by itself.
Power Source
Power is provided to the robot by two geared DC motors.
Build
Step 1: Connect the Geared DC Motor
Now we connect the wheel to the shaft of the motor.
Step 2: Prepare the PVC T-Joint
This is the T-joint for the PVC pipe. We will use this to hold the motor in place and the wires will come out of the hole at the top.
Step 3: Wire the motor via the T-connector
Before we can secure the motors in this pipe, we have to wire them up. We will be running 4 wires through the top hole. Split at both ends, 2 wires per motor.
Step 4: Pull the wire through the top hole
We will pull the wires back from the T-junction so the motor can be in place.
Step 5: Secure the Motor in Place
Now we have the motor secured in the T-joint.
Step 6: Add Pipe in Top Hole to Mount Ultrasonic Sensor
We added some tubing to the line end of the T-junction, which we will mount the sensor to later.
Circuit Schematic
Circuit Schematic We use L2938 H-bridge motor driver IC to rotate the motor in both directions.
Concept of a self-balancing robot
The concept of this self balancing robot is simple. We have an ultrasonic sensor which is able to measure the distance between the robot and the obstacle in front of it.
If the distance is greater than the fixed distance, the robot will move forward; if the distance is less than the fixed distance, the robot will move backward to avoid falling.
Interfacing Ultrasonic Sensor for Self-Balancing Robot using Arduino
The ultrasonic sensor has 4 pins, namely trigger, echo, power and ground. 4 wires are connected from the pins to the microcontroller.
Balancing robot body
Now, the robot is placed vertically on the ground. It looks like it is balanced because it is constantly moving to keep itself balanced. But at the same time, it is actually getting some support from the wire I am holding in my hand.
It keeps oscillating back and forth and these oscillations need to be damped. So the robot will remain balanced and stand on one point without any movement.
Possible problems and solutions
If it goes beyond a certain point then it will not be able to recover on its own. These motors require more power to respond quickly.
While testing, the second H-bridge of the L293D got fried. So, I had no chance to control it via PID.
To actually balance it, we could use an MPU-6050 Inertial Measurement Unit. Instead, we used this cheap ultrasonic sensor.
CAD Design of Self-Balancing Robot
This is the CAD design of a wheeled self-balancing robot. Here we can see two motors, connected to the two wheels. These motors are mounted in a PVC T-joint. A vertical PVC pipe is connected to the T-joint and an ultrasonic sensor is attached to the pipe.
in conclusion
Fortunately, at the end of the project, we managed to balance it a little bit. I am quite satisfied with the result, and all the efforts were worthwhile.
- Analysis of the working principle of the sound and light controlled delay switch circuit
- The meaning and importance of circuit protection, common types of circuit protection
- Peripheral circuit of automotive motor controller power supply chip
- How to Make a Hot Tub Smart and Remotely Operated with a Raspberry Pi
- What is a RADAX motor?
- Working principle of one Xipu STR soft starter controlling two motors
- Methods for Eliminating Noise of Brushed DC Motors
- Temperature control circuit design and analysis
- PIC microcontroller controlled remote anti-theft alarm circuit
- Homemade anti-theft watchdog
- Homemade disinfectant circuit
- Rural fish farming control circuit
- Multi-channel patrol detection control circuit b
- Simple timing control circuit
- Photoelectric tracking control circuit
- Traffic traffic light control circuit
- Schematic diagram of motor PLC control circuit
- Sprinkler control circuit using AC motor
- Taifu DK2-25 rice cooker temperature detection control circuit
- Micro DC motor steady speed control circuit a