Room Occupancy Counters -- Need Help!


You can accomplish the same with a 555 timer to modulate the IR leds with 38Khz.

The receivers have all of the circuitry built in to amplify and demodulate the IR signal and output a logic high or low depending if the beam is broken or not

here is a link to a circuit you will need to build two receivers per doorway!

The transmitter part can be rigged up with individual transistors to control multiple IR LED's

At the receiver you can ignore the the 555 timer (its used to generate the tone for the buzzer)

instead connect a transistor to the wire that would feed the reset input on the 555 timer to drive a relay then interface it to the elk input and do a software count rule.

Or you could build a missing pulse detector using a 555 timer and for each receiver and drive the relay from there

Just a another option
I'll chime in on the iPhone presence detection thing as I've successfully coded my own implementation of it.

Just wanted to chime in here with some experience of my own.

I enjoy my Elk sending a push message to my and my wife's iPhones whenever one or the other of us get home. We both work odd schedules and it's nice to get the automatic note whenever we get home.

We each have our own code so it already works that the Elk only emails her when I get home and only I when she gets home.

What I couldn't get with the elk, however, was skipping the message when she disarms when I AM home (not too common cause I'm usually not armed when home) or when we leave together (much more common). The later situation would end up with us both getting a message that had no applicability to us because we both knew we just both left together.

The solution? Writing my own iPhone based presence detection software.

I'll leave out the gory details, but I essentially took PHP, which i already run on a server in house to let me fire off some other custom automation scripts I have, and wrote a loop that pings the static IP for each of our iphones every few seconds. It saves in a file the last time it saw each of our phones respond to ping. Now the iphone when idle turns off wifi...but you can set it to check your email every 15 minutes, during which it turns on wifi for about 15 to 20 seconds to do so. Knowing this I wrote my script to expect seeing the iphone respond to at least one ping every 16 minutes. If it doesn't see a ping for 16 minutes it changes the status of that phone in my program to assume it is away from home. The moment it sees a response again it goes back into the state of assuming it is home. With some fun perl scripting (thx to that guy who wrote the elk/perl library) I've got this integrated to do what I need. Only someone away from home gets notices from the elk when someone has armed or disarmed.

This has a lot of potential going forward. I can have the house only send a message to someone's phone when the mail comes and they aren't home (because when they are home they hear the audible alert in the house), and more.

It took some work to get going but it works with near 100% reliability. Since I currently only use it to filter whether or not push messages get sent to our phones on the rare occasion wifi is acting up the messages just get sent anyway - not the end of the world.

I can share more details or answer questions anyone has. The code is pretty simple. Most difficult part was interfacing with the elk via perl but honestly once you get the hang of that excellent api someone wrote it's pretty powerful.
You reference "push" notifications - are you really using "push" or just SMS? If you're using Push, what app is doing the Pushing?
Well under the surface they're actually the same thing to a degree (although apple takes a new edge on it when you're on wifi..anyhow....)

I don't use SMS for this. I use Prowl, which is a push notification API that supports growl but can also be directly emailed. It is stupid fast. In less than 2 or 3 seconds from pressing my doorbell my iPhone is going off with a push notice. I don't pay for SMS on my iPhone cause at&t's rates for it are outrageous so buying prowl one time was an amazing way to take care of this. Keeps the history in a more viewable way than SMS did too, imo, and has a built in browser for when i click links to images my system sends me. They get shown instantly instead of launching out into safari.
I finally got around to doing a semi-complete writeup. I have pictures of the completed PCBs and a bunch more of me installing it. I still need to add a parts list and all that stuff when I can get some time. I'm worn out from all the door frames I have pulled off the past few weeks
Here is the link:

Occupancy Detector & People Counter

Thanks for the writeup. I only just recently found it since I've just started setting things up at home in the past couple weeks. I'm really enjoying reading the rest of your site as well for ideas.

Viewing your pictures made me wonder, are you worried about carving out your jack studs that much? Are all the doors with that kind of carving out non-load-bearing? I'd be worried that over time there could be some stress on that little part that's left that could lead to more serious issues down the road.