Hello, my name is Dylan and I am a rising Sophomore at Regis High School. My starter projects were the Minipov and Minty-Boost Charger. I choose the Minty-Boost since I listen to music a lot and frequently need a charger for my iPod. Since I’m not a big fan of Altoids, I put the charger in something I enjoy more, a deck of cards. Since the Minty-Boost had not yet arrived I made the MiniPOV which turned out to be a very enjoyable project. My main product was a robotic bug which I wanted to do since I am fascinated with the idea of robots that emulate natural animals and was partially inspired by this video: Vijay Kumar TED Talks.

Documentation

Code:
Whisker_Test
Light_Test
IR_Test
Whisker_Move
Light_Move
IR_Move
All_Together_Now

Schematic:
Full Schematics

Mechanical Drawing:
Side View In Inches

BOM:
Google Doc

Main Project: BugBot

My Bugbot was assembled using a kit and instructions from parallax: http://learn.parallax.com/ShieldRobot.While the instrutions online describe each function being added separatly from the others, I combined all of them on my robot at once. My robot has three functions; it moves away light, it backs away from the edge of tables or mats, and if its whiskers are pressed it backs away. For the first function it uses Infrared LEDs that shoot at the ground and will usually bounce back to the Infrared receivers; if the Infrared light does not bounce back that means that there is a drop-off (or black surface) ahead and the Arduino takes that information and knows to turn. To move away from light it uses a phototransistor and a capacitor to determine how much light is on either side and then moves towards the darker side. Finally the whiskers work like physical switches which divert energy away from the Arduino’s digital pins. For more information on the specifics of how these work, please consult my previous milestone blog posts. Projects like the BugBot could have a big impact on the world. If one were to make robots that realistically simulated wildlife, they could be used to record animals in nature without disturbing them or they might even be used as natural predators to balance out ecosystems.

Milestone 3

I have reached the third milestone for my BugBot. It now backs away from edges, moves towards shade, and backs off when its whiskers are pressed. Before I got to this point I dealt with many problems. I noticed when I tried having my robot do two things at once, it overheated. It got to be so hot, it burned my instructor and me. We figured that it was a short and went about fixing it. I reworked my entire breadboard to try and avoid the short but the problem persisted. I discovered that the short was actually a loose washer that connected the battery back to the chassis. The area was smoking and, when we tested it with a multimeter, sparks flew. I fixed the problem by replacing the steel washer with a nylon washer and covering the battery pack with electric tape. However when I reworked my breadboard, all the plugging wires in and out broke it. I then tried cutting out and using a perforated circuit board. However since all the resistors were already cut and the perforated circuit board was unable to fit well enough into the BOE Shield. I fixed up the breadboard with electric tape and as long as I was careful, I could get it to work. I then got back to coding where I used if statements and had the BugBot first react to IR signals, then the whiskers, and then finally differences in light.

Milestone 2

I have just reached the second milestone for my BugBot. It now can respond to both visible light and infrared light. Though the original plan was that it would seek out light, I modified the code so that (in a more bug-like fashion) it would run away from light and hide in the shadows. The way it does this is relatively complex. It releases energy through a circuit to charge up a capacitor. Once it is charged, the Arduino marks the time and cuts off the power. The capacitor then starts to decay and release its stored energy. Eventually the capacitor runs out and is no longer able to be a power supply. When that happens, the digital pin picks up that it is no longer being powered, marks the time and subtracts it from the start time. The speed of the capacitor’s decay however is affected by the amount of light since there is a phototransistor (like a photodiode but more sensitive). When light shines on the phototransistor, the light energy hits electrons inside, which makes them break out of their valence shell and fall into the electric current and increase the current. The faster the current, the faster the capacitor drains, and the lower the time it takes. The Arduino then takes the time it took the right capacitor to decay and divides it by the time it takes the left capacitor to decay plus the time it takes the right. This allows it to compare the different speeds of decay. If the number were to be greater than 0.5, that meant it was brighter on the right and the robot would go to the left. If it were less than 0.5, that meant it was brighter on the left and the BugBot would go to the right. To make the numbers nicer I subtracted it by 0.5 though. Also the greater the difference, the more sharply the robot would turn. Then, the way the infrared worked was that I have two infrared LEDs and two infrared receivers. The LEDs will be pointed at the floor/ground/table and would emit a flashing infrared light at 38 kHz. The infrared receivers will only respond to infrared light that flashed at this frequency to reduce interference. When it receives this light (when the light from the LEDs hits an object and bounces back), it would work like the phototransistor and motivate the energy to go through the second pin and go to ground. However if it receives no light, the energy it gets from the 5V power source goes straight to the digital pin. The code then uses the digital read of the pins to determine whether there is no ground in front of the BugBot and tells it to turn (using if statements again) to avoid falling.

A demonstration of its light-fleeing capabilities:

Milestone 1

