Wiring
Upper chassis
Lower chassis
Parts
Arduino Mega 2560
Motor Shield L293D
DC Motor
Servo motor
TOF Sensor
Ultrasonic Sensor
1500mAh 11.1V 3s Li-Po Rechargeable Lithium Battery
Working Principle
- The two TOF sensors in front of the robot cart each collect the distance to the user.
- Ultrasonic sensors are placed on both sides to detect the distance to obstacles.
- Arduino is responsible for processing the data collected by 4 sensors. The TOF distance data will be used to calculate the average distance to determine whether to move forward or backward, and the speed of the motor. At the same time, the difference between the two TOF data will be compared to determine which direction to rotate. Data from ultrasonic sensors on both sides are used to correct the movement trajectory. Stay on a safe route and also avoid hitting pedestrians.
- The data will form electrical signal instructions after being processed by arduino. The instructions related to the distance difference are passed to the servo motor to maintain the direction, while the instructions related to the relative distance determine the speed of the DC motor.
- The entire system is powered by an 11.1V battery. It provides 11.1V voltage for the DC motor and is regulated by the L293D Motor Shield, while providing a 5V rated voltage for the arduino motherboard to operate.
Code