Pages

Wednesday, 13 August 2014

                          2.SWITCH CONTROL OF AN LED USING 8051
Hello friends,
In the last session we just learnt the fundamental switching i.e Blinking a LED .Now lets move one step futher by monitoring that LED using SWITCH .what we need is "when switch is ON led must glow and when it is OFF led also turns off ".we have to do this using 8051 microcotroller .Before using microcontroller we must know that how a LED can be controlled only by using switch.As we already know LED will glow only when it is forward biased ,using this knowledge we have to control the LED using switch i.e In the ckt 1 switch is closed hence led s forward biased and it glows but in   ckt 2 switch is open hence no current and LED turns off.


                                ckt 1                                                                             ckt 2




we  know  8051 has 4 ports out of which we can use P1,P2 and P3 but usage of P0 is quite different (we will learn about this in the further sessions) so now lets interface and program using Port 2 and Port 1 of AT89C52 microcontroller from ATMEL family of 8051.All the ports has 8 i/p and o/p pins out of these let us choose P2.0 for LED and P1.0 for switch.
INTERFACING:
When Switch is ON





When Switch is OFF



PROGRAMMING:




For detailed tutorial Watch Vedio.......





No comments:

Post a Comment