Project:Spacensus: Difference between revisions
(→Code) |
No edit summary |
||
Line 16: | Line 16: | ||
I have located two Laser Diode Retroreflective Sensors in our stores which I intend to use to monitor space occupancy by having the beams cross the main doorway. The beams will be staggered so that direction (arriving, leaving) can be determined by the order in which the beams are broken. I was thinking of mounting them at waist height. | I have located two Laser Diode Retroreflective Sensors in our stores which I intend to use to monitor space occupancy by having the beams cross the main doorway. The beams will be staggered so that direction (arriving, leaving) can be determined by the order in which the beams are broken. I was thinking of mounting them at waist height. | ||
==Location== | ==Location== | ||
Line 53: | Line 45: | ||
==What next== | ==What next== | ||
Spacensus still miscounts - especially when the door is opened for an incoming guest. I am aware of a few issues in the code where detection could be improved so will try a couple of modifications and see how it goes. | Spacensus still miscounts - especially when the door is opened for an incoming guest. I am aware of a few issues in the code where detection could be improved so will try a couple of modifications and see how it goes. | ||
==FAQ== | |||
Q: This will probably get caught out by clusters of people: --[[81.105.17.61]] | |||
A: | |||
* We only need an approximate count | |||
* The doorway is narrow so it's unlikely that the steps of more than one individual will overlap. | |||
* Most of the time people won't arrive in clusters | |||
Q: Can we detect some other event such as the door opening after a prolonged lights-out period to force the count to zero? --[[81.105.17.61]] | |||
A: | |||
* Yes, using the door/lights data for reset would be good if we get large amounts of drift - but I don't plan to just yet | |||
* This might fail if people spend the night there. AIUI this happens rarely enough that we may not care about the inaccuracy. | |||
* We could also use some kind of probabilistic model with the 'door-open' and 'bell' data |
Revision as of 13:46, 31 March 2011
Spacensus
| |
---|---|
Members | Elliot |
QR code |
Part of the London Hackspace graphs and visualisations project.
Status
Recent modifications:
- Milled new bracket for sensors.
- Graphical display with graph showing the days occupancy
- Detection code now completely interrupt driven
- Beams are now polarized
- Beams are now very close together
- Temporary prism reflector being used (permanent replacement on order)
Overview
I have located two Laser Diode Retroreflective Sensors in our stores which I intend to use to monitor space occupancy by having the beams cross the main doorway. The beams will be staggered so that direction (arriving, leaving) can be determined by the order in which the beams are broken. I was thinking of mounting them at waist height.
Location
The current mounting location has the lasers In close proximity in the middle of the entrance way. To avoid issues with occlusion of beams by coats etc, the coat hooks have been moved to the next wall along, with the lab coats. This arrangement greatly simplifies the detection of the true direction of someone entering/leaving the space. Detection works reasonably well.
The occupancy level is charted on cacti. The python script that provides the data to cacti implements only the 'poll for status' command, but will later allow more control and configuration of the counting sensors.
Powering off
- Remove the USB cable from the side of the unit.
- Remove the 12VDC jack from the side of the unit.
- Check the beams are no longer emitted and that no sensor indicators are illuminated.
Safety signs
Sensors
These sensors appear to be in working order. They'd should be safe to use below child-head height. They were manufactured in 1996 and use a Class II laser rated at 3mW (peak), 2kHz 2% duty cycle, with a wavelength of 655-670nm (datasheet). The model number is: Q45BB6LL
A good signal can be obtained at 1.5m by using a reflector made of aluminium tape.
Code
The code is available on GitHub - please be kind it's my first Arduino project and I know the code is filth.
The detection aspects of spacensus use an interrupt driven state machine. Anything that isn't time critical stuff happens in a run-loop.
What next
Spacensus still miscounts - especially when the door is opened for an incoming guest. I am aware of a few issues in the code where detection could be improved so will try a couple of modifications and see how it goes.
FAQ
Q: This will probably get caught out by clusters of people: --81.105.17.61
A:
- We only need an approximate count
- The doorway is narrow so it's unlikely that the steps of more than one individual will overlap.
- Most of the time people won't arrive in clusters
Q: Can we detect some other event such as the door opening after a prolonged lights-out period to force the count to zero? --81.105.17.61
A:
- Yes, using the door/lights data for reset would be good if we get large amounts of drift - but I don't plan to just yet
- This might fail if people spend the night there. AIUI this happens rarely enough that we may not care about the inaccuracy.
- We could also use some kind of probabilistic model with the 'door-open' and 'bell' data