Address

Author Topic: Occupancy Detection System for Lab  (Read 2680 times)

PockyBum522

  • Pocky
  • Sr. Member
  • ****
  • Posts: 440
  • Oh alcohol, I still drink to your health~
    • View Profile
Occupancy Detection System for Lab
« on: June 24, 2012, 04:21:07 PM »
So as of late, it has been a point of contention that the A/C has been left on too low and/or the warehouse lights left on (which are our main two power drains, afaik) after people are not in the lab any more.


I propose we remove that possibility, and I'm going to begin work on a system to detect occupancy that we can then hook up to the thermostat/lights/camera/famibot/whatever else we like.


To start off with, I'm just going to design and build a system that can tell if there are people present in any part of our space, and if so, what parts of the space are being occupied. After that system is done, we can move on to hooking it up to control things.


I want something with logic level output, that will just set +5v high on individual pins, with outputs corresponding to (and I may add/remove these later):


Front of Warehouse (Near bay door and laser)
Back of Warehouse (Work tables, power tools and such)
Back (By 3D Printers)
And Back (By soldering bench)
Kitchenette
Area connecting brake room, admin closet, and classroom
Classroom
Admin Closet
Break room


(maybe) outside the bay door/front door area.


Each area will run a pin high when people are present, I'll make the system easy to add more sensors later, if needed, and I'd like it to be able to tell there are people present even if they're sitting still.


Suggestions? Chorca has graciously offered a PIR sensor to play with, and depending on how I like the results of testing with that one, I'll either order enough of them for the areas I want, or find ones that suit our needs better and order them.

Hybridsix

  • Administrator
  • Sr. Member
  • *****
  • Posts: 447
    • View Profile
Re: Occupancy Detection System for Lab
« Reply #1 on: June 24, 2012, 04:22:21 PM »
You might attempt to use off the shelf security motion/occupancy sensors. I'd bet they're pretty easy to find.

f00bard

  • FamiLAB Member
  • Newbie
  • *
  • Posts: 0
  • Da Real MVP
    • View Profile
Re: Occupancy Detection System for Lab
« Reply #2 on: June 24, 2012, 10:46:42 PM »
This is more a group project than an RFC.  I don't think anyone would be opposed to something to do what you're describing.

PockyBum522

  • Pocky
  • Sr. Member
  • ****
  • Posts: 440
  • Oh alcohol, I still drink to your health~
    • View Profile
Re: Occupancy Detection System for Lab
« Reply #3 on: June 25, 2012, 02:03:16 AM »
Okay, awesome. Can someone move it over there and we'll continue the discussion? Thanks.

digitalman2112

  • Lab Dad (ex-treasurer)
  • FamiLAB Member
  • Hero Member
  • *
  • Posts: 1096
  • Work Hard, Play Hard!
    • View Profile
    • Raising Geeks
Re: Occupancy Detection System for Lab
« Reply #4 on: June 25, 2012, 06:49:26 AM »
Okay, awesome. Can someone move it over there and we'll continue the discussion? Thanks.

Done.

Also, there is some existing logic with the PTZ camera (light level?) that is used to detect occupancy today and set the flag for the website.  IIRC, tetsu and abyss know about how that works - perhaps it could be another input in this system.


ThantiK

  • FamiLAB Member
  • Full Member
  • *
  • Posts: 237
  • Resident 3D printer guru.
    • View Profile
Re: Occupancy Detection System for Lab
« Reply #5 on: June 25, 2012, 09:58:03 AM »
Yeah, it's based on light level.  Unfortunately cope mucked up my python script and it triggers mid-day now as well. :/

AtomicProf

  • FamiLAB Member
  • Sr. Member
  • *
  • Posts: 359
    • View Profile
Re: Occupancy Detection System for Lab
« Reply #6 on: June 25, 2012, 12:32:37 PM »
Alternate approach..


The proposed method is to detect that people have left the lab and then turn the light off or the AC up to a higher temperature.  What would be a perfect system like this?


Lets Just consider the lights first.
  • It should NEVER turn the light off when somebody is in the lab working.
  • It should "know" if the last person is leaving for good, or only stepping out for a minute
  • It should ALWAYS turn the lights off when no one is in the lab and they aren't coming back.
So -- If the system can tell know one is in the lab -- It could turn the light off after say 2 minutes.  The 2 minute delay allows for it to correct it's state of "No one in the Lab" to "Somebody present" if it made a mistake and also, nearly illuminates the need to know the intentions of the last person leaving.


Trivial design issues -- turning the power off, having a delay timer,
Intricate design issues -- detecting if somebody is in the lab.


