3D Printed HUMANOID ROBOT With Face Tracking Based on Arduino Uno Python and OpenCV

Published Apr 21, 2024
 24 hours to build
 Intermediate

CHAD, the humanoid robot has face tracking, voice control, a dedicated chatbot, calculations, weather updates, internet queries, and a sense of humor—all built with just ₹5000 worth of parts! Driven by two Arduino Unos, each dedicated to face tracking and voice control functionalities.

display image

Components Used

Arduino UNO
Arduino UNO
2
L298N Motor driver
L298N is a high current, high voltage dual full bridge motor driver. It is useful for driving inductive loads.
1
Mg996R Metal Gear Continuous Servo Motor
2
Mg90S Metal Gear positional Servo Motor.
2
19mm diameter PVC pipe 1 meters length
1
Fully Threaded Screw Rods with Hex Nuts and Washers - M8x165mm.
2
500 RPM Dc 12V High Torque Yellow Geared Motor.
2
L298N Motor Driver board.
1
Zebronics 450W Black Gold Power.
(Any power supply with 12v 5amps and 5v 10amps output will do)
1
self locking push button switch.
1
JST WIRE 2 PIN Male - Female Locking Type For Electric Cable Wire.
20 male and 20 female wires)
20
M8 screw with hex bolts
(more than 60mm)
2
USB camera.
1
microphone and speaker.
1
31mm x 24mm x 600mm wooden plank.
(you can 3d print or use any other material)
1
31mm x 24mm x 300mm wooden plank.
(you can 3d print or use any other material)
1
Description

Step 1: 3D Print the Parts

have provided all the main parts to be printed in the 'Downloads' section.

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
  • 0.4mm nozzle  
  • 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 insert the screw.

NOTE: I HAVE NOT PROVIDED THE schematic FOR THE LINEAR ACTUATORS. If you want them to work then use the code to figure out the connections yourself(i have provided assembly details from 'step-6'). the actuators are not for the main purpose of this robot and can be used for aesthetic purposes.  int in3=9; 9int in4=11; are the pins for PWM to a L298N motor driver. 

 

Step 2: 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.

Step 3: 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

 

Step 4: 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 plank is 77mm.

 

Step 5: 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.

 

 

 

 

 

 

 

Here is the video of the build process 

check out the shorts on my channel for it working in action. 

 

Step 24: 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

you can find the code in the code section

 

Codes

Downloads

CHAD_stl_files Download
schematic Download
supplies Download
Component list Download
Comments
Ad