Programming and application of the AT89S52 microcontroller.
Application of the voltage regulator IC 7805.
Application of seven segment displays and their interfacing with the microcontroller output.
The Microcontroller based Industrial Timer is a simple timer based on the AT89S52 microcontroller that performs countdown operation starting from the digit 9999 (minutes/seconds) with four 7-segment displays showing the time left. The relay energises when the the start switch is pressed and remains ON till the countdown reaches 0000.Four push-to-on switches are used to start/stop,select either minutes or seconds,and set the initial value for countdown operation (using up and down keys). No. of ICs used: 2
The microcontroller is Atmel AT89S52 (IC1),which is a 40-pin device with 8kB of program flashmemory, 256 bytes of RAM, 32 I/Olines, Watchdog timer, two data pointers, three 16-bit timer/counters, a sixvector two-level interrupt architecture,
a full-duplex serial port, on-chip oscillator and clock circuitry. The powerdown mode saves the RAM contents but freezes the oscillator, disabling all other chip functions until the next interrupt or hardware reset is activated.
Port P0 of microcontroller AT89S52is configured for segments of the 7-segment
display. Port 0 is an 8-bit open-drain bidirectional I/O port. Port 0 is pulled up with 10-kilo-ohm resistor network RNW1. Port pins P0.0through P0.6 are connected to pins ofsegments ‘a’ through ‘g’ via resistors R2 through R8, respectively. Port P0.7
is connected to decimal via resistor R9. Resistors R2 through R9 are used as
current limiter for various segments of displays, respectively.
Port 2 is used to control DIS1through DIS4. Port 2 is an 8-bit bidirectional I/O port with internal pullups. When port-2 pin is low, the transistor conducts and provides supply to the common pin of 7-segment display. Port pins P2.5 through P2.2 control DIS1 through DIS4 with the help of transistors T1 through T4, respectively.
The microcontroller drives the 7-segment displays in multiplex mode.
This helps in reducing current consumption while maintaining thebrightness of the display. For driving the displays , timer 2 inside the microcontroller is used. It enables display of each digit every two milliseconds.For driving the displays, the microcontroller uses port-0 to send the segment outputs. It selects the corresponding unit’s, ten’s, hundred’s and thousand’s displays through P2.5, P2.4, P2.3 and P2.2, respectively Four pins of port 1 are used for various switches like select, up, down and start/stop. Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. Switches S1 through S4 are connected to pins 5 through 8 of the
microcontroller and used for select, up, down and start/stop functions, respectively.
Pin P3.7 controls relay RL1. When pin P3.7 goes high, transistor T5 is
driven into saturation and relay RL1 energises. Diode D1 serves as a free-wheeling diode. Any appliance can be connected with contacts of relay RL1.
Brand: Kits'n'spares, Marketed by: Kits'n'spares