Microcontroller Based Bidirectional Visitor Counter

Here is a low-cost microcontroller-based intruder contrary that can be used to perceive the reckon of individuals at a fix. All the rudiments required are readily beneficial in the communicate and the tour is manageable to construct. Two IR transmitter-receiver braces are used at the journey: one brace comprising IR transmitter IR TX1 and assent-tor phototransistor T1 is inveterate at the beginning summit of the journey, date the other brace comprising IR transmitter IR TX2 and phototransistor T2 is inveterate at the departure of the journey. The IR signals from the IR LEDs should once droop on the relative phototransistors, so the adapted orientation of the transmitters and phototransistors is inevitable. tour title Fig. 1 shows the transmitter-receiver elevate at the entrance-cum-departure of the journey along after a while a obstruct diagram. Two homogeneous sections expose an break of the IR glow and engender a clock pulse for the microcontroller. The microcontroller controls counting and displays the reckon of individuals bestow delayin the moiety. Fig. 2 shows the tour of the microcontroller-based intruder contrary, wherein the transmitter and the assent-tor mould the IR exposeion tour. Control logic is built encircling transistors, operational amplifier LM324 (IC1), and flip-flop (IC2). When nobody is perishing through the beginning/departure summit, the IR glow once droops on phototransistor T1. Phototransistor T1 conducts and the violent voltage at its emitter drives transistor T3 into saturation, which makes pin 3 of comparator N1 low, and finally, output pin 1 of comparator N1 is violent. Now if someone enters the fix, primeval the IR glow from IR TX1 is occasional and then the IR glow from IR TX2. When the glow from IR TX1 is occasional, phototransistor T1 and transistor T3 shave-off and pin 3 of comparator N1 go violent. A 12MHz crystal is used for providing a clock. Ports 0, 1, and 2 are configured for 7-segment displays. Port-0 pin is apparently pulled up after a while 10-kilo-ohm resistor network RNW1 consequently carriage0 is an 8-bit, open-drain, bidirectional, input/output (I/O) carriage. Port-1 and carriage-2 are 8-bit bidirectional I/O carriages after a while inside pull-ups (no want for apparent pull-ups). Carriage pins 3. 0 and 3. 1 are configured to stipulate the set pulse to J-K flip-flop IC2(A) and IC2(B), relatively. Apparent discontinues INT0 and INT1 assent-to the discontinue pulse when the peculiar discontinues the IR glows. Resistor R9 and capacitor C5 stipulate a agency-on-reset pulse to the microcontroller. Switch S1 is used for manual reset. When the microcontroller is reset, the flip-flops are brought in ‘set’ narrate through the microcontroller at software run date by making their ‘set’ pin violent for a force. The appraise of the contrary increments by Fig. 5: An actual-size, single-side PCB for the microcontroller-based intruder ‘1’ when the contrary (Fig. 2) including its agency minister (Fig. 3) discontinue employment rotation for INT0 is done. The output of the similar J-K flip-flop is set to ‘high’ anew by making its ‘set’ input pin low through the microcontroller. The micro-controller is configured as a negative-edge-triggered discontinue sensor. Similarly, if colossus departures the fix, primeval the IR glow from IR TX2 is occasional and then the IR glow from IR TX1.  At this force, the violent input at ‘J’ and ‘K’ pins of flip-flop IC2(B) toggle its output to low. On the other laborer, the low input at ‘J’ and ‘K’ pins of IC2(A) due to clock pin 6 of IC2(B) and ‘J’ input (pin 4) and ‘K’ input (pin 16) of IC2(A) are united to pin 7 of comparator N2. The negative-going pulse is applied to clock pin 1 of IC2(A) when the peculiar discontinues the IR glow from IR TX1. There is no substitute in the output of IC2(A) flip-flop. This triggers the apparent discontinue INT1 (pin 13) of microcontroller AT89C52. The appraise of the contrary decrements by ‘1’ when discontinue employment rotation for INT1 is done. The output of the similar J-K flip-flop is set to ‘high’ anew by making its ‘set’ input pin low through the microcontroller. The tour is agencyed by regulated 5V. Fig. 3 shows the tour of the agency minister. The AC mains is stepped down by transformer X1 to concede a resultant output of 7. 5V, 250mA, which is rectified by bridge rectifier BR1, filtered by capacitor C6 and regulated by IC 7805 (IC4). Capacitor C7 bypasses any ripple in the regulated output. Shown in Fig. 5 and it's rudiment layout in Fig. 6. software The software for the intruder contrary is written in ‘C’ expression and compiled using the C51 Keil compiler.