Components and Materials
To construct a self-balancing robot, the following components and materials are required: two N20 gear motors, two wheels, two N20 gear motor mounts, an L298 and motor driver, an Arduino Nano, an MPU6050 accelerometer sensor, a breadboard, a battery holder, two lithium ion batteries, three pieces of PVC project board, and some wooden sticks.
Constructing the Chassis
The first step in building the robot is to attach the motors to one of the PVC boards. The motor mounts are then used to construct the chassis for the robot, using the wooden sticks and PVC project board. This part is crucial, as the balance of the robot depends on the chassis.
Connecting the Components
The Arduino Nano and MPU6050 are placed on the breadboard, and the MPU6050 is connected to the Arduino pin according to the table. The L298 and motor driver are placed in the lower compartment of the robot, and two wires are connected for the power supply. The 5 volts out from the motor driver is used to power the Arduino. The breadboard is then placed on the top compartment of the robot, and the MPU6050 is placed in the center. The motor drivers and 5 volt out are connected to the breadboard’s positive power rail, and the ground is connected to the negative rail. The L298 and motor control pins are then connected to the Arduino pins according to the table.
Adding the Battery
The battery is placed in the middle compartment of the robot and connected to the motor drivers. Once the battery is connected, the robot is ready to be tested.
Power Line
Power line is an essential component in the construction of a DIY self-balancing robot using Arduino and MPU6050 accelerometer. To begin, the robot must be placed in a straight position and the MPU calibration code must be opened. This code is provided in the description and is used to calibrate the MPU6050 sensor. After uploading the code, the serial monitor must be opened and the B rate selected should be 11520. By sending any character, the axis and Euro values can be stored.
Robot Music Code
The next step is to open the main balance robot code. Here, the KP and KD values must be adjusted to ensure the robot is perfectly balanced. Additionally, the axis and Euro values found in the calibration code must be replaced. This is done to ensure the robot is able to respond to changes in its environment.
Testing
Once the robot is assembled, testing can begin. This is done by placing the robot on a flat surface and observing its movements. If the robot is able to remain in a balanced position, then the construction is successful. However, if the robot is unable to remain balanced, then further adjustments must be made to the KP and KD values.
Building a DIY self-balancing robot using Arduino and MPU6050 accelerometer is a fun and rewarding project. By following the steps outlined above, anyone can construct a robot that is able to remain balanced in its environment.