This is a counter circuit that I would like to you view an another form of concept. The most counter circuit that is often used in industrial applications such as object detection and counting. This project uses a sensor to detect objects that pass through, then the number increases or decreases by one and shown is the display digits.
The most counter products are often priced quite expensive. However, it is recommended to create a counter that ‘s affordable. It’s accuracy work effectively. Since the circuit is controled with the micro controller IC.
-Can count the number of 4 digit, or counting from 1 to 9999.
-There are function to count up or count down mode.
-Sensors are used to detect objects is infrared sensor.
–Which is the transmitter and the receiver included in the same body both opposite and Between the middle as gap, Makes object is detected through into.
IMPORTANT! If the object is opaque to translucent The counter circuit malfunction immediately. so care must be taken.
How the circuit works
As figure 1 The heart of the Circuit is at the micro controller IC number AT89C1051 is the micro controller MCS-51. Internal have RAM memory of 64 bytes and program memory EPROM size of 1 KB is used for the packaging of the entire circuit.
Start that DC voltage of 9 volts from external is feed to a diode D1 to protect voltage supply that backward when we apply power supply not proper polarity. Then the 9 volts will be put to an IC1(LM7805) to regulated the constant voltage to 5 volts, By has capacitor C2 filter voltage to smooth next level. Then this 5 volts will send into the micro controller IC2 and the 4 digit LED 7 segment-display.
The display set will use the LED 7 segment dual two put together are 4 digit. Port P1.0 to P1.7 of IC2 (AT89C1051) will be output pin to send value to drive LED 7 segment to lit up as several number. By have RN1 connect full up with positive voltage. To help to drive LED 7 segment light more clearly. The port P3.0, P3.7, P3.1 and P3.2 will be pin output to send logic “0” to pin common cathode of all the LED 7 segment. Because pin a to g all its is connected to combination. So use pin common control are separated. Called the multi-plex. The advantage is saving device for driving LED 7 segment.
The port P3.3 of IC2 will be pin input for logic “0” and logic “1” that from pin emitter of IC3(H21A1) into Ordered the the micro controller is up or down one number.
An IC3 is called an slot optocoupler. Contains an infrared LED light and light the NPN photo transistors.
Normally, the LED inside IC3(H21A1) is always running, Makes port P3.3 is logic “1” at any time. Now the display will not be any numbers. If objects passes between the transmitter and receiver will make pin collector and pin emitter does not conducted. As a result, port P3.3 is a logic “0” to flow through R3. This period display will count the number up or down to 1.
The display is a 4-digit number from 0000 to 9999. Switch S2 is also served by a count up or count down. If Port P3.4 to float if it will count down. Port P3.4 to ground or if it will count up. The S1 switch will reset the time to zero.
The working of program
Start reset circuit all LED 7 segment will display as digit 0000, and then wait checking at sensor. If not have any thing the system will wait for this checking indefinitely. But if the objects passed. The program will check the switch S2 is set to count up or count down mode. And then program will make increased in steps of 1 or decrease the value by 1. Then go back to impressions numbers on the screen. And waiting checked the sensor and the same. This behavior of the sequences in this program will Indefinitely.
You can put code in Figure 2 is the the IC microcontroller immediately.
Figure 2 The code program to IC number AT89C1051
How to build circuits
For friends. I try to build this project, I have a PCB layout based on Figure 3, and to position the device as shown in Figure 4 is that are good idea for you.
Figure 3 Copper pattern of PCB.
Figure 4 Positioning devices onto a printed circuit board, the two plates.