27-07-2012, 11:13 AM
Automatic Room Light Controller with Visitor Counter using Micro controller
Automatic power saver.doc (Size: 7.15 MB / Downloads: 578)
INTRODUCTION
This project is the most common and interesting to start with. The application is counting the number of persons entering in and exiting out like in Delhi Metro stations, Industries, offices, lift, car parking, and many more
Our objective is to count the objects (persons) entering and exiting the room so we need some sensors to detect the objects and a control unit which calculates the object, below you can find the block diagram and circuit diagram which illustrate the solution and the Embedded ‘C’ source code .
PRINCIPLE:
From the block diagram it is clear that the sensor pairs are placed face to face so that an IR radiations from IR LED are continuously received by phototransistor which makes its emitter base junction forward and collector current Ic equals to emitter current Ie (i.e, Ic=Ie) assuming base current to be negligible. Hence the voltage at collector node becomes zero (logic 0) which is feed to microcontroller port pin P3.2 and P3.3, if any object is placed in between the sensor pair blocks the IR radiation which in turns put the phototransistor in cut-off mode and Ic!=Ie, this makes collector voltage to +5V (logic 1)
In our program we have to poll both the inputs from both the sensors at port pin P3.2 and P3.3 to detect for the entry or exit, if sensor pair one is been obstructed (P3.2 becomes one) first, implies persons entry and second pair is obstructed (P3.3 becomes one) first shows exit. After obstructed any one sensor we have to poll for the next sensor to determine a complete entry or exit.
CIRCUIT DESCRIPTION
Fig. 1 shows the transmitter-receiver set-up at the entrance-cum-exit of the passage along with block diagram. Two similar sections detect interruption of the IR beam and generate clock pulse for the microcontroller. The microcontroller controls counting and displays the number of persons present inside the hall.
Fig. 2 shows the circuit of the microcontroller-based visitor counter, where in the transmitter and the receiver from the IR detection circuit. Control logic is built around transistors, operational amplifier LM324 (IC1) and flip-flop (IC2).
When nobody is passing through the entry/exit point, the IR beam continuously falls on phototransistor T1. Phototransistor T1 conducts and the high 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 high.
Now if someone enters the place, first the IR beam from IR TX1 is interrupted and then the IR beam from IR TX2. When the beam from IR TX1 is interrupted, phototransistor T1 and transistor T3 cut-off and pin 3 of comparator N1 goes high.
The low output (pin 1) of comparator N1 provides negative trigger pulse to pin 1 of J-K flip-flop IC2 (A). At this moment, the high input at ‘J’ and ‘K’ pins of flip-flop IC2 (A) toggles its output to low. On the other hand, the low input at ‘J’ and ‘K’ pins of IC2(B) due to clock pin 1 of IC2(A) and ‘J’ input (pin 9) and ‘K’ input (pin 12) of IC2(B) are connected to pin of comparator N1. The negative-going pulse is applied to clock pin 6 of IC2(B) when the person interrupts the IR beam from IR TX2. There is no change in the output of IC 2(B) flip-flop. This triggers the external interrupt INT0 (pin 12) of microcontroller AT89C52.
The AT89C52 is an 8-bit microcontroller with 8 kB of flash-based program memory, 256 bytes of RAM, 32 input/output lines, three 16-bit timers/counters, on-chip oscillator and clock circuitry. A 12MHz crystal is used for providing clock.
Ports 0, 1 and 2 are configured for 7segment displays. Port-0 pin is externally pulled up with 10-kilo-ohm resistor network RNW1 because port-0 is an 8-bit, open-drain, bi-directional, input/output (I/O) port. Port-1 and port-2 are 8-bit bi-directional I/O ports with internal pull-ups (no need of external pull-ups).
Port pins 3.0 and 3.1 are configured to provide the set pulse to J-K flip-flops IC2(A) and IC2(B), respectively. External interrupts INT0 and INT1 receive the interrupt pulse when the person interrupts the IR beams. Resistor R9 and capacitor C5 provide power-on-reset pulse to the microcontroller. Switch S1 is used for manual reset.
When the microcontroller is rest, the flip-flop are brought in ‘set’ state through the microcontroller at software run time by making their ‘set’ pin high for a moment.
The value of the counter increments by ‘1’ when the interrupt service routine for INT0 is executed. The output of the corresponding J-K flip-flop is set to ‘high’ again by making its ‘set’ input pin low through the microcontroller. The micro-controller is configured as a negative-edge-triggered interrupt sensor.
Similarly, if somebody exits the place, first the IR beam from IR TX2 is interrupted and then the IR beam from IR TX1. When the beam from IR TX2 is interrupted, output pin 7 of comparator N2 goes low. This provides clock pulse to pin 6 of J-K flip-lop IC2 (B).
At this moment, the high input at ‘J’ and ‘K’ pins of flip-flop IC2 (B) toggles its output to low. On the other hand, the low input at ‘J’and ‘K’pins of IC2 (A) due to clock pin 6 of IC2(B) and ‘J’ input (pin4) and ‘K’ input (pin16) of IC2(A) are connected to pin 7 of comparator N2.
The negative-going pulse is applied to clock pin 1 of IC2(A) when the person interrupts the IR beam from IR TX1. There is no change in the output of IC2(A) flip-flop. This triggers the external interrupt INT1 (pin 13) of microcontroller AT89C52. The value of the counter decrements by ‘1’ when interrupt service routine for INT1 is executed. The output of the corresponding J-K flip-flop is set to ‘high’ again by making its ‘set’ input pin low through the microcontroller.
The circuit is powered by regulated 5V. Fig.3 shows the circuit of the power supply. The AC mains is stepped down by transformer X1 to deliver secondary 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.
WHAT IS EMBEDDED TECHNOLOGY
Embedded technology is software or hardware that is hidden embedded in the large device or system. It typically refers to a fixed function device as compared with a PC which runs general purpose application. Embedded technology is nothing new. It all around us and has been for year. An early example of embedded technology is a engine control unit in a car what setting to give the engine. Your coffee maker has embedded technology in the form of microcontroller, which is what tells it to make coffee at 6 a.m. the vending has it too. Overall billion of device based on embedded technology.
In the past embedded technology existed standalone device vending machine & copier that did their job with little regard for what went on around them. But as technology learned to connect devices to the internet and each other, embedded technology potential has grown.
Cell phone companies figured that out along time ago, which is why cell phone are cheap and service plan are expensive. It is not the phone itself that matter, but the connectivity of the vast network of other phone, other people and internet. Until you download software that lets you find a local restaurant and manage your finances.
Let say you make a freezer the big, expensive kind that grocery stores buy. You sell me and you are with that customer, when it brakes the customer calls the service person who probably comes from somewhere other than your company. But let us say that freezer knows that it is about to go on fritz.
Let say three refrigerator alert the customer before it break. Better yet, let us say the freezer alert the manufacture and are able to send a service person to do preventive work and save a lot of hazardous from melting.
Embedded technology allows all of that to happen. You, the freezer company have transformed yourself from Product Company and Service Company.
The possibility to go beyond that programming device to communication with business can eliminate the need for costly call centre. Copy machine that can order that replacement cartridge will save time and money. Remember, the fact the technology is not what important, and nighters is the device.
Applications:
• Telecom:
Mobile phone system (handset and base station), modems and routers.
• Automotive application:
Braking system, tracking control, Airbag release system, management unit and Steer- by- wire systems .
• Domestic application:
Dishwasher, television, washing machine, microwave oven, video recorder, security system, garage door controller, calculator, digital watches, VCRs, digital cameras, remote control, treat mills.
• Robotic:
Fire fighting robot, automatic floor cleaner, robotic arm .
• Aerospace application:
Flight control systems, Engine controllers, autopilots, passenger entertainment systems .
• Medical equipment:
Anesthesia monitoring systems, ECG monitor, pacemaker, drug delivery systems.
• Defense system:
Radar systems, fighter aircraft flight controller systems, Radio systems, missile guideline systems .
• Office automation:
Laser printers, Fax machines, Pagers, Cash registers, gas pumps, Credit/Davit card readers, Thermostats, Grain analyzers.