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.














No comments:

Post a Comment