Monday, May 2, 2016

Arduino Robot Part 1: Wall Follower

Hey guys! It's been a really long while since my last post. And trust me, a lot has happened. Well, as promised, this is the "making" of our 'bot. It's a partial requirement for the subject Embedded Systems. 

The subject mainly focused on Arduino, which is an open source microcontroller. The first project was kind of a Maze Solver type robot, in which the robot needs to find it's way out of a maze. While searching for possible inspirations, I came across this little robot called a 'micromouse', which does the same thing, only better. The micromouse maps the maze until it reaches it's end point, which is usually the center of the maze. It then goes back to the starting point, and finds the shortest path to the center. The process of using the shortened path from the starting point to the center takes more or less 5 seconds. My jaw just dropped and I spent the next seconds pulling it back up. But that's a different story. The micromouse is a special robot. It uses complex algorithms to solve the maze.

I thought we didn't have enough time to study the algorithms and figure it out. So we just resorted to the wall follower algorithm, which is really really simple. It follows either the right wall, or the left wall. In real life, if you raise one of your arms: the left or the right, and touch a wall, eventually you will reach the end. That's the process of this algorithm, hence the name.


THE CODES:

For the codes, we based it from the codes used in this project:


The code was written in Portuguese, but translate.google.com is your friend.

Here is the code that we tweaked a bit.

[FOLLOW ME!]

There was a lot of tweaks, mostly on the delay function in the turns. Too little, and the bot does not make a full left/right turn, and vice versa. One factor that I observed was the power supply.

The motor shield from e-gizmo can be configured as a split supply (one supply for the arduino and one supply dedicated to the motors) by removing a jumper clip. We were too confused and stressed. We only used one supply; a rechargeable 9V battery, supplied directly to the arduino, with the jumper connected on the motor shield driver. Plus, the fact that the 6V battery we ordered didn't have a charger, we avoided using it.

The 9V battery seemed to wear fast because it's powering a lot of parts at the same time, so we were constantly charging it. We also need to constantly change the delay() because when the battery is fully charged, the bot moves faster. So the delay() set before charging is too fast now.

One of the ultrasonic sensors was sometimes going haywire. So I had to tweak the codes again to only use two of the three ultrasonic senors. Now it's a real wall follower. Just like me, a wall-f'lower. Haha. Okay. I'm gonna find my way out of this maze.

[CLICK HERE FOR THE WALL FOLLOWER (2 SENSORS)]


THE BODY:

We used an acrylic/plexiglass body for the robot. We had to make good of what we had.

3D Model of our robot.

Initial Design for our Robot.

There was no solid plan, so we modified it a lot. Our first design, we kind of made it to look like a Philippine Jeep. That looked cool, but it was not efficient. Looking back to the reference site, the position of the sensors on the side were at an angle. So we redesigned the whole body. We used foam core, by the way. And just model it and stick in into the plexiglass base.

I wasn't able to take a proper picture of the updated design of our robot. But it did well on the test.

On the next post, our next project after this was to make this robot a remote controlled one. Stay tuned!


Preview.



Cost of the materials, were ordered from e-gizmo.com
(This list contains all parts incl Part 2)
QTY    MODEL/DESCRIPTION               UPRICE
1         Gizduino V5 w/ Case                         
1         2-CH Motor Shield Driver                  450.00
2         DC Geared Motor 6V                          130.00
1         PBOT Wheel Pair w/ Mugs                100.00
2         PBOT Spacer (small)                            5.00
3         US-100 Ultrasonic Sensor                   258.00
3         F-F 5-Pins Connecting Wire                 20.00
1         Battery-NI-MH Battery
           6V/1800mAh green                             257.50
1         9V 280mAh Rechargeable Battery      188.00
1         Caster Wheel                                         35.00
1          9V Battery Clip                                     15.00
2         Screw w/ Washer 2.6x7 (Umbrella type.)  2.00
1         HC-06 Bluetooth Module                     450.00 (Ordered from another seller)
 ---------------------------------------------
These were the main parts of the robot.

These are some optional and/or auxiliary parts:
3 General Purpose NPN Transistors
3 220 ohm 1/4W Resistors
3 1K ohm 1/4W Resistors
1 DPDT Toggle Switch
1 DC Plug
1 12V Buzzer (Or a lower voltage buzzer)
Assortment of Connector/Jumper wires
Perforated Board
Plexi/Acrylic/Fiber Glass (For the body)
Assortment of Bolts and Nuts
Spare 9V Batteries

No comments:

Post a Comment