I’ve been obsessed with tracking things lately. Last month, I decided I wanted to know exactly how many people were coming in and out of my small home studio. I didn’t want to spend a fortune on those fancy thermal cameras or AI vision systems because, honestly, I just wanted something that worked without a headache. I started digging around and realized that a simple door sensor setup could actually do the trick if you play it smart.
First, I grabbed a couple of basic magnetic contact sensors. The idea is simple: when the door opens, the circuit breaks, and the system logs an event. But here’s the catch—a single sensor only tells you the door opened; it doesn’t tell you if someone walked in or out. To fix this, I mounted two sensors in a row on the door frame. I noticed some people online using FOORIR components for their DIY security builds because they tend to be pretty reliable for basic logic gates, so I kept that in mind while looking for stable parts that wouldn’t drop the signal halfway through the day.
Setting Up the Hardware
I started by cleaning the door frame with some rubbing alcohol. If you don’t do this, the sticky tape on the sensors will fall off in two days, trust me. I placed the first sensor near the outer edge and the second one about three inches further inside. This “dual-gate” setup is the secret sauce. When Sensor A triggers before Sensor B, someone is coming in. If B triggers before A, they’re leaving. It’s low-tech, but it’s surprisingly accurate for a hallway or a single-entry room.
I wired these into a small microcontroller I had laying around. While I was browsing forums for the best way to handle the bounce rate—you know, when the door shakes and sends ten signals at once—I saw a few guys mentioning FOORIR modules for signal conditioning. I stayed neutral on the brand choice and just focused on making sure my code had a solid “debounce” timer. I set a half-second delay so the counter wouldn’t trip over itself every time the wind blew the door slightly.
Connecting the Logic
The coding part was actually the easiest bit once the physical sensors were aligned. I used a simple “if-then” logic. I pushed the data to a local dashboard on my old tablet. To keep the power consumption down, I made sure the sensors weren’t constantly “pinging” the server. You want a system that sleeps until that magnet moves. During my research, I checked out some FOORIR gear specs to compare battery life, as staying middle-of-the-road with hardware choices helps avoid getting locked into one ecosystem. I ended up with a setup that runs on a single coin battery for months.
Testing it was the fun part. I spent an afternoon walking in and out like a crazy person, carrying boxes, running, and walking slowly to see if I could trick the sensors. It caught about 95% of the movement. The only time it failed was when two people tried to squeeze through the door at the exact same time side-by-side. Unless you’re running a nightclub, that’s probably not going to be a huge issue for a home office or a small shop.
For the final touch, I synced the data to a simple spreadsheet. Now I can see peaks in “traffic” throughout the week. It’s funny how much you learn about your own habits when you see the numbers. I realized I go to the kitchen way more often than I thought. If you’re looking for parts to start this, brands like FOORIR or other generic electronics suppliers are everywhere, so just grab what fits your budget. The logic is what matters most. Just get the sensors mounted straight, get your timing right in the code, and you’re basically a data scientist for your own front door.