I made a smart delivery robot as an OpenCV AI Competition 2023 entry. You can get brief info in video or in text below.
This project is a six-wheeled robotic vehicle. It can transport small packages to many places like hospitals, restaurants, offices, or warehouses. When packages are transported, the top cover is locked. After reaching the destination, the robot waits to enter the pin code on the keypad on the lid or you can show it a special QR code for receiving the package, if it's verified successfully, the top cover unlocks. The vehicle rides on green guiding lines that must be placed at places, where robots can go through, more info is in a chapter called Using Robot.
BUILD OF THE ROBOT3D printing
Firstly, you must 3D print all mechanical parts. You can find them in the CAD files list and download them, but you must rearrange the. I 3D printed them with PLA with 15% infill, only tires were printed from FLEX, and also 15% infill.
Base assembly
The next step will cover the assembly of the base (plate with Raspberry Pi 4B, motors, and more). Take a 3d printed piece BasePlate, put Raspberry Pi 4B on four sticks on the print, and cover them with four 3d printed parts RPI_EndCap. Then, you need to stick two L298N motor controllers with double-sided tape to frames for them (you must orient them so that the power connectors are facing each other). Then, take a 3d printed piece CPU_Fan_Holder and glue it to the hole used for the fan (long thin rectangle) with instant glue. Now put the 30x30x8 mm fan and put it inside (cables must go through the side hole of the part. Cover it with 3d print FanFrame. After that, connect L298N modules as in the Fritzing diagram below. Connect the CPU fan's red wire to Raspberry Pi's 5v pin, and the black wire into the GND pin.
Motors and bottom piece assembly
After building the base, you must build the bottom part of the vehicle. Put all six motors in a 3d print called Motor_Case. Then, take Bottom_Plate and glue it with instant glue to the base (orientation doesn't matter. Now put all motors with covers into half-cylinders with the circular side. Don't forget to push cables through small holes in the bottom part, this may be tricky, but it's needed. Then glue Motor_EndCap on all motors' outside ends. Now, put tires on wheels. After that, install wheels on the motors' shafts. Now you have the bottom part installed, let's move -on to installing the medium part with lights and power management. Through small holes, you must install line following sensors. Connect left sensors to GPIO 6, right to GPIO 5.
Lights and power management assembly
Now take a 3d print called LightsPowerMain and glue its bottom sticks to the top of previously assembled parts - three big rectangles (battery holders are above Raspberry Pi 4B and it's front of the robot). Solder wires to battery holders as in the diagram below, Then put them into the previously mentioned three rectangles. Now take a both-sided tape and stick a 5v relay, battery protection module, two step-up modules, one 6-24v to USB step-down module, and an HX711 AD converter. Glue the DC jack connector in the small hole in the side so that it is accessible. Now, solder the first part of the power management circuit as in the Fritzing diagram for batteries. Next, put batteries into holders. After that, put a second 30x30x8 mm fan in the front hole, wires must go inside the vehicle. Cover it with antoher FanFrame 3d printed part. Now assemble four LED sets (five white (front) or red (back) LEDS and one yellow LED on the ends) and connect them to Raspberry Pi as in the Fritzing diagram. After that, tape the front camera, lens must be visible, if it doesn't fit, you must redesign the file for your webcam. Plug that webcam into the USB port in Raspberry Pi. Next, install two HC-SR 04 sensors from the inside. Don't connect them now. Then, connect USB A to USB C cable to step down the module and the second end of the cable to the power socket on Raspberry Pi. Finally, again connect the red cable of the fan to Raspberry Pi's 5 V pin and the black wire to the GND pin.
Sensor plate assembly
Take a 3d print called SensorPlate. Glue it on the lights and power plate (orientation - small hole is facing back. Stick RPi camera v 1.3 to that hole (lens is visible, connect the CSI cable to RPi. Put Arduino nano every, MPU 6050 gyroscope accelerometer and HMC5883L magnetometer (compass) into this print. Connect Two HC-SR04 sensors from the previous chapter as in the first Fritzing diagram below. Then connect MPU 6050, and HMC5883L as in Fritzing diagrams two and three. Then, solder the load cell to HX711 and connect the HX711 module to Arduino nano every as in the fourth Fritzing diagram. Before you put the load cell into the 3d print, you must screw two M4x16 screws on one side of the load cell with screw heads down, and on the other side do it with screw heads up. Stick on the bottom with screw heads. Glue top screw heads to piece called Loadcell_Top. Now return to batteries and stick a 10K NTC thermistor to the top of one battery. Connect it to Arduino via a 10K resistor like in the fifth diagram (don't connect the LDR that will be connected at the end of the build. Also, connect the relay to Nano every's pin D6 like in the sixth diagram. Did you spot two unused holes in the print? They are for optional installation of NEO 6M GPS module and antenna, that aren't used in the code (for future upgrades), if you want to place it, wire it like in the last Fritzing diagram. Lastly, connect the micro usb cable from arduino nano every to Raspberry Pi 4B and cover HMC5883L with CompassCover, MPU6050 with GyroCover and Arduino Nano Every wirh NanoEveryCover
The bottom part of the package area assembly
This part of the assembly will be very easy. Just take a 3d printed part called BottomPackagePlate and glue it to the previously assembled part (orientation - hole for load cell must be above the load cell).
Package box assembly
The next easy part is assembly of the package box. You will only take the 3d print called PackageBox and put it on the assembly (orientation - big cable organization holes on two pieces are fitting. Lastly, you will glue them together.
The top assembly
After the rest parts of the build, there will be a very hard last part of the robot's build - the top of the robotic vehicle.Take 3D print called Top, put there print called lid, pull the LidRod through and attach LidCaps to ends of the rod (like in image below). Let's continue with the solar panel. Connect it to a switch to turn the solar panel on and off like in the Fritzing diagram below, then connect it to one of step up modules and set the step-up module to 8.4v (shine a light on the solar panel, connect output pins on the multimeter, spin the trimmer on step-up module and reach 8.4v). After that, connect the 12 V electromagnetic lock to the NO and COMs pin of the relay and the other step-up modules like in the second Fritzing diagram. Glue the lock into rectangle with text "lock" on the bottom of print, lock latch must be outside the moving part, you need to press the latch while installing. In the small hole on the top install LDR as in Fritzing diagram for thermistor. Now install 3 green 3 mm LEDs with 200-ohm resistors to a compartment with three small holes and connect them to Arduino as the third Fritzing diagram. Now connect 6 3 mm LEDs with 200-ohm resistors into CD4017 and put LEDs into a small compartment with six small holes. After that, you need to connect CD4017 to Arduino like in the fourth Fritzing diagram. Then connect 12 button keypad as in fifth Fritzing diagram. below. Pull all cables through a big thin hole at the back. Next, glue the assembled top to the robot (rounded square is in front of the robot). Finally in the rounded square in the front part you can stick a NFC tag and put 3d print NFCSign on it or don't use NFC and use NoNFCSign print. YOU DID IT!
If you want to use the robot, you must copy the Python script to Raspberry Pi4 and make it run automatically this way.
1) Firstly, open the terminal and run the crontab script for the user that you want to execute the python script on login
$ crontab -e
2) If you're using crontab the first time, you may need to choose text editor in the terminal, if it's possible, choose nano.
3) Download the main program from my Hackster.io project
4) Run these two commands (you may need to enter your password)
cd /home
sudo mkdir robot
5) Find your file - if you have a file downloaded into the default folder, run this code, but you need to change the username, or if you didn't download it to the default folder, write cd / followed by your file location (folder).
cd /home/your_rpi_username/Downloads
6) Move the file to the correct directory
sudo mv robotmainscript.py /home/robot
7) Add this code to the file. It makes the script run on the boot of Raspberry Pi.
@reboot /home/robot/robotmainscript.py
8) Test it
sudo reboot
Use black lines instead of color lines in videos. You can get a lot info from code (only a draft for creating code for your own purpose, may not work with some versions of Raspbian). QR codes can be created with https://www.the-qrcode-generator.com/. I worked on this project for long time, thanks for making it. Vit Skvara
Comments