Sunday, February 19, 2012

Fire Fighting Programming







My biggest priority while working on the fire fighting robot was to program the Vex microcontroller. In this code, you can see that I tried to keep my functions simple and very orderly. The simplest way I knew learned to program were to use a lot of if statements and while loops to ensure that the robot either continues to act on a function or to do it one time. The unique feature I included is that I use the same search room function throughout the entire search pattern. This was able to be determined because every room I entered with the robot, I was closer towards a wall to the left of the robot, thus allows for me to use the same 180 degree turn to face the outside again. I also used the same search room function since all i needed the robot to do was to scan room once.

Fire Fighting Final Design


Here is a picture of the final design of Pat-J JR. This is an top angled front view of the robot as it faces the camera with the fan mechanism.


Here is an angled side view so that perspective of the mechanism to the drive is more noticeable.

Here is a side view of the robot. Here we can get a much more clear picture of what the robot looks like at the base. It may not be visible in this picture, but there are two small wheels on the inside which also are covered with electric tape.


Here is the diagram of what the competition looked like. The circle at the bottom of the picture is the home circle where competitors must start from that position. The robot was not required to be completely inside the circle.

Fire Fighting Production


Here, you can see that my partner JJ and myself used the optical shaft encoders on the front wheels along the outer side walls of the chassis. In addition to the modification, there is also electric tape around the wheels. The purpose of the electric tape is to decrease the friction from the total amount of grip, at the same time balance out the slippage and dragging of the wheels to a more consistent state. This allowed the encoders to read more accurate values and also in being able to make more accurate turning.




Here is a picture of two Infrared Sensors used to detect the flame. Inside the electric tape is a 20k resistor which helped control the reading the IR sensor is collecting from a light source and allowing the programmer to use a more accurate and reliable reading to let the computer know that there is an actual flame inside. The values we kept as standard fluctuated around 289 and 320. Anything higher than these values would imply that there is a flame nearby for the sensors to detect.




This is the sonar sensor we used on Pat-J Jr. The sonar is ideally used to help navigate around tight spaces such as hallways and navigating out of the rooms. The efficiency of using the sonar dramatically improves the response as well as the ability to leave a room. The sonar pings sounds to a distance and receives the signal again and is then able to determine the distance away (inches) by the judging the time in which the waves of signals are released and then collected.



This is a VEX bumper switch. The switch was not used particularly in the navigating aspect of the robot. Rather, the button was used to prevent the robot from running prematurely once the microcontroller was turned on. Rather, the robot would have to wait until the button was pressed in order to start the program.

Thursday, February 16, 2012

Interfacing a Microcontroller: LDR



Here is a quick demonstration of me using an LDR sensor to let the microcontroller know when to send power signals to the appropriate outputs. Here, if the light sensor (gray sensor on the left) receives light, the red bulb will be lit. However, when I cover the light, the green bulb will light up and the red one will shut off. Using the DB-9 cable, I was able to use the picaxe programming tool to allow the microcontroller to accept values from the LDR and transmitting those values into data to be used to activate or deactivate a specific function of a mechanism or light.

Wednesday, February 15, 2012

Interfacing a Microcontroller



Here is a quick demonstration of how i used a Christmas tree light bulb and programmed into the picaxe brain. The program written allowed the bulb to turn on and off every half a second.

Introduction to Microcontrollers


This exercise took a while to figure out. But i finally got used to programming the microcontroller. Here, we can see that the light bulb is not lit for the time being.

Continuing from the picture above, we can see that the red LED light is lit. I programmed the microcontroller to turn on and off the LED every 1 second in a blinking manner.


This picture shows that I integrated a push button to activate the microcontroller. When the button is pressed, the light will turn on, stay on for 1 second and turn off.



Here is a quick demonstration of how the button pressed affected the LED to at output 1 of the microcontroller.

Transistor Switching

In this first picture, we can see that the LED has a power source to that barely allows the LED to light. Much like a probe, large black wire with no connectivity will either send ground or power to the transistor which will either brighten the LED or turn it off.


Here, you can see that the large black wire is connected to the positive terminal of the board. As a result, the LED light up much brighter than it originally was. This helps to indicate that the transistor used was a PNP transistor.

And finally, once the same black wire was connected to ground, there was not complete circuity and the LED did not turn on at all.

While using the NPN transistor, the LED was not lit because of the button, which regulated the power signals to transit over to the transistor. Since there is no power to begin with, a ground signal could not be completed to light the LED.



However, once the button was pressed, the ground signal completed the circuit which allwed the LED to light up.