Introduction

In fulfilling this Milestone, we needed to integrate the various components from Lab2 (a microphone and IR sensor) into LABron, and attach a new distance sensor. The distance sensors for this Milestone are used to implement a simple direction algorithm for Right-Hand Wall Following.

Distance Sensors

The distance sensors we are given for this lab are the Sharp GP2Y0A41SK0F short-range IR sensors. The sensors take in a voltage rail and ground as well as a signal line. Determining wall distance works by reading the signal line output from the sensors. Generally, this value is in the range of 500 and 0, higher values indicating a closer object. For our design, we set a threshold of 300 before our robot determines there is a wall in front of its sensor.

The video below shows the robot detecting a wall with the sensor and making a turn.

Right-Hand Wall Following

The basic premise behind right-hand wall following is to always follow the wall on your right side. When that wall disappears, turn right and move forward. If there is a wall on your right side and in front of you, you turn left, placing the wall in front of you on your right side again. In this way, it is possible for LABron to navigate a maze of walls using only two distance sensors placed to the right and front. LABron's implementation of the Right Hand Wall Following is to check at intersections. In this way, our robot continues to trace the lines and chooses turns based off where the walls around it are.

An example sketch ofonly the right hand following logic using the short range IR sensors is linked below.

Integrating Different Components

The various circuits we finished in Lab 2 now have to be integrated into a functioning version of LABron, our robot. Attaching the circuits was very simple, requiring us to simply attach the circuits to a free analog pins. Integrating them into the code, however, was more difficult. Because the FFT is time intensive, we decided to only run the FFT every three times LABron reached the loop() function in the main .ino file. This logic is performed using the value of count. Ideally, this would let LABron be more responsive to queues from the line it follows, and the signals around it.

Problem: Power bank Issue

After integrating the audio and IR sensors, we began to see a significant amount of low frequency noise on coming off our Arduino supplied power rails. Our initial assumption was that the Arduino was powering too many different components, so we moves the new sensors over to the second power bank to spread out the load. However, doing this resulted in a very low current draw from the battery; the power bank would shut off automatically and the sensors would stop sending signals back to the Arduino. Eventually we switched our line sensors and short range distance sensors off of the Arduino power rail onto their own battery, and left the sensors and servos all powered off the Arduino.

We left the servos powered from the Arduino since the power bank was shutting off on its own after ~20-30 seconds when the servos were powered from the external source. This was because the battery shuts off when there is not enough current drawn from it. So, the servos were left connected.

Final Run

After struggling through various problems and integrating the new components and behavior into LAbron's codebase, we were able to demonstrate maze exploration through an arbitrary set of walls following the Right Hand Rule, with responses to the frequency of the IR hat (representing other robots) when it is detected (see the green LED farthest from the programming cable). The combination of a green and yellow LED near the blue programming cable indicate that both the Right and Front distance sensor detect a wall, which LAbron inteprets as a left turn.

Conclusion

LABron was successful in completing the maze using our logic. However, as we fiddled with its ability to follow lines, we drastically reduced the speed of line tracing. In the current code base has integrated the correct components, but in the future we would like to see LABron move through the maze faster with smoother direction correcting mechanisms. This will hopefully be implemented by Lab 3.