An alternate approach would be to automatically turn the lights off every 30 minutes, unless the "Turn off" was cancelled, then the 30 minute timer would be reset.
  • System doesn't need to make any "decisions" about the environment.
  • System consists of trivial components - Timer, turning power off, reset
Also, it has the added benefit of passively training lab members to pay attention to the lights, and indirectly all of the other power consumption in the lab.


At first look this may seem a hassle to be in the lab, and have to reset the light at least once every 30 minutes.


But this approach has several benefits.
  • Can be implemented rather quickly
  • Can be expanded for "hacker" purposes in all sorts of ways.
  • Initial reset could be a push button next to the light switch
  • A timer count down clock could be made to show "Time to lights Out" in the lab
  • A flashing light could light up the lab as the "Time to lights Out" comes near
  • The reset could be upgraded from a push button to an internet reset.
  • The internet reset could be triggered from a familab iPhone app.
  • The reset could be triggered from the "Lab Occupied" state from the previous approach.  Instead of using the "motion detectors" to turn the lights off, we use them to keep the light on.



There is Quality in the Details
That is All

darkmoonsinger

  • Treasurer
  • Administrator
  • Hero Member
  • *****
  • Posts: 741
  • I am no one but all that I am.
    • View Profile
Re: Occupancy Detection System for Lab
« Reply #7 on: June 25, 2012, 12:46:14 PM »
As someone who gets very into what they're working on when they're working, I'd be afraid of having an automatic lights reset in the bay-- if someone's working with power tools and misses the notification of time-almost-up, there could be potential for a hazard (running equipment, dark bay).  Just my two cents.

PockyBum522

  • Pocky
  • Sr. Member
  • ****
  • Posts: 440
  • Oh alcohol, I still drink to your health~
    • View Profile
Re: Occupancy Detection System for Lab
« Reply #8 on: June 25, 2012, 04:55:24 PM »
@AtomicProf I was actually considering a combination of the two. If someone leaves without flipping the switch, give them half an hour, then beep for five minutes (loudly) and then shut off if nobody comes back in and or hits the reset switch. We'll worry about that later, though. For now I just want an occupancy detection system.

willasaywhat

  • Administrator
  • Hero Member
  • *****
  • Posts: 987
    • View Profile
Re: Occupancy Detection System for Lab
« Reply #9 on: June 29, 2012, 01:18:22 PM »
Tetsu and I wrote the original Python script that detected faces using the ptzcam. Thantik then fixed it when we moved. That system was very flawed, but did provide rudimentary, inaccurate occupancy detection. I'd definitely be interested in helping where I can with this both on the RFID and cam side.

DScott

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Occupancy Detection System for Lab
« Reply #10 on: July 19, 2012, 03:05:59 PM »
IMO best bet would be a system of Kinects of you have the funds and can find a good bulk deal. I don't think the PIR will handle the larger areas unless you make an array of 3 or 4. Of course they are cheap so you could put 5 in each of the larger areas if needed.
 
Sounds like a fun project, I was thinking of something like that here at home since my daughter and her 2 boys moved in and have a problem turning off lights when they leave a room. I'm not a member but wouldn't mind helping out. Unfortunately I'm free just about ALL the time. :-)
 

PockyBum522

  • Pocky
  • Sr. Member
  • ****
  • Posts: 440
  • Oh alcohol, I still drink to your health~
    • View Profile
Re: Occupancy Detection System for Lab
« Reply #11 on: August 01, 2012, 07:17:49 PM »
I was intending to make an array of several - Once I find a weekend I'll test the PIR I was graciously loaned and see what range etc is like. I'd love to mount a bunch up high and be able to give positions for people(s).

Chorca

  • FamiLAB Member
  • Sr. Member
  • *
  • Posts: 272
  • My primary function is failure.
    • View Profile
    • Flickr
Re: Occupancy Detection System for Lab
« Reply #12 on: August 02, 2012, 11:02:08 AM »
I wonder if you could use a set of a few on each sensor 'array' and use that to get a rough estimate of where the motion is at by triangulating..

f00bard

  • FamiLAB Member
  • Newbie
  • *
  • Posts: 0
  • Da Real MVP
    • View Profile
Re: Occupancy Detection System for Lab
« Reply #13 on: August 02, 2012, 09:14:05 PM »
If you search the Chinese sites (DealExtreme, AliExpress), there are a bunch of cheap PIR modules: http://www.aliexpress.com/product-fm/596141170-5PCS-HC-SR501-Adjust-IR-Pyroelectric-Infrared-PIR-Motion-Sensor-Detector-Module-wholesalers.html