Hi everyone, today I'll be showing how I made the robot MIA-1, which is not only Advanced and unique but also Open source and can be made without 3D printing!! Yes, you got it, this robot is completely hand made. And open source means - you get the codes and every details for free, you too can make this robot if you wish to.
Bonus:
You can download MIA-1's circuit and details!! The link is at the end of this tutorial.
Here we see only her speech, but there's many more things she can do!
Here are the things she can do:
- Can listen and talk back to you
- Can see and recognize you using her left eye's camera
- can detect motion and capture photo
- has a GUI with touch screen LCD to command her
- shows images on her lcd
- download images and shows on her screen
- can target things using a laser pointer on her right hand
- moves hands while talking
- Stands on her feet without any help of others
- She can also bow (watch the video)
and many more, lets make her!
Supplies:
To make this robot I've used all the things that are available at our local store.
MicroControllers + Computers (The brain):
- Arduino Mega (for controlling the servo motors)
- A full computer (You can use raspberry pi, but I'be used my laptop as her brain initially)
Servo Motors:
MIA-1 has 13 degrees of freedom.
- LDX227 dual axis servo motors 8x
- MG996r / MG996 servo motors 3x
- For figers ive used micro servo sg90
Note that I have added a robotic claw and it uses another MG996r servo motor.
And jumper wires and etc
Vision:
For image processing such as taking photo and detecting faces etc. I've used an USB camera.
NOTE: This tutorial is for intermediate and advanced level makers, I'll be focusing mainly on codes as it is the code that makes MIA-1, MIA-1. And if you get the code everything is easy for you.
Step 1: Body and Motor Layout
The body is made using PVC sheet, different pieces are attached using Hot Glue and screws (see picture). I've cut the pvc sheet using cutter knife (be very careful!! don't cut your fingers instead!!). From picture one and two you can see the servo layout. As I was making a girl robot I have given it a female body shape and figure.
The servo connectors are made using thin pvc sheets as they bend well.
The head is made using a balloon, blew air in the balloon (see picture), added small wet pieces of papers and then dried it. After adding 8 layers it has become strong and sustainable.
Then just colored it white (whole body) using spray color.
Turned out the design is so amazingly balanced and she (MIA-1) stands right on two feet of her!!
Adding the display:
After that just used some screws and hot glues to mount the lcd on her chest (last photo).
Step 2: Circuit Diagram
The circuit diagram looks complex but it isn't. I drew the circuit as the motor layout on body so that you can understand it more easily. Make sure to common the ground. The arduino takes power from the computer via its usb cable. There is a laser diode which enables mia to target things takes power from pin 13(led pin) of arduino.
As you can see that all the motors and the arduino itself is on the back side of the body. I also have put all the cables from back. Bought an extended USB cable so that it can be connected to the computer.
Step 3: The CODE
As you know I've used an arduino mega. The arduino mega controls the Servo motors, the motors are pre-programmed. Get the motors code from here. Please note the default servo positions, while building the robot maintain this. Just power the motors with arduino without making the body and the servo motors will reach to the default position (default pos below)
/*default/standby position of servos*/<br> komor.write(4); #waist servo
left1.write(120);
rFinger.write(0);
servo1.write(55);
clawOpen();
rightStandBy();
leftStandBy();
headTilt.write(134);
headPan.write(90);
The motor control code is of more than 750 lines (be careful while editing).
The main processing is done using a python3 script.
Python has pySerial library that communicates with the arduino over serial. Mind the 'COM PORT'.
#Connect with mia motor driver board over serial communication
try:
mia = serial.Serial("COM28", 9600)
except:
pass
You also need to pip install these libraries
"""import necessary libraries"""<br>#import requests #for making post/get requests
import pyttsx3 #offline text to speech
import speech_recognition as sr #Speech to text (requires internet to function)
import time
from random import randint #random integer picking library
import tkinter #tkinter gui library
from tkinter import Tk, Button, Label, Tk #import necessary things
import serial #serial library for serial communication over USB
from PIL import Image #fro showing image
import cv2 #Computer Vision library
import wikipedia #to get data direcly from wikipedia
Everything is easy using pip install. For opencv type in the command prompt:
pip install opencv-contrib-python
The GUI (Graphical User Interface) your'e seeing is developed using tkinter. For this and every other libraries you can install by this command:
pip install library_name
then it will be installed.
Also take a look if your're using a webcam it is more likely the cam is denoted as 1
cap = cv2.VideoCapture(1) #camera
And if you want to know more on how this robot actually talks back please read this tutorials.
MIA-1's code is just an extended version of this.
As of commanding the arduino, computer sends a bite, the arduino takes actions according to the bites it receives, thus it looks Mia's movement and talking is asynchronous.
mia.write(b'p') #command to head up then down<br>count_down(3)
respond("Smile please", 100)
Now to get the code go the link below.
Step 4: Power and Finishing
I've powered the robot using a 7.4 v lipo battery. The LDX227 servos are very power hungry (but are of good quality) so make sure they get at least 7.3 v any time. On the other hand the MG996r servo motors are cheap can be damaged easily, make sure they don't get more than 7.8V. So the highest power supply for this robot should be in between 7.4 to 7.8 volts.
Happy making!! If you like this robot be sure to support by subscribing the channel for more amazing projects.
This robot is the first ever open source humanoid robot of Bangladesh!! And the cheapest of it's kind. I made this robot open source so that other students and interested people can know the logic of robots. May in future nobody will ever take robotics as science fiction. To the robot era!!
Download:
To download code and circuit click here.
The python code finished in 0.9s and does not run please help...
ReplyDeleteDid you install all the required libraries?
Deleteplease help me fix this problem in your motors arduino code
ReplyDeleteerror warning: invalid conversion from 'const char*' to 'byte {aka unsigned char}' [-fpermissive]
val = ""; //clear the value
^~
This line doesn't cause any error in my robot. Have you install pySerial library?
Deleteyes I have all the libraries downloaded on my pc. How can I check that the arduino motor codes are working because Tried a lot to test on serial monitor on arduino IDE but no result was found.And as I have mentioned the code finishes within seconds. If your code runs on raspberry pi I can try It there.Thank U.
ReplyDeleteThere is no output in Serial Monitor - it's coded like this. But if there is an error there must show an error message on Arduino app. I did not try this code on Raspberry pi, I ran this on my windows pc, python version 3.7.1 . The motor code does run motors only when the python code from computer says it to, otherwise it does nothing.
DeleteThis comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteAssign any other values.
DeleteThis comment has been removed by the author.
DeleteThanks a lot, now every thing is working perfect, could not complete it without you. Here is the last request from me, can you teach me how can I add wiki to answer question.I tried to add wiki but a lot of error occurs so please help.Thanks again.
ReplyDeleteCute Titanium Games
ReplyDeleteCute Titanium Games - Cute Titanium Games. columbia titanium boots Cute Titanium Games is titanium trim hair cutter reviews an 2018 ford ecosport titanium innovative, original-looking, winnerwell titanium stove game engine and is a major part of its history. ceramic vs titanium