140 likes | 344 Views
“Heaven’s Light is our Guide” Rajshahi University of Engineering and Technology Department of Electrical and Electronic Engineering. A brief description of 8051 Microcontroller. By MD. MOSHIUL ALAM (JONY) ROLL NO. 041016 EEE - 4/7, RUET . Mobile No. +8801710998670
E N D
“Heaven’s Light is our Guide”Rajshahi University of Engineering and TechnologyDepartment of Electrical and Electronic Engineering
A brief description of 8051 Microcontroller By MD. MOSHIUL ALAM (JONY) ROLL NO. 041016 EEE - 4/7, RUET. Mobile No. +8801710998670 E-mail:moshiul.bd@gmail.com
is their any similarity between a microprocessor and a microcontroller No there is not. A microprocessor is a part of the microcontroller. A microprocessor can’t operate without RAM, ROM and other peripheral devices.
Now to operate the chip as a microcontroller we have to write a C++ program. Various company release their own C compiller.
Now consider a practical problem for the use of our microcontroller Suppose we want to automate the light of our house. If the natural light is reduces then the microcontroller switch on the light. The light sensor can be done by using the LDR (Light dependent resistor)
Here is the a simple circuit for the light sensor: The above circuit is a light sensor. When light intensity is low then LDR provide about 10K resistance thus the voltage at pin 2 is low ( 4.7*5/(10+4.7)=1.6 and the voltage at the pin 3 (2.5V) is high since the constant voltage is supplied to the two voltage dividing path. Thus we get 5V at the output. Similarly when there is sufficient light then the LDR provide about 3K resistance and the voltage at pin 2 is high then the pin 3. Thus output is 0V. (5*4.7/(3+4.7))=3.05
Now if we connect the previous circuit output to P1.1 port and the light switch is controlled by the mosfet whose gate is connected to the P2.1 and writing the following program : #include <reg51.h> //Header file declaration for 8051 mc sbit sensor=P1.2; //single bit declaration of P1 port sbit light=P2.1; //single bit declaration of P2 port Void main(void) { while(1) //infinite loop declaration { if(sensor==1) light=1; else light=0; } }
Here is the actual circuit 8051 MC N.B . To operate the above circuit, ISP(in system programming) board is requied.