Introduction: All in One Robot
#This robot may not look very fancy as I believe to make the best out of waste rather the purchasing expensive kits.( You can make yours look better:))
This is a multipurpose robot which can respond to various inputs in order to complete a variety of tasks.
It consists of;
- HC-05(Bluetooth module)
- Gyroscope and Accelerometer(MPU-6050)
- Teensy 3.1 microcontroller based on Arduino
- 2x Brushless motors 1000kv
- 2x ESC's
- HCSR04 (ultrasonic sensor)
- 1x LiPo Battery ( 3300mAh or 7500mAh)
- Sound sensor if wanted.
This robot is programmed through the Teensy 3.1 and is connected to the Google API. When it is connected via Bluetooth to a phone it can recognize audio input from the phone and make conversation and set reminders, play songs etc. It also has special inputs such as saying "Come Here" will make the robot recognize the phones position as Left, Right, Forward or Backward due the Gyroscope then moves in that direction avoiding obstacles with the HCSR04 and reaches to you. You can do anything You do with Google Assistant like find the Temperature, Weather etc. It can also be played with through tilting the phone left and right. It receives input from the accelerometer and gyroscope in the phone. It can reach speeds of up to 20km/hr due to the 1000kv brushless motor. In the future I will be adding Facial recognition software. You can tell it to call a person or even set your phone via this bot in emergency mode, airplane mode, etc.
Lets get to making it.:)
Step 1: Building the Body!
I used a leftover board with holes for screws in it as the base. I then attached the brushless motors with wheels to the board with the help of some mounting brackets. Then attached the ESC's to the motors and stuck them on the top of the board. I soldered the positive wires and negative wires of the esc's together and attached them to a Deans Male connector.
I attached a castor wheel to the end opposite to the direction the Bot would move to balance the recoil velocity of the bot. I attached the LiPo battery in front of the castor wheel using Velcro.
And your body is Complete:):):):):):):)
Step 2: Attaching Sensors and Circuitary:):) Part 1!
I will be using the Teensy Microcontroller, You can use the Arduino Uno as well but it is a lot bigger in size.
The Hc05 has 4 pins as labelled on it, The Vcc, GND, TX and RX.
Connect the TX to the RX on your microcontroller and The RX to the TX(many connect the tx to tx and rx to rx, the TX stands for Transfer and RX for Receive so is one pin transfers it should be connected to the one that receives the transferred data)
Connect VCC to 3.3-5.0 volts on your IC and GND to GND.
For the Accelerometer and Gyroscope we will use the MPU IC.
The MPU-6050 sensor contains a MEMS accelerometer and a MEMS gyro in a single chip. It is very accurate, as it contains 16-bits analog to digital conversion hardware for each channel. Therefor it captures the x, y, and z channel at the same time.
The MPU 6050 communicates with the Arduino through the I2C protocol. If your MPU 6050 module has a 5V pin, then you can connect it to your Arduino’s 5V pin. If not, you will have to connect it to the 3.3V pin. Next, the GND of the Arduino is connected to the GND of the MPU 6050.
The program we will be running here, also takes advantage of the Arduino’s interrupt pin. Connect your Arduino’s digital pin 2 (interrupt pin 0) to the pin labeled as INT on the MPU 6050. Next, we need to set up the I2C lines. To do this, connect the pin labeled SDA on the MPU 6050 to the Arduino’s analog pin 4 (SDA) and the pin labeled as SCL on the MPU 6050 to the Arduino’s analog pin 5 (SCL). That’s it, you have finished wiring up the Arduino MPU 6050!
We will also attach an HC-SR04 sensor on a servo for obstacle detection in the next step. --->
Step 3: Adding Obstacle Avoidance Circuitary
We will mount our HC-SR04 on top of our Servo.
The HC-SR04 Ultrasonic Module has 4 pins, Ground, VCC, Trig and Echo. The Ground and the VCC pins of the module needs to be connected to the Ground and the 5 volts pins on the Arduino Board respectively and the trig and echo pins to any Digital I/O pin on the Arduino Board.
For example, if the object is 10 cm away from the sensor, and the speed of the sound is 340 m/s or 0.034 cm/µs the sound wave will need to travel about 294 u seconds. But what you will get from the Echo pin will be double that number because the sound wave needs to travel forward and bounce backward. So in order to get the distance in cm we need to multiply the received travel time value from the echo pin by 0.034 and divide it by 2.
I had built a very basic Obstacle avoider robot last year and implemented the same thing here except in this robot it had a target to go to so it will try to take turns towards the target.
Step 4: Programming and Setting Up Bluetooth and Connecting With Google API!!:)
Now all are hardware connections are complete leaving only the code.
I have attached the .ino file.. You will get a prompt that it needs to be in the folder blue, click ok and everything should work fine.
I have tried my level best to explain the code with comments and explanations. Enjoy:)
Step 5: To the FUTURE......
Connecting to the google API is what makes this project futuristic, implementing Google's services in robots saves a lot of time and effort. I would love to see how you make my project better with your own creativity. Any doubts or ideas , feel free to contact me at email@example.com
I would love to hear from you , Do vote for me in the First time Author, Automation and Bluetooth contest.
We have a be nice policy.
Please be positive and constructive.