This is a circuit that uses infrared light to detect obstructions and to signal that the PIC16F877A microcontroller performs counting. Each time an obstacle passes, an infrared circuit generates a level 1 signal to the microcontroller.
Circuits are designed simply, people can refer and manually make a similar one.
Block diagram of the circuit:
The sensor block identifies the obstruction block (product) and transmits the control signal to the microcontroller block, where an infrared receiver is used to do this work.
Infrared is emitted by an infrared LED and collected in the LED receiver, LED receiver when the infrared beam is in, the two ends of the LED are turned off, exactly in the sensor block when the LED is infrared. light blocking, the B pin of the C1815 transistor is considered to be triggered so we will have the signal to the LM358. LM358 is an opamp wired to a comparator circuit to generate a 0V or 5V signal.
The control unit is responsible for detecting the signal from the sensor circuit and displaying the number on the 7 segment LED.
The display block consists of three 7-segment LEDs that display counts. LED 7 segment Anode common. Use transistor A1015 to scan 7 segments.
Video demo