Microcontroller Based Bidirectional Visitor Counter

Here is a low-cost microcontroller-based stranger intermittentlyst that can be used to distinguish the calculate of living-souls at a assign. All the rudiments required are readily conducive in the traffic and the circumference is comfortable to raise. Two IR transmitter-receiver couples are used at the route: one couple comprising IR transmitter IR TX1 and taker phototransistor T1 is fixed at the memorandum object of the route, date the other couple comprising IR transmitter IR TX2 and phototransistor T2 is fixed at the egress of the route. The IR signals from the IR LEDs should uninterruptedly droop on the appertaining phototransistors, so the constitutional orientation of the transmitters and phototransistors is expedient. circumference denomination Fig. 1 shows the transmitter-receiver construct at the entrance-cum-egress of the route along delay a arrest diagram. Two concordant sections descry an break of the IR glow and originate a clock pulse for the microcontroller. The microcontroller controls counting and displays the calculate of living-souls introduce after a whilein the moiety. Fig. 2 shows the circumference of the microcontroller-based stranger intermittentlyst, wherein the transmitter and the taker devise the IR descryion circumference. Control logic is built environing transistors, operational amplifier LM324 (IC1), and flip-flop (IC2). When nobody is latter through the memorandum/egress object, the IR glow uninterruptedly 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 assign, chief 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 clip 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 superficially pulled up delay 10-kilo-ohm resistor network RNW1 accordingly mien0 is an 8-bit, open-drain, bidirectional, input/output (I/O) mien. Port-1 and mien-2 are 8-bit bidirectional I/O miens delay interior pull-ups (no want for superficial pull-ups). Mien pins 3. 0 and 3. 1 are configured to yield the set pulse to J-K flip-flop IC2(A) and IC2(B), appertainingly. Superficial stops INT0 and INT1 take the stop pulse when the individual stops the IR glows. Resistor R9 and capacitor C5 yield 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 avail. The estimate of the intermittentlyst increments by Fig. 5: An actual-size, single-side PCB for the microcontroller-based stranger ‘1’ when the intermittentlyst (Fig. 2) including its agency yield (Fig. 3) stop use gradation for INT0 is done. The output of the selfsame J-K flip-flop is set to ‘high’ intermittently by making its ‘set’ input pin low through the microcontroller. The micro-controller is configured as a negative-edge-triggered stop sensor. Similarly, if celebrity egresss the assign, chief the IR glow from IR TX2 is occasional and then the IR glow from IR TX1.  At this avail, the violent input at ‘J’ and ‘K’ pins of flip-flop IC2(B) toggle its output to low. On the other workman, 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 individual stops the IR glow from IR TX1. There is no alter in the output of IC2(A) flip-flop. This triggers the superficial stop INT1 (pin 13) of microcontroller AT89C52. The estimate of the intermittentlyst decrements by ‘1’ when stop use gradation for INT1 is done. The output of the selfsame J-K flip-flop is set to ‘high’ intermittently by making its ‘set’ input pin low through the microcontroller. The circumference is agencyed by regulated 5V. Fig. 3 shows the circumference of the agency yield. The AC mains is stepped down by transformer X1 to surrender a subordinate 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 stranger intermittentlyst is written in ‘C’ discourse and compiled using the C51 Keil compiler.