[Deekshith Allamaneni] built this controller which will automatically turn the lights in a room on and off. No big deal, right? You can already get a replacement light switch at the home store that will do this for you. But there is one big difference. The commercial solutions we’ve seen simply rely in a motion sensor and a timer. But [Deekshith] found a way to count the number of people that enter a room, turning the lights on when the first person enters and off when the last person leaves.
The video after the break shows a demo of his test rig. At first we just thought that this was only counting how many times an object passes between the sensors. But it can also detect in which direction that object was traveling. Now the system just needs to be scaled up for use in a doorway.
It would be a great addition to the house that doesn’t have any light switches.
This will go wrong when two people leave or enter the room together…
These photoresistor/phototransistor based sensors work really well when you have the light source that close, but when you have your gate mounted on oposite sides of a door, things might get a little funky. Also, it’s always a good idea to be able to manually overide the current number, so the number doesn’t get too far off
I Thought about doing exactly the same thing, cause atm the traditional sensors are absolutely not perfect (when I’m sitting in the room at my laptop, after a few minutes the light switches off).
But how can this be extended to detect when two persons are going through the door, one leaving and one entering?
I already thought about infrared thermometers or thermal imaging cameras, but they’re either to expensive or I couldn’t imagine the ‘perfect’ way to use them…
i thought about the exact same thing myself. I think what actually comes in our way to implementation is our own imagination that can give at least 10 different answers on how this could go wrong.
somehow, this guy got it built, which is more than i can say about mmy own ideas 99 percent of the time.
one of the problems will be people that just pop their head around the corner of a room to tell someone dinner is ready of that the taxi is there or something and then the number will likely be way off….
No, I have well handled this type of error in the circuit. So this error will not occur.
I have eliminated this problem in the code. The microcontroller is programmed to check for a sequence of steps which eliminates false triggering.
The circuit is what you have expected but not the code.
In the real world counting who is in the room is very problematic. If you have children and/or pets the count can quickly become incorrect. We’ve tried this with software such as Misterhouse and the majority of folks quickly give up on this route. It appears technology such as kinect like devices can be used to solve this problem but this gets expensive for each room of the home.
May be going for the same sensor set at multiple levels may solve this problem to some extent.
need your opinion on this.
I saw the same concept planned and illustrated in a book that was part of my 5th grade curriculum.
It doesn’t work for all the reasons mentioned before: people coming together, kids, pets, people not going out totally etc.
Tried it personally.
The best way to do it? I really don’t know, motion sensors fail if you sit still. Probably one of those occupancy sensors.
Hey, do not judge that we cannot do. I have programmed it to eliminate those common errors. I have tested it with a 1 meter width gap(door) today. It works pretty fine (except that it is draining my batteries a lot). You will be convinced that it works only after seeing what I have done in the code.
Sorry to be blunt, but _how_?
We’re technical people, there’s really no need to spare the details. Saying that you’ve accounted for the problem in the code really doesn’t tell us anything.
True, people counting is not an easy task.
As an alternative to my whistle controlled light (http://befinitiv.wordpress.com/2012/04/01/control-your-home-devices-by-whistling/ ) I modded the blueproximity program (http://sourceforge.net/projects/blueproximity/ ) to switch on my light if my cell phone is in range. The program is a simple python script which monitors the RSSI of bluetooth. It worked quite well.
Can you explain how the code works?
Also, provide more details as to how far the sensors are from eachother and at what height.
I know someone who has done a lot of work trying to make this work. The problem is that you cannot use just 2 sensors for all cases. There are multiple cases that will generate the same senzor output sequence. There are things that will distract you like how a person holds the hands, if there is something carried, if two people enter, if they hold eachother etc.
The real problem is that all this generates a cummulative error so once that appears things go bad until you have an opposite error.
Yes, it needs improvement. As you have said, errors may occur using this circuit as it is.
I will soon write a post on my blog and link it here explaining the arrangement and the sequence followed.
Thank you.
Consider substituting a pair of PIR sensors; 1 for the entry way, and 1 for the room.
That way you know IF somone walked in or out, and IF someone is still in the room.
They have excellent range and sensitivity.
really awesome taught…..very good job….congrats….wonderful
I have been thinking for long about implementing this kind of sensor for my bedroom.
I think it should work well for my own convenience, but would likely fail if I wanted to brag to someone else, since I would place the sensor at the height of my head to best avoid miscounts.
It’s improveable though, maybe by using more sensors at different heights, pir sensors, a real time clock for day/nicht profiles etc.
Hi Everybody.
I made this circuit. I have gone through all the comments. I will answer all of them soon. People have listed some problems which i have already solved and some others which I never thought of. Thank you for your interest in this circuit.
I will soon write a post on my blog (www.deekshith.in) explaining it more clearly and provide the link here.
Thank you all and Hack-A-Day
no need to count the number of blind people going in the room
This is a very, very old principle. :) When I was a child, I saw this kind of a light switch in some ancient book (yes, an ancient book made of paper :) ) which I got from local library. Of course, there was an old-school circuit made of discrete elements (it seems that there was no even logic ICs, but I can’t remember exactly now) and relays.
Just a note for anyone wanting the documentation/code/schematic, he charges $19 for only the code + schematic, and $38 for everything (documentation, build instructions, etc).
Ha ha, Not any more. I am going to release it on my blog for free soon (possibly in a week or two). Yes, I have asked for money as I have spent on it. But, I got the money I’ve spent on it from a team of students (Ajay, Victor and Vidhyarthy) who took training from me for making it as their college project. I can now make it open-source whole heartedly.
Making it open-source will not only benefit others but also the project as many people are expected to contribute to it.
I need your feedback on this.
Thank you for you all.
Hey..It’s a simple counter, and it will should not work in a real room, where ambient light is a consideration. Moreover, what have you accounted in the code, you can only use the value that your sensors give and sensors will give you a high when two people are entering together. I doubt colleges accept such hacks as projects in India. It’s a 2 – 3hrs job for an EECS student.
I bought this circuit from Deekshith and it works fine upto a separation of 2 meters even in sun light. I too thought this is a simple ciruit at first glance but first thing to be noticed is that it detects direction. Not only that, it uses a data pattern for sensors not just continuous light making it immune to ambient light. It has accounted almost all kinds of errors possible during its operation. Although the error due to multiple persons entering at a time is not completely solved, there is also a solution given to reduce it. I hardly get any errors practically installed to a door. Unlike the prototype shown the version I got has a two sets of sensors placed up and down (probably for improved accuracy). Although the code is too large than expected, I am quite happy with this after experimenting with many similar circuits.
can you please send me the true circuit diagram of automatic room light control please …….
the circuit diagram please send me my email address
How to buy the circuit?
I saw production version of similar device – it does have override switches in case if sensor misses one person:
http://eledo.pl/images/WIDGEKIT/Galeria1/IMG_1718.jpg
I have come up with a similar solution myself, but havent spent any time building it, because i can see all these ways it can go wrong, and my own rule about tinkering is that it should slove my problems.\
Unfortunately, in this case, in my locative situation, i can see this very qucikly turning into a problem itself, so its just shifting the problem of keeping the lights off into the problem of maintaing the proper people count.
HOWEVER, I did spend some time thinking about it, and i think the correct care-free solution would probably be some sort of fusion of different sensors: PIR, doorcounters, video….
Accurracy might be improved if counting legs and dividing by 2… in most cases. How about wheelchairs?