Thursday, January 30, 2014

Building Sensors

    The picture shown above is that of the simple flame sensor constructed for our robot by my 
 partner. It is an infrared phototransistor in series with a 10K ohm resistor(or the equivalent to anyway). It works much like a normal NPN transistor except that in this case the base current is controlled by the amount of infrared light it detects.
     This is a picture of the line detector that I constructed last night. The key component of this device is the TCRT5000 infrared emitter and detector package. The two positive leads of this component are attached to two wires spliced into one lead which will connect to power. The two negative leads are also spliced together as shown except that the emitter is in series with a 220 ohm resistor and the detector is in series with a 12K ohm resistor and also has a lead that attaches to an analog pin on the Arduino. This device is capable of detecting the difference in color of black and white surfaces.

Wednesday, January 29, 2014

Using Encoders

     The first thing we did during this class period was to mount a set of encoders onto the VEX Small Bot and write a simple code to track them. Once the code was written and the encoders were attached to the VEXduino, we could observe the encoder counts increasing in the global variables window as the wheels turned.

     Once it was determined that the encoders were working properly, we had to write a code that would cause the robot to drive forward exactly 12 inches or one square floor tile. Some values which stemmed from the diameter of the wheel were used to determine a coefficient that would be used in the code. That coefficient had to be played around with a little bit, but eventually the robot did travel forward exactly 12 inches.

Tuesday, January 28, 2014

VEX Programming and the VEXduino Board

     The above picture shows the VEXduino board attached to a VEX Small Bot, which will be used in our final project. The board was constructed by my partner Kevin while I essentially sat around and waited for RobotC to download. A simple test was done to determine everything was in working order. In this test, a program was downloaded to the board that caused the servo to alternate from its initial position of 0 degrees to 180 degrees.

     After it was determined that the VEXduino board was working properly and mounted to the robot in a way in which it would not short out, we were to create a code in RobotC that would allow the robot to maneuver a maze that was constructed out in the hallway. After some trial and error, I wrote a code that allowed the robot to do so, but then I accidentally deleted it...I rewrote it with a few changes to the turning commands, and the robot made it through the maze quite well. It was not perfect, but it did end up in the desired finishing position.

Servos and Signal Conditioning

     In this exercise, a VEX Servo was powered by a 5V power supply and connected to the Arduino. A simple code was written and the Arduino was programmed to cause the servo to move from its 0 degrees position to its 180 degress position with a short delay in between the movement.

     This exercise was essentially an extension of the previously discussed exercise. Instead of having a simple program control the position of the servo, a potentiometer was placed into the circuit to give the user more control over the servo's position. The position of the servo moved accordingly to the position of the potentiometer.

Music and Advanced Programming

     This exercise was actually rather useful in preparing for my first project. This circuit shown above is an LDR in series with a piezo sounder. The design is similar to an electronic instrument called the Theramin. It was programmed to play a certain tone depending on the value that the LDR was receiving from its environment. What is not shown in this post is the second exercise of this handout. In this exercise, the LDR was removed, and an LED was placed in series with the piezo sounder instead. The arduino was programmed to play a short tune and the LED flashed along with the notes being played.

Tuesday, January 21, 2014

Driving Motors and Other Output Devices



     The video above shows a circuit consisting of a MPSA13 Darlington transistor which is switching a "signal lamp" on and off. The transistor essentially has a Darlington arrangement built into it so that one did not have to be constructed. The light is just as bright as it had been with the actual Darlington arrangement.
     This video shows almost the same circuit as the above video. The difference here is the transistor that is being used. Instead of the MPSA13, a TIP120 power transistor was inserted into the circuit.
 
     This video shows the previously constructed circuit controlling one of the motors of the toy I dissected. It uses the same TIP120 transistor but with a 2.2K ohm resistor used instead of a 3.3K. Also a 1N4001 diode was placed in parallel with the wires that control the motor.
     This circuit was supposed to control the direction of a DC motor. Its two main components are the TIP120 power transistor and a DPDT relay. One pin of the arduino was an output that was to turn the motor on and off, and another pin was to be an output that would control the direction of the motor. However, for some reason the motor did not want to change its direction.

Thursday, January 16, 2014

Microcontrollers Continued and Hacking a Toy

 

In this particular circuit, a microswitch is attached to pin 8 of the Arduino microprocessor and an LED is attached to pin 6. When the switch is open, the input pin is LOW and it is HIGH when the switch is closed. When the switch is closed, the output pin is also HIGH and the LED is lit up.



      In the last circuit from the microcontroller packet that was to be constructed, an LDR was used to control two LEDs. The LDR is an analogue sensor and was connected to an analogue port of the Arduino. The Arduino was programmed to have both LEDs on when the LDR was exposed to bright light, one LED on in medium light, both LEDs on in dim light, and neither of them on in the absence of light. This was the most frustrating exercise I have completed so far.