For my main project, I chose a BOE Shield Bot from parallax. I first tested all of the parts before assembling it; I tested the breadboard with LEDs and the servos without being attached to the chassis. Once I got both working, I was able to assemble the battery pack, wheels, servos, chassis and arduino all together. The way the servos work is that the arduino sends short pulses to the servos spaced 20 ms apart. If the pulse is 1.3ms long, the servos go clockwise, and if the pulse is 1.7ms long, they go counter-clockwise. The servos also respond to pulse lengths in between these values. For example, if the pulse length is 1500, it stops, and if it’s 1600, it will rotate counter clockwise slower than if the pulse were 1.7ms long. In order to move forward, the left servo must rotate counter-clockwise and the left must rotate clockwise and it’s the reverse to go backwards. To turn to the right, both servos must turn counter-clockwise, and to turn to the right both servos must turn clockwise. I was able to code the arduino to move in all four of these ways. Then I added whiskers to my bug. When the whiskers are pressed, the bug will back away and turn away from the side it bumped into. What happens is that usually electricity passes from the power source, over 2 resistors, to a digital pin. However the whiskers are connected to ground, and once one is pressed, it is pushed back and touches a 3 pin header attached to the breadboard. Now the electricity will go to the ground through the whiskers instead of to the digital pin as the newly created route has much less resistance (only one resistor) than the old route. The Arduino then identifies that the pin briefly is not being supplied with electricity. Then, using if statements in the code, the Arduino can take that brief lack of power to trigger a reaction such as backing up and turning away.

My code with comments:

MintyBoost

My second starter project was the MintyBoost also from Adafruit. This was supposed to be my initial starter project, but since it came late, I opted to do the MiniPOV first. I was really interested in doing this, so I decided to do two starter projects. The way it works is that energy comes from the the 2 AA batteries and enters a boost converter circuit. The electrons run continuously in a loop to charge up the inductor. Once the inductor is fully charged, the switch (which in this case is the boost converter chip) flips and alters the flow of electrons. The energy then moves to charge through the usb which naturally resists the current. The inductor however has been charged up and maintains the high current necessary for charging. However in order to get the boost converter to alter the current, the voltage has to change (which happens after the inductor is fully charged). However the range of energy levels that the boost converter detects to determine when to alter the current, is lower than the amount the batteries produce. To get it to that lower range there are multiple resistors on the PCB. Also since the current is being flipped a bit, I used a schottky diode which, like most diodes, helps force the energy to flow in one direction, but also (when prompted) can allow energy to flow in the opposite direction more efficiently than most diodes. Finally before reaching the usb port, the energy passes through capacitors which stabilize the flow of electrons and turn an alternating current into something closer to a direct current. If they were not included, the phone/iPod, would charge when the flow of electrons peaks but be inactive during the lower voltage periods. Now there is a continuous charge which is more efficient.

MiniPOV

My first starter project was the MiniPOV v3 from Adafruit. POV stands for persistence of vision. The way it works is that 8 LEDs flash on and off quickly; when the LEDs are waved our eyes see where the lights flashed a moment before. If programed and physically waved correctly, the MiniPOV will display words or a simple graphic. The energy starts off from the two AA batteries and goes to the microcontroller. The microcontroller comes with a program already inside and uses the program to take the input I had given it through the D-Sub port before turning the MiniPOV on. To give the microcontroller input I had to download WinAVR software and MiniPOV firmware. In order to determine when the LEDs had to be lit, I graphed my desired message, my name, on graph paper. Every square on the graph that was filled in represented a lit LED. I then edited the mypov.c file and changed part of the pre-existing code to 30 lines of 1s and 0s. The 1s represented lit LEDs and the 0s represented off LEDs. I had my computer delete mypov.hex as that file was created from the old mypov.c. I then had it make a new mypov.hex based on the updated mypov.c. Then using the WinAVR software, I sent the code to the microcontroller. The microcontroller then translates input into electrical signals for the LEDs. However if all the energy from the batteries were to go to the LEDs they would quickly burn out. In order to prevent this, there are 11 resistors throughout the circuit to reduce the electrical charge for the LEDs. Diodes are also scattered throughout the circuit and they make sure that the energy flow is unidirectional. They do this by allowing energy (mostly unresisted) in the desired direction but strongly resisting the energy in the other direction. Finally, after successfully soldering and programming the MiniPOV, I was able to make it display my name.

Reflections:

I really enjoyed my time at BlueStamp Engineering. I have no experience with any sort of mechanical or electrical engineering and had had only the most basic introduction to coding. Now I am able to read schematics, know what resistors, capacitors, and diodes do, and know my way around Arduino (C) code. My only regret was that a was following a kit and instructions and I wasn’t able to do as much of my own ideas as I wanted. I had planned multiple additions but various errors such as soldering a switch upside-down on my starter project and the Great Short of 2013 (which was caused by a loose washer and caused smoking and sparks) took up enough time to prevent me from implementing them. However I plan on taking what I learned at BlueStamp Engineering to enable me to work on other projects at home (like possibly the omni-directional robot).

Leave a Comment

Start typing and press Enter to search