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.
- Star-delta step-down starting control circuit for squirrel cage asynchronous motor
- Design and principle analysis of practical electric curtain remote control device
- Light-controlled circuit design and analysis
- Do-it-yourself trial production of phase failure protection device
- Magnetic door and window anti-theft alarm
- "Watchdog" anti-theft alarm circuit
- Multi-channel laser anti-theft alarm circuit
- Control two contactors with one wire
- A novel resonance demonstration device
- Using Waste Motors to Create Wind Turbines
- Multi-channel patrol detection control circuit b
- Multi-channel patrol detection control circuit a
- Flashing wall light control circuit
- Remote control receiving circuit of Panasonic inverter air conditioner indoor unit control circuit
- fire smoke control circuit
- Photocell trigger control circuit
- Boiler control circuit
- The structure of Hisense KFR-25GW-06BP inverter air conditioner outdoor unit microprocessor control circuit
- Neon light control circuit
- Voltage servo motor and control circuit