Before moving on to the Driving Motors and Other Output Devices packet, we were to dissect our toys in order to start our first project. My toy was the Big Mouth Billy Bass (Holiday Edition). Upon dissecting it, I determined which sets of wires were connected to the three motors of the toy. One motor controlled the mouth, one turned the head, and one controlled the tail.

      This circuit consisted of a Christmas light, a 470 ohm resistor (a 3K was also used), and a 2N3904 transistor. The light was connected to the collector of the transistor and the resistor was connected to the base. This circuit itself was powered by our 5V power supply. The Arduino was programmed to light the LED for one second and shut it off for one second. Of course this was done using a loop.
     This circuit served the same function as the one described above. However, this circuit also involved a MPSA42 medium power transistor and a back EMF suppression 1N4001 diode. This arrangement is known as a Darlington and allowed the Christmas light to glow even brighter than the previous circuit with the 470 ohm resistor even though this circuit used a 3K ohm resistor.



Wednesday, January 15, 2014

Transistor Switching and Microcontrollers

     The above picture shows a circuit we were to construct consisting of 3 resistors, an LED, a pushbutton switch and a 2N3904 transistor. Initially, the LED is not lit, but when the pushbutton switch is engaged a small positive voltage flows into the base of the transistor which allows current to flow from the collector to the emitter. This current lights up the LED.
     This particular circuit is essentially the same as the previous one but with the pushbutton switch removed. Instead of a pushbutton switch, a small positive voltage is flowing through my finger which then reaches the base of the transistor. The LED lights up but not nearly as bright as it had before.

     In this exercise, we were to program the Arduino microcontroller to simply make an LED blink on and off. A loop was set up to turn the LED on for one second and then off for one second.
     Using the Arduino microcontroller, we were also able to light up four LEDs one after another in a pattern similar to the lights on K.I.T.T. The program was not much different from the previous except that four pins were used as output and the delay time was decreased to 100 ms.
     Also, we finished building our squarebot. After it was completed, Tommy programmed it and we were ready to drive around. I imagine that soon we will have to program it ourselves for the firefighting robot competition.

Thursday, January 9, 2014

Switches and Relays!

      Today, we went over switches and relays. We built a few different circuits using different types of switches, and the one depicted above uses two separate SPDT slide switches. Either one of the switches can be used to turn the LED on or off.

      This second circuit contains a pushbutton switch (with its momentary state ON) and a DPDT relay. Because of the way the components are connected, the green LED would be lit as soon as power was supplied to the circuit. However, once the pushbutton switch is engaged, a small voltage is sent to the coil inside the relay which surrounds an iron core and a magnetic force causes the pole to meet the other contact. This contact shuts of the green LED and lights up the yellow LED.
     This last circuit we constructed is very similar to the first except the power to supplied only to the pushbutton switch and a capacitor was connected in parallel to the relay. Once the pushbutton switch was engaged, the LEDs would light up alternately in oscillation. Without the capacitor, this would happen much to quickly to even be noticeable.


Wednesday, January 8, 2014

Multimeters and Ohm's Law

We began today with some practice using a multimeter. We conducted conductivity, resistance, and voltage measurements. Conductivity measurements were taken on the solder board we practiced on yesterday in order to confirm their connectivity. Voltage measurements were taken on 1.5 and 9V batteries, the power supply we constructed yesterday, and an unregulated power supply. We also measured the resistance of four different resistors after determining the value using the color code.







Today, we also used our power supply again in conjunction with a breadboard to create another simple circuit. However, this circuit was different in the sense that three of the same type LEDs were in series with three different resistors, and all of these series circuits were parallel to each other. The point was to observe that the circuit with the least resistance was the circuit with the brightest lit LED. Of course, the 100 ohm circuit was the brightest, the 1K ohm circuit came in second, and the 10K ohm circuit was incredibly dim.
We also constructed a circuit consisting of a potentiometer in series with a 100 ohm resistor and an LED. The purpose of this exercise was to observe how a potentiometer is capable of varying the resistance in a circuit. The brightness emitted by the LED of course varies with the amount of resistance.

Lastly we did inventory on the VEX square bot kits. Oh the times we had!

Constructing a 5V power supply and simple series circuit

     The first exercise of the day was to practice making soldering connections to a soldering board. We were given a selection of surplus components including resistors, monolithic and ceramic capacitors, and diodes. We were to make at least 20 solder connections using these components, being careful to completely cover the pad and cover the lead without making contact with other pads.

     The next exercise was to construct a 5V power supply which we will use to provide power to our breadboards. In order to do this, we had to cut off the little plug at the end and strip the outer insulation to expose the two conducting wires. We then soldered those wires to a tiny connector using a butt joint and heat shrink tubing was added to prevent short circuits . Next, the polarity of each wire was determined using a multi meter.
     The final exercise was to create a simple series circuit which would be powered by our newly constructed power supply. The circuit was made on a breadboard using a 1 kilo Ohm resistor and an LED. The resistor was connected between the positive end of the power supply and the LED with the negative lead of the LED connected to ground. The actual circuit is nearly impossible to see from this picture, but you can clearly see the LED is lighting up.