3D Printed HUMANOID ROBOT With Face Tracking Based on Arduino Uno and Python
by Shashwat Batish in Circuits > Robots
2791 Views, 24 Favorites, 0 Comments
3D Printed HUMANOID ROBOT With Face Tracking Based on Arduino Uno and Python
Hello. Cool project. I make.
So this is a humanoid robot I have been making for the past 2 months (instead of studying for my exams), here's all about it:
-His name is CHAD
-Has Face tracking
-Responds to certain voice commands
-Has a dedicated chat bot to hold conversations
-Can calculate all arithmetic functions, tell about weather and get responses from the internet.
-Can tell jokes.
-The parts in total cost ₹5000 which is about $60 (at present conversion rate of ₹83/dollar)
This project uses 2 Arduino Unos. 1 for face tracking and the other for physical responses for voice commands like "hi"( it will wave it's arms and greet you). This instructable will not involve linear actuators.
Supplies
Brains of the project:
- (2x) Arduino uno
- A laptop or a PC for processing data from the camera and voice input with atleast 3 USB ports.
Skeleton:
- (1x) 31mm x 24mm x 600mm wooden plank.
- (1x) 31mm x 24mm x 300mm wooden plank.
(You can 3d print these parts too. Make sure that the dimensions should be the same.)
Components for the arm:
- (2x) Mg996R Metal Gear Continuous Servo Motor. (Positional servos would have worked much better but they were out of stock)
- (2x)Mg90S Metal Gear positional Servo Motor.
- 19mm diameter PVC pipe 1 meters length. (there is a typo in the image it is actualy 1meters in length)
Components for the linear actuators:
- (2x) Fully Threaded Screw Rods with Hex Nuts and Washers - M8x165mm.
- (2x) 500 RPM Dc 12V High Torque Yellow Geared Motor.
- (1x) L298N Motor Driver board.
Power Supply:
- (1x) Zebronics 450W Black Gold Power. (Any power supply with 12v 5amps and 5v 10amps output will do)
- (1x) self locking push button switch.
Accessories:
- (2x) M8 screw with hex bolts. (more than 60mm)
- (20x) JST WIRE 2 PIN Male - Female Locking Type For Electric Cable Wire. (20 male and 20 female wires)
- (30x) 21mm length body diameter 3mm Screws.
- USB camera.
- microphone and speaker.
Parts to be printed:
Downloads
3D Print the Parts
I have provided all the main parts to be printed in the 'Supplies'.
List of parts to be printed:
- 2x- arm-to-servo.
- 1x- face.
- 2x- fore-arm-to-servo.
- 2x- hex-bolt-holder.
- 2x- linear-actuator-body.
- 2x- linear-actuator-motor-holder.
- 2x- mg90s arm attachment.
- 1x- neck.
- 2x- shoulder.
- 2x- shoulder-servo-holder.
- 2x- threaded-rod-to-motor-shaft-connector.
- 1x- linear-actuator-mount.
- 2x- linear-actuator-cap.
The parts were printed in the following Cura settings on my ender 3:
- layer height - 0.3mm
- 20% infill
- infill pattern - cubic
- support structure - normal
The project only requires about 1kg of PLA filament.
If the screws do not fit the holes in the 3d printed parts, use a soldering iron to widen the hole.
Assemble the Servo Joint
In the image, the green part is shoulder-servo-holder.stl. The Mg996R servo will go in as shown. Use the provided screws with the servo to secure the servo in place.
Assemble the Shoulder Mount
Arrange the previously assembled part and shoulder.stl as shown. Use the 'M8 screw with hex bolts. (more than 60mm)' to join then in place. The screw goes inside the hole and the bolt is screwed down from the other end. Make sure that the servo is free up move up and down.
Assemble 2 of these
Make the Skeleton of the Robot
- With the 31mm x 24mm x 600mm wooden plank and 31mm x 24mm x 300mm wooden plank, make a cross-shape as shown.
- The distance between the top of the vertical plank to the side of the horizontal plane is 77mm.
Attach the Shoulder Mount to the Sides of the Skeleton
Attach the shoulder mount to the sides of the skeleton as shown.
Make sure the direction of the shoulder mount is correct. The extruded part should face downwards.
Assembling the Linear Actuators -1(you Can Skip This Part)
using the 500 RPM Dc 12V High Torque Yellow Geared Motor, arrange the motor, linear-actuator-motor-holder.stl and the screw cap(which come with the motor) as shown.
Assembling the Linear Actuators -2
with the M8 hex bolt, arrange the bolt and hex-bolt-holder.slt as shown. Use hot glue or any other glue to secure the assembly.
Assembling the Linear Actuators -3
With the Fully Threaded Screw Rods with Hex Nuts and Washers - M8x165mm, threaded-rod-to-motor-shaft-connector.stl and the assembly in step 7, arrange them as shown. (in the image, the long grey cylinder is the screw rod)
The rod directly screws into threaded-rod-to-motor-shaft-connector.stl and use M3 screw or any suitable method to join the shaft of the motor with the 3d printed connector.
Assembling the Linear Actuators -4
With both the assemblies of step 7 and step 8, arrange both of them as shown.
screw hex-bolt-holder.slt + M8 hex bolt onto the threaded rod until it reaches the end. Give a 2-3 step clearance.
Assembling the Linear Actuators -5
Cut the 19mm PVC pipe to about 68mm. with hex-bolt-holder.slt + M8 hex bolt and the PVC pipe, arrange them as shown(The red cylinder in the image is the PVC pipe.)
Assembling the Linear Actuators -6
With the assembly in step 10 and linear-actuator-body.stl, arrange them as shown, use M3 screws to screw the assembly down. attach linear-actuator-cap.slt on top of the PVC pipe.
Assemble 2 of these.
Assembling the Linear Actuators -7
with the assembly in step 11 and linear-actuator-mount.slt, arrange them as shown. Use m3 screws to mount.
assemble 2 of these and them mount them on the skeleton as shown. the cap should just touch the extruded part of the shoulder mount.
Downloads
Assembling Arms -1
With arm-to-servo.stl, attach the 3d printed part onto the servo horn using screws or glue.
Assembling Arms -2
cut down the 19mm PVC pipe to 230cm. attach it to the assembly in step 13 as shown. use screws to secure the assembly. (make the holes yourself using soldering iron).
Assembling Arms -3
Using mg90s arm attachment.slt, mg90s will go in the 3d printed part as shown, use the provided screws to secure.(the orange color part is mg90s arm attachment.slt).
Assembling Arms -4
attach the assembly in step 15 as shown using screws. The servo should face the robot.
Assembling Arms -5
with the provided mg90s servo horn and fore-arm-to-servo.stl, arrange them as shown, attach using screws.
Assembling Arms -6
cut down the 19mm PVC pipe to 120cm. attach it to the assembly in step 17 as shown. use screws to secure the assembly. (make the holes yourself using soldering iron).
Assembling Arms -6
attach the assembly in step 18 and step 16 as shown. secure using screws.
Assembling Arms -7
assemble 2 of these.
the final assembly should look like the image (the chest plate is totally cosmetic. Below is the link if you want to print. in the cover image, the arm cover are just for cosmetics, they can be removed and attached anytime. link to them is also provided)
Assembling the Face.
with mg90s servo and neck.stl, arrange as shown. secure using screws. attach face.stl on top and secure using screws from the top of the face.
attach the assembly onto the assembly in step 20 as shown.
Finished Assembly.
Wiring Diagram
1st image is wiring for voice response feature. 2nd is wiring for face tracking. The blue servos are mg90s and the black servos are Mg996r servos. Be careful with the wiring. The power supply in the image is the Zebronics SMPS. refer to the code for more details on the wiring. For the power supply to work, locate the 5v and 12v output wires using a multimeter and connect them to the Arduinos and servos as shown in the above diagram.
CODE
Main python file - chad.py
face tracking python file - face-tracking.py
Main Arduino file - humanoid_robot_sketch-1.ino
face tracking Arduino file - face_tracking.ino
E1 is right elbow servo
S1 is right shoulder servo
E2 is left elbow servo
S2 is right shoulder servo
For both voice command and face recognition to work simultaneously, run one file in one IDE and the other file in the other IDE. I used vs code and python IDLE.
the database for the chatbot is in database.json. make sure it is in the same folder as main.py
Vihaan, Aditya and Manveer (my friends) helped me with the coding and all