After read the psychological behavior of insecure, in which model the robot can sense the barriers on every side and avoid them using a whisker brick. I decided to make it because sensing the environment and avoiding danger (where it is “crashing” here). It is the basic behavior for an creature to maintain existence and the success implementation of it will enable us to design more complex behaviors without need to worry about its safety.
I studied and found it was difficult for us to make a whisker brick, as I didn’t have sensors to sense the bent of strips, which perhaps requires a lot of amperemeters to capture the resistance of the strips before and after the bent, or pressure sensors to capture the pressure caused by the bent. Thus I chose a different method for the same result.
At first I thought of the supersonic sensor, but the I realized it can only can sense whether there are barriers in the front or not, but cannot sense from which direction exactly, I.e. left, middle or right. Thus, I thought of the infrared sensors as it has five inputs and outputs.
Surprisingly, the professor showed me that by using mobile phone cameras, I could actually “see” the infrared lights. I intended to use all the five infrared sensors but found only 3 pins could be used as analog IO
Only P0 P1 P2 can be used as analog IO
So I decided to use the leftmost, middle and rightmost ones which then allowed the chip to measure the difference of the output and decide the direction of the barriers.
Finally it successfully simulated the “insecure” behavior.
The main difference between my design and that in the Braitenberg is that it uses whisper bricks in the implementation, while I used infrared sensors. Thus, my implementation still couldn’t sense the barrier in every direction, yet the limitation of equipment and pins both made the original design difficult to happen. Yet since the robot can turn around and always makes its sensors to the direction of its movement. The different doesn’t affect much to the final result.
Still, in terms of changing the design, I would connect the supersonic with the chip as well. I found that there are another three analog IO in the microbit but somehow robotbit doesn’t provide the correspondent pins on the board. Ny next step is to find how to connect them and make the psychological behavior simulation more accurate.