Saturday, February 14, 2015

Final: Firefighting Challenge (Failure)


The final challenge for the class was to navigate a maze and find a candle, then put out the flame with a fan.


Unfortunately these are the last upgrades I made, I added on the line sensor to be able to read when the VEX got into a room for a command to begin for it to sense if there was indeed a flame in the room to be sniffed out.



Up to the last minute I was still not even able to run him in the final event against the other robots. I overshot my programming and made it way too complex for it to be able to do any good. I fell behind in the class so far that I was only able to just get the hang of writing a wall avoidance system/fire finding system. I panicked and tried to dumb my program to a simple navigation to one room and sniff out, I didn't even have a fan attached to blow the candle out with. It wasn't even a failure, it had to compete in order for it to fail, hahaha.


This is just a photo of the case after disassembling the bot. Although it was hard to learn about so many things at once that I had never bothered to ever read about, I had a lot of fun! Even the nights I spent on a single lab were fun. The times I got things right were glorious and the times I didn't were valuable lessons. I'm glad to have joined the class, it has gotten me legitimately convinced I want to pursue robotics further!


Post 13: Ultrasonic Sensor/ Other Sensors


After doing the Ultrasonic sensor lab on the Arduino and being comfortable with the uses of it, I moved on to the task of creating one to be able to function on a moving robot.

Here is the components needed, it took a little testing to find what pins on the wire were connected. after a bit of soldering, 4 wires were created to have it connect to an analog port in the VEX and an interrupt port.


Now the VEX has some eyes to avoid walls! the only problem is programming how far his eyesight should be before he freaks out and turns....


Let's see what 6-7 will do and test it out in the hallway.

 

Test run successful! He avoids walls perfectly, a little cowardly, but better than him running into a wall and damaging any components.


After constructing a holder for the sensor to be facing forwards, it was time to create a sensor for fire detecting. Unfortunately I didn't notice until too late that the Line sensor isn't fit for that (not sure why that wasn't obvious to me). Below is a quick grab of components to make a quick Phototransistor sensor for the bot!


Now just to slap it onto our bot (electrical tape is always a good policy) and he can sniff out flames better than any other bloodhound!


Post 12: Programming/Adding Encoders To Squarebot

After getting through all that training, it's finally time to get back to work on the VEX robot!
Except that my laptop decided to be a jerk and not allow me to install the drivers...

 

After a lot of wasted time I finally got switched over to class computer! Woohoo! Oh and I got a battery pack (the other one wasn't necessary)!


Today's challenge is a bit of a toughie, it's to go through this tape maze by programming the VEX bot to power either side-motor. This will dictate whether the robot is propelled forward, turns wide, or sharply shifts itself in place.


The only things to keep in mind are the distance between each move in the program. Or rather, how long we should have the motors on for...

This first leg of the maze is long, so there's that to keep in mind...


Then there's the turn and longer leg, turn, short forward, turn, 2nd short, turn, and then short to the finish.


After a bit of just field testing what the distances were, this was the result:

 

Alright! Next up is doing the maze with the encoders. To keep this short, it's basically a sensor that is utilized in such a clever way that it reads the amount of times the axle spins. This can, in turn be used to measure wheel spinning and thus, distance.


Now let's see what the maze is like after only 2 trials! I couldn't quite get the robot to stick to a straight line, but it made the maze just fine! (There was a better run than this one that I didn't catch on tape, honest!)

 

Now that we've got that, we can begin to make the VEX move at a more precise pace!


Post 11: Building Sensors For Your Robot

This particular lab is centered on the prospect of utilizing special kinds of sensors such as an Phototransistor to detect certain kinds of light with a particularly long wavelength of radiation, making them naked to the human eye.


Either way! So this circuit takes the input from the IR and uses it the same way we've used the other sensors. Using what the previous Serial Port lab has taught us, we can now see the exact values being picked up from the Phototransistor when we put an Infrared LED (it does exactly what it sounds like) next to it in the circuit. Note the values on the right.









Let's just test the validity of this sensor by checking the values when we pull out the IR LED.






Just as predicted! The values have dropped, showing that the sensor is working and our circuit is valid!
The next step would be to take the above circuit and make it so that it would be put to use without it being plugged into a breadboard. Luckily Prof. Denny was nice enough to help us out by putting up a diagram of what that might look like (copied from board on left). I tried to imagine it in components and the right version is what came of it.


After tons of messing up, I finally got a terribly soldered version of it ready to go!


It aint pretty, but damn if it aint portable!



And best of all! Our values are in the right margins for it to work as expected!


Post 10:Using the Serial Port/Hack-A-Toy






Since I stupidly forgot to document the Serial Port lab, I decided to fuse it with the Hack-A-Toy lab and turn this cat on with the Serial input to the Arduino!




So first we have to open kitty up! Okay so there's a lot of wires in here and...2 motors.






Okay now we just need to see how to attach him to the power supply instead of the batteries he's used to!
Okay! After a few adjustments our cat is hooked up and ready to go! First let's see what this cat does when he's on...



Oh. That's kind of creepy. First step accomplished though! We got it to move! Now let's get the Arduino to send voltage to it via a signal from the laptop we're using!

 
It's a success! I know it's a little hard to tell (blame my crappy camerawork...) but to explain it, I programmed the Arduino to allow power to be sent to the cat when I sent a 1 through the Serial port. Then I got it to cut power when I sent a 0 instead, turning off the cat (keep an eye on the LED eyes). In the original the cat would have been replaced with an LED, but hopefully this suffices.


Thanks for your help catbot! I'll try to put you together at home...maybe...


Post 9: Music and Advanced Programming

I actually didn't get around to finishing this lab up too much, it is supposed to focus on utilizing the input principles of the previous lab and use it to output the sound through a buzzer depending on the amount of electricity coming through/read dictated by the POT.

Here's a video of it working, listen carefully, I guess my phone didn't capture the sound as well as I thought it did.

 

This is the config for the laser light show that combined both the buzzer and the LED turning on and off to make it look like a one level equalizer in a way.

Before that I got to hear a buzzer version of "Shave and a Haircut" (Google it) which is pretty awesome. Reminds me of those guys that got the floppy disk drives to play E1M1 from DOOM.



Post 8: Microcontrollers, input/output

This lab is going to focus on the inputs and output functions of microcontrollers and the amazing things that various configs can have on the way electricity is interpreted by the board.

This is written with a code that tells the arduino to vary the frequency at which the LED is on/off.



In this one the light will instead flicker at a higher frequency until it blinks so fast it looks like it's just on!


This is the opposite of the previous video, in that the LED is on at max power and slowly grows dimmer using the same formula as before.


Now we'll test the reaction that the board gets from an input! The data it will get from me pushing this button, giving it a signal to turn on the LED!


 
And in video form of course:

 
Now in this next segment we're going to see a config that uses an LDR to determine the different electrical signal sent to to the board. With some programming and two LEDs, a couple of states of light can be read:

One where both LEDs are on, signifying bright light. 
One where only the top is on due to medium light. 
One where only the bottom one is on, signifying dim light. 
And one where both are off, signifying no light, and thus, no power being let through.







In this next config we use a thermistor (think an LDR but with temperature instead of light) to dictate the power sent to the motor attached.


The objective here is to get the motor to turn on with a touch but my finger couldn't do it on it's own, it took a little pinch to warm it up I suppose. Either way, it's a really cool way to get a motor moving!