Introduction: Tinku: a Personal Robot

Hello there,

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

  1. Computer Vision
    • Face detection
    • Face tracking
    • Take photos and record video
    • Recognize ArUco markers
  2. Speech Processing
    • Offline speech processing (Hotword detection)
    • It can understand what you are saying by detecting Hotwords.
  3. 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.
  4. Move Around
    • It can run around using its wheels and identify places using ArUco markers.
  5. 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.

EDIT:Body of Tinku started cracking so I had to redesign him completely. Here is the new images, completely fresh and better Tinku. I am sorry, I do not have the images of the steps of redesigning Tinku.

Step 1: Things You Will Need

Robot's Body

  1. Acrylic sheet
  2. MDF board
  3. Small L clamps
  4. Pack of nut and screw

Servos, Motors, and Wheels

  1. Dynamixel AX-12A (3 pieces)
  2. Bioloid bolt and nut set
  3. Motors (2 pieces)
  4. Tracks (2 packs)
  5. Track wheels (4 pieces)
  6. L clamps for motors (2 pieces)
  7. L clamp for dummy wheel shaft (2 pieces)
  8. Dummy wheel shaft (2 pieces)
  9. Bioloid Frame F8
  10. Bioloid Frame F3 (2 pieces)
  11. Bioloid Frame F2
  12. Bioloid Frame F10

Electronics

  1. Arduino
  2. Raspberry Pi or Udoo Quad
  3. Motor driver
  4. Logitech webcam-c270 (It has built in mic)
  5. Ultrasonic distance sensors (6 pieces)
  6. Lipo battery (3300 Mah 3S)
  7. Step up voltage regulator (DC-DC)
  8. Step-down voltage regulator (DC-DC)
  9. Touch Screen (7 inches)
  10. USB hub (Only if you are using Udoo Quad because it has only 2 USB ports)
  11. 7404 hex inverter IC
  12. 74HC244 IC
  13. 14 pin IC base
  14. 20 pin IC base

Connectors and Cables

  1. T-plug male battery connector
  2. Flexible HDMI cable (Only if your screen has HDMI connector)
  3. Micro USB cable
  4. Three pins female-female relimate cable (6 pieces)
  5. DC barrel jack male power plug (2 pieces)
  6. Dynamixel servo connectors (3 pieces)
  7. USB A to B cable (Only if it did not come with Arduino)
  8. Jumper wires
  9. Breadboard wires
  10. Burg strips

For Making PCBs

  1. Copper clad laminate
  2. PCB etcher (Fecl3)
  3. Perforated PCB
  4. 1 mm drill bit

Miscellaneous

  1. Glue
  2. Heatsink tubes
  3. Standoffs

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.

  1. Cut the acrylic sheet according to the specified size.
  2. Drill holes at specific places to mount the motors, sensors, standoffs and to join each plate together.
  3. Drill bigger hole in the base plate and top plate to pass cables.
  4. 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.

  1. Solder extra wires to the motor pins so that the wire can reach the motor drivers.
  2. Mount the motor clamps and dummy wheel shaft clamps on the base plate of the robot.
  3. Connect motors and dummy wheel shaft to the clamps then connect wheels.
  4. Assemble the tracks and make a loop.
  5. 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.

Neck:

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.

  1. Insert nuts in the dynamixel servos to mount them with frames.
  2. Place bioloid frame F8 in the center of the top panel and mark drilling holes and drill them.
  3. Attach the bioloid frame F8 to one of the servos then mount the bioloid frame F8 on the top panel.
  4. Join each servo together using different frames and prepare the neck.
  5. 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.

  1. Remove the metal pieces from the webcam which are provided to give it some weight.
  2. Cut two pieces from the MDF board, one square and one triangularwith dimensions shown in the image.
  3. 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.
  4. Glue the MDF pieces together to form a T-shape. The camera mount is ready.
  5. Before attaching the camera mount and camera together, prepare the head first.

Head:

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.

  1. Cut a piece of MDF board with dimension(18cm x 13cm)and drill holes to mount the screen.
  2. Place bioloid frame F10 in the center of the MDF board and mark drilling holes and drill them.
  3. Set bioloid frame F10 and bioloid frame F2 on each side of the MDF board and join them together using nut and screw.
  4. Now glue the camera mount on the back side of the board.
  5. Join bioloid frame F2 with the end of the servo configuration.
  6. Mount the screen on the MDF board using standoffs.
  7. 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.

Let's make.

  1. Download the PCB files and print them on the copper clad laminate.
  2. Etch the copper clad laminate using fecl3
  3. Drill 1mm holes for mounting ICs and burg strip.
  4. To make the shield stacking headers slide down the plastic stoppers of the burg strip towards the end of the pins.
  5. Solder the IC bases and burg strip on the PCBs.
  6. 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.

Power Supply:

  • 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.

Motor Driver:

  • 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.

Arduino:

  • 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.

Top Panel:

  • 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

  • TightVNC
  • Python
  • OpenCV
  • Snowboy
  • Some python packages
    • Pyautogui
    • numpy
    • pyserial
    • pyaudio

TightVNC:

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
$ ifconfig
  • 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:

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:

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:

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.

Python Packages:

Follow these easy to use guides to install some python packages.

  1. Pyautogui - Pyautogui is a package to simulate keystrokes of a keyboard or the mouse movent.
  2. Numpy - type "pip install numpy" in the Linux shell and press enter. It is that simple.
  3. 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.

Let's code.

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

Demo. yeeeeee!!

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 ;-)