FAQ
TL;DR: For a people counter, use an IR beam or retroreflective laser; one PIR in the thread even reacted to trucks a mile away—“VERY sensitive.” Build with a modulated beam and decoding to avoid spoofing. [Elektroda, Steve Lawson, post #21664420]
Why it matters: This FAQ helps students and hobbyists choose and build a simple, reliable infrared counter without common false-trigger traps.
Quick Facts
- Three common approaches: PIR, IR sender/receiver beam, and IR laser with reflector; pick based on range and environment. [Elektroda, Steve Lawson, post #21664420]
- Modulate the IR beam and verify a code periodically to defeat simple jammers or spoofers. [Elektroda, Mark Harrington, post #21664423]
- Narrow-beam IR LEDs exist with approx. 4–6° viewing angles; useful for short indoor spans. [Elektroda, Steve Lawson, post #21664425]
- A retroreflector bounces light back to the source, easing alignment over doorways and corridors. [Elektroda, Steve Lawson, post #21664424]
- For people counting, beam break + basic encoding helps avoid spurious IR triggers seen in open spaces. [Elektroda, Steve Lawson, post #21664428]
What’s the simplest infrared alarm for a population counter?
Use a beam-break setup. Mount an IR emitter across from a receiver, or point a laser at a retroreflector so the return beam hits one receiver. When the beam is interrupted, increment the count. This approach avoids PIR false triggers in changing environments. [Elektroda, Steve Lawson, post #21664420]
How do I stop someone from fooling the IR beam?
Modulate the emitter and decode a known pattern at the receiver. Periodically change or check the code. This blocks a constant-ON jammer or a second emitter placed in front of your sensor. “Include a protocol alongside the beam.” [Elektroda, Mark Harrington, post #21664423]
Do I need a second receiver, or can I use a reflector?
Use a retroreflector to send the beam back to the same unit. It removes most alignment headaches because it returns light toward the source over a wide incident angle range. Ideal where power at the far end is inconvenient. [Elektroda, Steve Lawson, post #21664424]
Can I use an IR LED instead of a laser?
Yes. Narrow-beam IR LEDs with approx. 4–6° viewing angles work well across doorways. They are inexpensive and safer than lasers for indoor builds. Part numbers in the thread show multiple options at low cost. [Elektroda, Steve Lawson, post #21664425]
Is a PIR sensor good for people counting?
PIR detects thermal changes, not explicit crossings. It can false-trigger from distant heat patterns or sun-warmed surfaces cooling in the wind. For precise counts, prefer a beam. “These devices are VERY sensitive.” [Elektroda, Steve Lawson, post #21664420]
How do I count IN vs OUT with beams?
Use two spaced beams and a short time window. If Beam A then Beam B breaks, count IN; the reverse order counts OUT. Add a latch to avoid re-triggers while an object blocks the path. This defeats gate-held-open issues. [Elektroda, Mark Harrington, post #21664429]
Quick build: How do I make a modulated beam counter?
- Drive the IR LED with a fixed modulation and known code.
- Receive with a photodiode/TSOP, demodulate, and verify the code.
- On valid code loss, toggle a microcontroller input and update the count.
This resists constant-beam spoofing. [Elektroda, Mark Harrington, post #21664423]
What environmental factors cause false alarms?
PIR can trip from distant traffic heat patterns or sunlit walls cooling in gusts. Beam systems can be held open if the path is intentionally blocked. Shield optics, use modulation, and add timeout logic. [Elektroda, Steve Lawson, post #21664420]
Should I consider webcam or IP-camera motion detection instead of IR?
You can. Image-based motion detection with USB/IP cameras and software (e.g., C#) replaces PIR in some projects and adds rich data. It needs more compute and lighting control. “Now being replaced with image movement detectors.” [Elektroda, Mark Harrington, post #21664435]
Are there off‑the‑shelf people counters I can buy?
Yes. Vendors market wireless people counters and analytics bundles. These save build time but disclose little about internals and may cost more. Evaluate technology, safety, and data access before purchase. [Elektroda, Ag Ga, post #21664437]
Is infrared people counting safe?
IR LED and low-power laser systems are typical; always check emitter class and power. Be cautious with opaque vendors. As one expert noted, unknown tech could even be harmful if misused. Ask for safety documentation. [Elektroda, Steve Lawson, post #21664438]
What modulation or protocol should I use for robustness?
Manchester-encoded schemes like RC5 work well. Add a toggle bit to mark new events, then log timestamps to I2C memory. You can forward events via Ethernet, Wi‑Fi, RF, or SMS for alerts. [Elektroda, Mark Harrington, post #21664427]
What is Arduino Nano?
A compact Arduino board with a microcontroller, USB programming, GPIO, and common serial buses. It fits breadboards and small enclosures, ideal for counters and data loggers. “Arduino Nano — Arduino”
What is Tuya?
A smart‑device platform providing IoT modules, cloud services, and apps for connected products. Many low‑cost sensors and plugs use Tuya ecosystems and chips. “About Tuya — Tuya Smart”
What is OpenBeken?
OpenBeken is community firmware for Beken/Tuya Wi‑Fi MCUs that enables local control and custom logic on IoT devices without cloud reliance. "OpenBeken README — GitHub"
What is CAN bus?
A robust, multi‑master serial network designed by Bosch for vehicles and machinery. It uses differential signaling and message arbitration for reliability in noisy environments. “CAN Specification — Bosch”