Tuesday, February 14, 2012

2.14.12 Adjustments and Competition

On Friday 2.10.12, I continued to test and make adjustments.  I figured out the avoid obstacles problem by increasing the range for movement (50" to 6").  I also was able to test the flame sensor range and found better values to allow the Square Bot to function properly.  The straight path runs were fine.  The turns were not fine.  When I tested a few lines of code, a straight with one turn, it worked fine.  When I added more lines of code to run more paths and turns it did not work fine.  The turns were over by about 20 degrees.  I ran out of time to test more runs and make more adjustments.
At the Competition on 2.11.12 in Cal State Long Beach the same problem occurred, over turn by 20 degrees.  The Square Bot wasn't able to complete the course.



In the video below, following the competition, we tested the first path to the first room and the Bot made the right turns with no problem to our surprise!

 Also, the video below shows that our Bot was able to scan, locate, and put out the candle flame.

Thursday, February 9, 2012

2.9.12 Changed the right encoder and adjusted the motor speed


Today, we continued to have problems with straight path runs from the Square Bot and bad readings from the flame sensor, as well as, stops related to the avoid obstacles code.  We replaced the right encoder and had to makes changes to the code.  A metal bracket was added to keep the right encoder from moving out of place.  The motor speeds had to be adjusted.  The straight path problem was eliminated. 

 When we performed test runs to the first room, we had problems with the flame sensor readings and the avoid obstacles range.  More adjustments are needed.



Wednesday, February 8, 2012

2.8.12 Flame sensor range and avoid obstacles range


Today, we continued to work on the flame sensor range.  When we tested the Square Bot in the practice maze the flame sensor would pick up the flame while facing one of the walls at an angle.  It was the glare/reflection of the flame.  We also had to adjust the range of the avoid obstacles function that allowed the Bot to move forward slowly when the flame was detected and to stop within a short distance from an obstacle (the flame base/wall).  My partner later added the fan to the Square Bot.


The C++ code for the room path was constantly being adjusted.

Tuesday, February 7, 2012

2.7.12 Square Bot Testing and Fan motor interface



Today, I programmed more for the Square Bot and its' sensors.  I completed the flame sensor interface between the Square Bot and the computer.  My partner in the meantime, finished installing the circuit for the fan motor and the flame sensor (photo-transistor).  Instead of the fan motor he used a light to indicate that it was receiving the 5V from the digital output.  It worked!   When we test ran the Square Bot we were still having problems with direction and straight path runs, as well as flame readings.














Thursday, February 2, 2012

2.2.12 Ultrasonic Rangefinder, flame sensor, and programming




Today, I went over the programming for the Square Bot and interfaced the Ultrasonic sensor with the photo-transistor while my partner added the sensors to the Square Bot.


The programming required a few more while loops and call functions.  The call functions made the task main portion of the program less cluttered. 





Wednesday, February 1, 2012

2.1.12 Photosensor and testing


Today, my partner and I were testing the photo-transistor on a PCB.  We first had to find the right resistor for our flame sensor to work properly.  After trial and error, we decided to use a 22kOhm resistor that gave an output voltage of about 2 Volts.  We also measured the range voltage at about 1 meter away.  These values, the one meter range and the 10 inch close range, will be used later in the programming for the VEX and photo-transistor interface. 

 

In the meantime, I continued programming for the Ultrasonic-sensor.  This sensor lets the robot sense objects that may be in its' path.

Tuesday, January 31, 2012

1.31.12 VEX Team Project programming & phototransistor testing



Today, I started programming for the VEX Square Bot.  After downloading the software to our computer I was able to download the program to our Square Bot.  This first program was without encoders and the functions were based on time in seconds for the movements.  This was very difficult and needed trial and error for all of the paths that we wanted the Square Bot to take.  We ran the Square Bot in the Labyrinth and it didn't do so well as far as the complete course.  We have yet to try the same course with encoders which should make the process less difficult and more precise.

