Autonomous cars are now the most talked topics. Hobbyists try to make them using raspberry pi and computer vision technology. That's an approach. Another but easier way of making autonomous cars are line follower, path follower, maze solver robot. Such robots follow a certain color line drawn in certain environment's floor. We can make them using camera or IR sensor. What if I say that I don't want any line to be drawn on the floor, I want it to run on invisible line. This is what I did here actually. This Virtual Maze Solver/Path follower robot follows a path from a remote PC. So the robot doesn't have any sensors, it just gets coordinates from the PC - where another software robot tries to solve puzzle - and the hardware robot/car moves the way the software robot car moves. Watch the video for better understanding. Let me share now how I made this.
Step 1: Parts You'll Need
- Arduino Nano (Any board will do, but my PCB supports this) - 1x
- L298n Motor Driver module (for motor control operation) - 1x
- Motors - 4x
- Wheels (Compatible with motors) - 4x
- HC05 Bluetooth module (to send/receive data) - 1x
- Multi-functional robot PCB that I made (click here to see) - 1x
- Some male and female header pins
- soldering wire (to solder things on the PCB)
- PVC Sheets (You can use any boards or even papers, I love working with them)
- Hot Glue and Glue Gun
- Arduino.ide
- Python3 (Don't worry, I'll guide on how to install that)
Step 2: Principle (How Everything Will Work)
Simple, the robot will a Bluetooth controlled robot car. A python code will load a map/maze on computer and try to solve it. The hardware robot will get data from Python program using Bluetooth and move accordingly.
The python program will find path by comparing color value. Our map will consist white path. As long as there is a white pixel, the software car will go forward, so will the hardware robot. Now let's make it.
Step 3: Making Robot Chassis
Step 4: Circuit Diagram and PCB
After that I printed the PCB from PCBWay.com. I find their service very impressive. As they offer quality product in less amount of money, I prefer using their service for my PCB's. I went to pcb quick order and uploaded the gerber file. Everything was done automatically by the site. And after my PCB was inspected by their engineers, I paid and got them within 3 days to Bangladesh from China. The quality is amazing, solder mask, lines, glassy look amazes me as always.
Get the PCB from here.
Connections:
- Left motors to D5, D6
- Right motors to D3, D4
- VCC to 5v
- Gnd to gnd
- tx to Arduino Rx
- Rx to Arduino Tx
Step 5: Programming1: Arduino Code
- f' goes forward
- 'b' for backward
- l' for left and
- 'r' for right motion
Step 6: Programmin2: Python Code
I suppose you have python installed on your computer. If you don't, go to python.org/downloads and install latest stable version of python. I use Python3.7.1 as I find it most stable. While downloading download executable installer, and double click it to install, then click on the box that says 'Add python to environment variable path', else you'll be in a disaster.
To send data from the PC to Arduino bluetooth I first connected the bluetooth module to my pc. Steps are -
- Turn on Bluetooth
- Go to control panel > device manager
- Search for new devices
- Add device (HC05) with password [default password is '0000' or '1234']
Step 7: Power Up and Let's Go
I powered the robot using two 18650 batteries. Then ran the Python program. How does it perform? You can see that in the video.
The best part of this robot is that you don't need to change robot's code time to time. You just need to change the python program accordingly. That's it.
Downloads:
Get PCB and circuit diagram for this robot from PCBWay: Click here
Code Link: Click here to download.
Comments
Post a Comment