Do you need to count vehicles entering and exiting a parking lot, or tally goods passing through conveyor belts at varying heights in a designated area?
Point-to-point through-beam photoelectric sensors are a common option, yet they pose notable limitations in practical applications.
But, vehicle models and tally goods feature different heights, and improper sensor mounting—either too low or too high—will easily cause counting inaccuracies.
Safety light curtains are therefore a far better alternative. They enable detection of objects within a fixed height range (e.g., from a 0.5 meter mounting height up to their maximum detection distance). This height coverage drastically boosts detection precision, ensuring reliable identification of vehicles of all sizes.
Now that you know safety light curtains are the superior choice, how do you use them to count total objects accurately?
Below, we provide three cost-effective, turnkey solutions for this application.
Method 1: Using a safety light curtain and an electromagnetic cumulative counter
When using a safety light curtain to count objects, the first solution that comes to mind is to use it with an electromechanical accumulator counter, which is the easiest to implement.
When an object passes through the barrier consisting of a safety light curtain transmitter and receiver, it generates a voltage output, which triggers the accumulator counter to count once.
Since the output of a safety light curtain can be a PNP, NPN transistor, or relay output, the wiring diagram will differ depending on the output.
In the next section, I will show you how to wire it correctly.
How to wire?
For safety light curtains using NPN or PNP transistor outputs, you can wire them as shown in the diagram below:
Since our electromechanical accumulator counters do not have positive and negative terminals, you can easily wire them without worrying about reversing the connection.
Advantages
- The wiring is simple and suitable for beginners.
- No programming knowledge is required; the counting problem can be solved with just hardware.
Disadvantages
- It can only be used to count the total number. If you want to issue an alarm when a preset number is reached, there will be a problem.
- If you want to stop the machine after reaching a preset value, you need a dedicated person to obtain the counting results, which may waste human resources.
- When counting people in parking lots or automatic doors, actions such as a car reversing as it enters or a person passing through the door and then returning can be counted, which may lead to errors in the total count.
- Because few cumulative counters have communication capabilities, remote monitoring can be difficult; for example, it is
Method 2: Using a safety light curtain and a preset counter
This method utilizes a safety light curtain in conjunction with a preset counting relay(such as our DH48J preset counter relay). Its key advantage lies in enabling batch counting and providing an alarm upon completion.
How it works:
When an object interrupts the light beam between the transmitter and receiver of the safety light curtain, a counting signal is triggered. The counting relay increments until the preset value is reached, at which point it outputs a control signal (e.g., to activate an alarm). This cycle then resets, allowing for efficient, repeated batch counting.
Wiring considerations:
Our counting relays support various input types (PNP, NPN, or relay). It is crucial to ensure compatibility between the counting relay’s input circuit and the output signal type of the safety light curtain before connection. Refer to the following wiring diagram:
Advantages:
- Batch counting: Ideal for batch processes. The counting relay can be used independently or with additional counters for this purpose.
- Alarm output: Upon reaching the set count, the relay’s output can directly trigger an alarm or indicator, providing clear completion status.
- Control integration: The output signal can be used to control other devices (e.g., stopping a motor), facilitating automated control sequences.
Disdvantages:
- Susceptible to duplicate counts: If the same object repeatedly enters and exits the detection zone, it will be counted multiple times.
- Limited flexibility: The system is not programmable, restricting its ability to perform complex, conditional logic.
- Lack of connectivity: Without communication capabilities (e.g., RS485 port), remote monitoring and data integration are not possible.
Method 3: Using a safety light curtain, PLC and HMI
Connecting a safety light curtain to a PLC is not only the best solution for object counting, but it can also handle more complex tasks.
By combining these two products and programming the PLC accordingly, we can avoid the counting errors that occur in methods one and two.
Now let’s take a closer look at its working principle, wiring methods, and advantages and disadvantages.
How it works
In this counting method, when an object blocks the beam of light from the safety light curtain, the light curtain sends a 24VDC or 12VDC pulse signal to a designated input point on the PLC.
The user-written PLC control program continuously scans this input signal.
Each time a valid signal is detected, the counter register increments, and the counting result is displayed on the Human-Machine Interface (HMI) via Ethernet.
Furthermore, more advanced logic can be implemented, such as triggering an alarm to sound a buzzer.
How to wire the two products?
The wiring diagram below will show you how to connect different output safety light curtains to a Siemens S7-200 SMART PLC.
Advantages
- High flexibility and intelligence: The programmable nature of PLCs enables them to implement complex counting logic and integrate seamlessly with other processes such as sorting, packaging or data logging.
- Anti-double counting: By using an additional photoelectric sensor, we can achieve anti-double counting. For example, in the example shown below, if the output signal sequence of the detected object is 1->2->3, it will only be counted once; if the sequence is different, the PLC will not count.
- Powerful communication capabilities: Most PLCs support industrial communication protocols (Ethernet/IP, Profinet, Modbus, etc.), enabling real-time remote monitoring and providing data to HMI or SCADA/MES systems.
Disadvantages
- High cost: All of these components can be found on Amazon, and calculations show that the price of these components will be close to $1,000 (1,000 mm safety light curtain: $499.00(If purchased from us, it is only about $260.0), Siemens PLC: $220.00, two pairs of through-beam photoelectric sensors: $100.00), while the first two methods cost less than $100 (if purchased from us), so this solution is more expensive.
- Programming expertise is required: If you are not familiar with PLC programming languages, it will be difficult to use them correctly, and you will spend a lot of time learning them.
Conclusion
In summary, three practical methods are available for object counting with safety light curtains: pairing with a cumulative counter, a preset counter, and a PLC + HMI combination.
If you are looking for reliable, high-quality, and reasonably priced safety light curtains, cumulative counters, and preset counter relays, Lorentzzi Electric can provide these products. You can contact us by emailing shonxu@lorentzzi.com.


