Introduction: Tinku: a Personal Robot
Tinku is not just a robot; it is a personal robot. It is an all in one package. It can see(computer vision), listen(speech processing), talk and react to the situation. It can express emotions, and the list of things which it can do goes on. I gave it a name; I call it Tinku.
A brief intro of what it can do is
- Computer Vision
- Face detection
- Face tracking
- Take photos and record video
- Recognize ArUco markers
- Speech Processing
- Offline speech processing (Hotword detection)
- It can understand what you are saying by detecting Hotwords.
- Express Emotions
- It moves it's head for non-verbal communications and to express feelings.
- It displays images and gifs on its screen to support the current sentiment.
- Move Around
- It can run around using its wheels and identify places using ArUco markers.
- Obstacle Avoidance
- It has sonar sensors so it is always aware of its surrounding and can avoid obstacles.
It can do a lot more stuff. You can also implement what new functionalities you want.
Enough talk lets make.
Step 1: Things You Will Need
- Acrylic sheet
- MDF board
- Small L clamps
- Pack of nut and screw
Servos, Motors, and Wheels
- Dynamixel AX-12A (3 pieces)
- Bioloid bolt and nut set
- Motors (2 pieces)
- Tracks (2 packs)
- Track wheels (4 pieces)
- L clamps for motors (2 pieces)
- L clamp for dummy wheel shaft (2 pieces)
- Dummy wheel shaft (2 pieces)
- Bioloid Frame F8
- Bioloid Frame F3 (2 pieces)
- Bioloid Frame F2
- Bioloid Frame F10
- Raspberry Pi or Udoo Quad
- Motor driver
- Logitech webcam-c270 (It has built in mic)
- Ultrasonic distance sensors (6 pieces)
- Lipo battery (3300 Mah 3S)
- Step up voltage regulator (DC-DC)
- Step-down voltage regulator (DC-DC)
- Touch Screen (7 inches)
- USB hub (Only if you are using Udoo Quad because it has only 2 USB ports)
- 7404 hex inverter IC
- 74HC244 IC
- 14 pin IC base
- 20 pin IC base
Connectors and Cables
- T-plug male battery connector
- Flexible HDMI cable (Only if your screen has HDMI connector)
- Micro USB cable
- Three pins female-female relimate cable (6 pieces)
- DC barrel jack male power plug (2 pieces)
- Dynamixel servo connectors (3 pieces)
- USB A to B cable (Only if it did not come with Arduino)
- Jumper wires
- Breadboard wires
- Burg strips
For Making PCBs
- Heatsink tubes
Note: Here I am using Udoo board because It has better computing speed than my raspberry pi 2. I am using an external Arduino rather than the built in Arduino of the Udoo board because all my sensors and modules are 5v compatible, and the Arduino in Udoo board is 3v compatible.
Step 2: Body of the Robot
To prepare the body of the robot, I used the acrylic sheet and cut it in specified size to make a box like structure. I mentioned the dimension of each side of the body in the image.
- Cut the acrylic sheet according to the specified size.
- Drill holes at specific places to mount the motors, sensors, standoffs and to join each plate together.
- Drill bigger hole in the base plate and top plate to pass cables.
- Make a small notch on the lower side of the front and back panel so that the wires coming from the ultrasonic sensor can pass through.
It's time to prepare and mount the motors and tracks.
- Solder extra wires to the motor pins so that the wire can reach the motor drivers.
- Mount the motor clamps and dummy wheel shaft clamps on the base plate of the robot.
- Connect motors and dummy wheel shaft to the clamps then connect wheels.
- Assemble the tracks and make a loop.
- Strap track on the wheels. Keep in mind that track does not slack and has enough tension on it.
Now join front, back and one side panel on the base panel using small L clamps. Do not mount the top panel and one side panel so that we have enough room left to mount the electronics on the robot.
Step 3: Head and Face of the Robot
We already gave a body and wheels to our robot. Now it's time to give it a head, neck and a face.
The most complicated part in the head of the robot is the neck. So we will prepare it first. Dynamixel servos are a bit confusing to work with, but they are reliable and durable. There are tons of mounting clamps available for it so you can connect them together in any way.
Watch this video for the better explanation on how to connect the dynamixel servos together.
- Insert nuts in the dynamixel servos to mount them with frames.
- Place bioloid frame F8 in the center of the top panel and mark drilling holes and drill them.
- Attach the bioloid frame F8 to one of the servos then mount the bioloid frame F8 on the top panel.
- Join each servo together using different frames and prepare the neck.
- Connect servos to each other using dynamixel three-pin servo connectors.
Eye and Ear:
I am using the Logitech webcam-c270 as the eye for my robot. It is a good camera which can take photos and record videos in 720p. It also has a microphone built in, therefore it becomes ear for my robot too. After a long brainstorming, I found out that the best place to mount the camera is on top of the screen. But for mounting the camera, I need a camera mount. So let's make one.
- Remove the metal pieces from the webcam which are provided to give it some weight.
- Cut two pieces from the MDF board, one square and one triangularwith dimensions shown in the image.
- Drill a hole in the base of the webcam and on the square MDFpiece. Make a notch on the square piece to insert the webcam wire in it.
- Glue the MDF pieces together to form a T-shape. The camera mount is ready.
- Before attaching the camera mount and camera together, prepare the head first.
The head of the robot is connected to the servos. It needs to be as light as possible so that the head does not apply much load on the servos. Therefore I used the MDF boardin place of acrylic sheet.
- Cut a piece of MDF board with dimension(18cm x 13cm)and drill holes to mount the screen.
- Place bioloid frame F10 in the center of the MDF board and mark drilling holes and drill them.
- Set bioloid frame F10 and bioloid frame F2 on each side of the MDF board and join them together using nut and screw.
- Now glue the camera mount on the back side of the board.
- Join bioloid frame F2 with the end of the servo configuration.
- Mount the screen on the MDF board using standoffs.
- Attach the webcam on the camera mount.
Now our head and face of the robot are complete.
Step 4: Custom PCBs
Now it's time to dissolve some fecl3 and etch some PCBs.
Why I made custom PCBs?
- I do not have dynamixel servo controller, so I need to make one.
- I have to connect lots of sensors to the Arduino in a cleaner way, so I made a shield for Arduino.
- Download the PCB files and print them on the copper clad laminate.
- Etch the copper clad laminate using fecl3
- Drill 1mm holes for mounting ICs and burg strip.
- To make the shield stacking headers slide down the plastic stoppers of the burg strip towards the end of the pins.
- Solder the IC bases and burg strip on the PCBs.
I provided the schematics for reference purpose.
Note - Use Express PCB software to open the .pcb and Express SCH software to open the .sch file.
Step 5: Power Supply
Maintaining a consistent power across the robot's different electronic modules and motors are very necessary. If the power drops below limiting value in any module that will cause a glitch and is very hard to identify the reason behind it.
The primary source of energy in this robot is a 2200mAh 3S Lipo battery. This battery has three cells, and the voltage output is 11.1 volt. The Udoo board needs 12v supply, and the Arduino board needs 5v supply. So I choose to use two voltage regulators, one is step-up, and the other one is step-down. One will maintain the current supply to all 12v modules, and the other one will keep the current supply to all 5v modules.
The image contains hand drawn schematics.
- Solder the voltage regulators on the perforated PCB boards.
- Solder the T-plug male battery connector to the input of the both of the voltage regulators.
- Connect the 'Ground' output of both the regulators.
- Connect DC barrel jacks to each of the regulator's output. Keep the length of the wires enough so that it can reach the Udoo/Raspberry Pi and Arduino board.
- Solder burg strip to each of the regulator's output as additional power output in case we need it in the future modification.
- Before connecting the power supply to any of the electronic modules, calibrate the output of each regulators using trim potentiometer provided to exactly 12v and 5v.
Step 6: Final Assembly
It's time now. After so many steps it's time to assemble each module together. Excited? Well, I am.
- Cut a rectangular piece of the MDF board with dimension(30cm x 25cm). This board is the base for mounting electronic modules. I do not want to drill a lot of holes in the base acrylic plate, so I am using MDF board. It also helps in hiding wires beneath it to make our robot look neat and clean.
- Place modules on the MDF board and mark the mounting holes and drill them. Make some extra holes to pass the wires beneath the MDF board.
- I assigned numbers to some holes, so it becomes easy for me to refer them and for you to understand the wiring schematics.
- Mount the power supply module on the board and pass the 12v and 5v jack through the hole number 1 and pull out the 12v jack through the hole number 2 and pull out the 5v jack through the hole number 3.
- I kept the battery loose for now because I need to remove and charge it sometimes.
- Pull out the wires connected to the motors through the hole number 4 and connect them to the motor driver board.
- Motors need the 12v power supply to run properly so connect the 12v and GND pin of the driver with the 12v voltage regulator's output.
- Connect the pins of motor driver to Arduino according to the code.
- Before mounting the Arduino pass the wires of the three ultrasonic sensors through the back panel and pass the wires of the remaining three ultrasonic sensors through the front panel and pull them out through the hole number 3.
- Mount the Arduino and attach the sensor shield on it.
- I gave numbers to all the ultrasonic sensor wires so that it is easy to debug in case of any bug. Connect sensor pins to the shield starting from number 1 to 6 consecutively.
- Connect the 5v power jack to the Arduino.
Dynamixel Servo Controller:
- Mount the dynamixel servo controller on the board.
- Connect the 12v and GND pin of the servo controller with the 12v voltage regulator's output.
- Connect the 5v and GND pin of the servo controller with the 5v voltage regulator's output.
- Connect the pins of the servo controller and Arduino according to the code.
- Leave the servo output pin unplugged for now. Plug it after mounting the top panel of the robot.
Udoo / Raspberry Pi:
Note: Before following the below steps make sure that you have already installed the OS on the MicroSD card and placed it in the Udoo / Raspberry Pi board. If not then follow the links for installing Raspbian on the Raspberry Pi or Udoobuntu on the Udoo board.
- Mount the Udoo / Raspberry Pi on the board and connect the power jack to it.
- If you are using the Udoo, then connect the USB hub to one of its USB jack.
- Connect the HDMI cable and micro USB cable to it. These pins are used to supply data and power to the screen.
- Connect the Arduino to Udoo / Raspberry Pi using A to B USB cable.
- Attach the top panel to the side, front and back panels of the robot using L clamps.
- Connect the HDMI cable, micro USB cable to the screen and webcam to the Udoo / Raspberry Pi board.
- Connect the three-pin servo connector coming from the base dynamixel servo with the servo controller. Please take care of which pin is DATA, GND, and +12v. Refer the images in "Head and Face of the Robot" section for better reference. If you connect the wires in opposite order, it may damage the servos.
Ultrasonic Distance Sensors:
The last piece of the puzzle. After this, our assembly is almost over.
- Cut six rectangular pieces of the MDF board/acrylic sheet with dimension(6cm x 5cm).
- Drill holes in them at required places.
- Attach the ultrasonic sensors to each of the board and attach all the boards with the base panel of the robot.
- Connect the sensors with connectors.
Finally, it's done. Connect the battery and boot the Udoo/Raspberry Pi
Step 7: Software
Hardware is complete, but without software, this robot is just a box. The list of the software we need are
- Some python packages
TightVNC is a free remote control software package. With TightVNC, you can see the desktop of a remote machine and control it with your local mouse and keyboard, just like you would do it sitting in the front of that computer.
If you have extra keyboard and mouse, that is good. If not then install TightVNC in your laptop and follow this steps.
- For the first time connect keyboard and mouse to the Udoo / Raspberry Pi. Connect to a wifi network. Open Terminal and type
- Note down the IP address of the robot.
- Open TightVNC in your laptop. Enter the IP address in the required field and hit Enter. Voila! You are connected now. Use your laptop's touchpad and keyboard to access the robot.
Python is very popular and versatile language that is why I am using it as the primary programming language for this robot.
Here I am using python 2.7 but if you want you can also use python 3. Luckily Python comes preinstalled in both the Udoobuntu and Raspbian OS. So we do not need to install it.
OpenCV is an open-source library mainly aimed at real time computer vision. OpenCV with Python is very easy to use. Installing OpenCV is bit cumbersome, but there are plenty of very easy to follow guides available. My personal favorite is this one. This guide is for Raspberry Pi, but you can also use it for Udoo board.
Snowboy is a library written by Kitt.ai guys, mainly aimed at offline speech processing/hotword detection. It is very easy to use. Follow this link to install snowboy on the Raspberry Pi. If you are using Udoo board, then go to this project, written by meto install snowboy in the Udoo.
Follow these easy to use guides to install some python packages.
- Pyautogui - Pyautogui is a package to simulate keystrokes of a keyboard or the mouse movent.
- Numpy - type "pip install numpy" in the Linux shell and press enter. It is that simple.
- Pyserial - Pyserial is a package aimed at serial communication via python. We will use it to communicate with the Arduino.
Step 8: Codes
The hardware part is complete. The software part is complete. Now it's time to give a soul to this robot.
Code for this robot is somewhat complicated, and I am currently adding more functionalities to it. Therefore, I have hosted the codes in my Github repository. You can check it out and clone/download codes from there.
Now it is not just a robot; it is Tinku now.
Step 9: Demo
These are some of the basic demos. There are much more interesting ones to come.
Stay tuned for more updates and if you have any doubt, feel free to comment.
Thank you for reading my project. You are awesome.
If you like this project then please vote it in Microcontroller and Robotics contest.
Happy Making ;-)
We have a be nice policy.
Please be positive and constructive.