Thursday, January 26, 2012

1.26.12 PC to Microcontroller Interface, VEX Team Project





I used the circuit from a previous lab (LDR circuit).



Here I was programming, debugging, and transmitting data to the computer screen.  Programming and debugging the micro-controller to read analog data (LDR) and sending the output to the computer screen allowed for values to be viewed in real time.


Another way to transmit data to the computer screen is by using serial terminal with sertxd.  This allows the person to program a message with the output data to make it more clear; "The value is ".  The data is continually updated at each new line/message.

Serial input can allow the programmer to have the micro-controller interact with the keyboard input.

Today, we started on our team project with the VEX 'Square Bot'.  The first thing we needed to do was to plan the project.  We started with a PERT chart showing boxes of tasks that we needed to accomplish in chronological order.  We then transferred this to our Ghant chart which was more detailed.  The Ghant chart showed the tasks, who was responsible, and the days when the tasks were to be completed over the  next couple of weeks.  Having a  plan set up before the project began gave us a clear idea of where we would be going.  We expect there to be changes along the way.  We understand that this is a guide to help us stay organized and goal orientated. 











Wednesday, January 25, 2012

1.25.12 Music


For this circuit, I added a piezo sounder to make sounds based on different frequencies from the PICAXE micro-controller.  I eventually used this circuit for the 'toy hacking' project.  Pin 2 on the micro-controlller  was used.  Below are several programs used to make different sounds.  I kept each program as I added others by placing a semicolon in front of each line that was not used for the current output.














1.25.12 Toy Hacking Project





I took apart a robotic toy (hacked) by simply unfolding a flap held down by Velcro and cutting a zip tie that held the fabric wrapped around the battery and circuit board. I then removed the plastic cover that surrounded the battery location and exposed the circuit board.  I then carefully pulled partially ut the circuit board and began to locate the motors related to the eye movement of the toy.  I then connected a few wires to one of the motors (eyes) and attached it to the PCB that had the circuit set up for it.

I then attached it to  a circuit board with an analog input (LDR) and output (piezo sounder).






    I wrote a simple program to allow the sensors and toy motor to work.  The motor to the eyes will open and close as long as there is enough light for the LDR.  Based on the program when the LDR receives less light the the motor to the eyes will stop and the piezo sounder will play 'Silent Night'.

Tuesday, January 24, 2012

1.24.12 Interfacing to a Microcontroller



In this circuit, I used a 2N3904 transistor and a 470ohm resistor with the PICAXE microcontroller and an 200mA incandescent bulb as an output device.  The light flashes on and off and the transistor was hot.

For the next circuit,  I replaced the 2N3904 transistor with a TIP 41 transistor.  The light flashed on and off again, but this time, the new transistor stayed cool.  I then replaced the 470ohm resistor with 2.2Kohm resistor and the light remained bright.



