I've been able to figure out how the PIR sensor on the roomBoard V2 works, how you should hook it up and how you can configure it.
Hookup:
PIR + to 3.3V input which corresponds to the + on a JeeNode Port.
PIR - to the ground which corresponds to the g on a JeeNode Port.
PIR OUT to a digital or analog pin. I recommend using the D pin on a JeeNode.
In this hookup, the PIR OUT pin will be:
No motion detected: 0,51V - 0,54V.
Motion detected: 0,00V.
If you connect the PIR sensor to an Atmega and pull up the digital pin it is connected to, the voltage on the PIR OUT pin will be in the range of 1,4 - 1,80 V when no motion is detected.
Optionally, you can hookup a pull up resistor between the PIR + and PIR OUT to up the voltage a bit. In this case voltages on the PIR OUT pin will be:
No motion detected: 2,22V - 2,26V.
Motion detected: 0,00V.
Note: When you use this hookup, you're placing a 10k resistor in parallel with the 100k resistor that is already between the PIR + and PIR OUT on the PIR sensor itself! So you'll effectively create an ~ 9k pullup resistor.
Configuration
The jumper on the PIR sensor will switch between "re-trigger-mode" and "continuous-trigger-mode"
In continuous trigger mode, the PIR will keep the OUT pin low as long as it detects motion. So if you keep moving in front of the sensor all the time, the OUT pin will always be 0,0V.
In re-trigger-mode, the PIR will pull the OUT pin low for a configurable time and when this time interval is past, the OUT will become high again for a certain time interval. So if you keep moving in front of the PIR, the OUT pin will be 0,0V for some time, then it'll become high again, and then low again. So it keeps alternating.
If the jumper is in the I position (closest to the edge of the PIR PCB) the PIR is in continuous-trigger-mode. If the jumper is in the other position, the PIR is in re-trigger-mode.
The potentiometer (POT) on the PIR configures the time intervals it uses for it's output pin.
If you rotate the POT in counter clockwise direction as far as possible, the time interval will be shortest, which is about 2 seconds.
If you rotate the POT in clockwise direction, this time becomes a lot longer. In fact it became such a long interval that didn't have the patience to wait for it, when I turned it around for more than 50%.
So my recommendation for the POT is: "Keep it on the most Counter Clockwise position you can place it in."
Other Important Notes
* The PIR sensor takes quite a long time to start. This is probably because it's measuring background IR radiation (calibration). The time intervals you have to think about are about 20 to 90 seconds when the POT is in the most CCW position.
* The POT has not only an effect on the time intervals the PIR uses to keep its OUT low, but it also has an effect on the time the PIR needs to calibrate itself when it starts up! After some testing, it appears that the POT-controlled time interval is a few seconds in the most CCW position and about 1 minute in the most CW position, but I still can't give any hard guarantees on this.
* A good and working PIR sensor, with the jumper on I-position and the POT in the most CCW state, will work fine with a RoomNode sketch. If it doesn't, you've soldered it wrong or your PIR is broken (just like one of mine is).
* Always pull a digital pin on an Atmega with the PIR-OUT connected UP, because if you don't, you will not get any readings at all!
Wow, great work describing all this. I haven't soldered mine yet, but this will surely come in handy :-)
Thanks!
Very nice! Here you can find some extra background information:
http://www.ladyada.net/learn/sensors/pir.html
Terrific write up! - I've added a link to this on the Room Board page.
Let me also add that this open-collector / active-low type was chosen very deliberately, as this is IMO the lowest-power mode. As long as no motion is detected, there is only a very small leakage current (plus the power consumed by the PIR circuit itself, of course).
I've added a bit on the time intervals of the PIR. The pot seems to control the range of 2 seconds up to about 1 minute. But I'm still not 100% sure and have also tested this on only one unit....