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.
No comments:
Post a Comment