The next circuit consisted of a darlington configuration (the 2N3904 acts as a signal transistor providing 300mA to the TIP 41 which acts as a power transistor with a 1K resistor.  This configuration provides a high Gain.

  In the next circuit, I replaced the two transistors with an equivalent darlington TIP 122 transistor.  The light is just as bright and the TIP 122 remains cool.














Using the same circuit, I replaced the incandescent bulb with the motor for the eyes of the toy I 'hacked' and added an emf suppression 1N4001 diode in parallel for the coil of the motor.





Friday, January 20, 2012

1.19.12 Transistor switching and Microcontrollers


Today, I set up a circuit that included a transistor (2N3904 NPN) with a push button (SPST).

I then removed the push button and the 10K resistor.  I then used my finger to complete the circuit.

I later started to program on a computer using PICAXE for the micro-controller.  The program I typed in makes the micro-controller blink the LED on and off (1000ms on and 1000ms off).


I changed the program by decreasing the on/off time by half (500ms).  This increase the blinking of the LED by half.


In the next circuit I used a digital input, a simple switch, to activate the PICAXE micro-controller.  When the push button is pressed the LED will 'flash'. 



 Using an LDR (Light dependent resistor) in the next portion of the circuit, I entered another program that provided a varying voltage signal range  After adding a line of debug int the program I was able to fine tune the range for a working model.  The range was from 190 to 200.  One LED would emit light if the value was over 200, while the other would emit light if the value was below 190.  In the picture above, in the dialog box off to the right in the second column, the value is above 200 and the red LED emits light in the picture below.
 
In the picture above, the value in the dialog box is less than 190 because the LDR is covered from the surrounding artificial light and the green LED emits light in the picture below.














1.18.12 Cutting the PCB connections for a Logic Probe and soldiering a DB9 connector interface.

Today, I started off in the soldiering room to build a DB9 connector interface.


I came back to the class and worked the rest of the time on the Logic Probe.  I never worked with an Exacto knife, so I was very cautious not to injure myself.  I took detail in not cut the desire connections on the PCB.  I used the multimeter (ohmmeter) to test for connectivity.  I worked on it more outside of class and performed more testing.






1.17.12 Square Bot Assembled, programmed and test run, Logic Probe Circuit

For the beginning of the lab week, I assembled the Square Bot chassis.  The rechargeable battery was added, the program was uploaded, and I test ran the Square Bot.  I made some adjustments to the motor's screws and it ran fine.

Today, I set up a circuit for a logic probe using a transistor 3904.


 After adding a resistor (150KOhm) in parallel to the 360 Ohm resistor and connecting it to the base of the transistor, the LED was brighter.

 I went to the soldiering room to soldier the Logic Probe onto a PCB.



Sunday, January 15, 2012

1.12.12 Schematics, Ohm's Law, Potentiomer, Switches & Relays, Square Bot


Today, I set up a circuit with three LEDS and resistors.  The resistors increased in resistance (100ohms, 1,000ohms, and 10,000ohms).  I found that the LED with the least resistance (100ohms) was illuminated the brightest and the dimmest had the highest resistance (10,000ohms).

I set up a circuit that included a potentiometer, an LED, and its necessary resistor.  The potentiometer behaved like an adjustable resistor that, when turned, made the LED go from dim to bright.

I next set up an LED circuit with two SPDT (single-pole double throw) switches in series.  When either switch was 'flipped' the LED would turn off.


 Next, I took inventory of the Square Bot assembly tool box to make sure all the parts on the list were accounted for.

 The next circuit I set up had two LEDS, one resistor, a relay, and a push button switch.  When the button is depressed the green LED is lit and the relay makes a noise.



  When the button is not depressed the red LED is lit.







Friday, January 13, 2012

1.11.12 5V Power supply, breadboard circuit, and using a multimeter.



Today, I completed soldiering the pins and heat shrinking a cover to the 5V breadboard power supply AC adapter that I will be using on all of the lab projects.

Here, I set up a breadboard circuit using one LED and one resistor (1000 ohms) in series.
 



 

Using the multimeter, I tested voltages on a few DC batteries.  The first was a 1.5V D battery and then a 9V battery.


With the multimeter, I tested an unregulated AC 9V adapter.  The value was higher (14.24V) than the posted 9V.  I added a 100ohm resister to the end and measured 11.8V.  The resistor caused a drop in voltage.


With a multimeter, I tested my 5V adapter.  The value was approximately 5.11V.

With a multimeter, I tested an AC-AC adapter.  The printed output was 13V.  I measured 15.76V.


With the multimeter, I measured the resistance values for five resistors and compared them to their band color code values.  The measurements were as follows: 75ohms was 75.8ohms, 100ohms was 98.9ohms, 390ohms was 388ohms, 470ohms 469ohms, and 680ohms was 673ohms.


  With a multimeter, I measured a potentiometer.  The lowest value was 4.7V, while the highest was 8.71KOhm.