memons wrote:@techpaul:
Thank you very much.
I am able to get Pi triggered when I connect PIR sensor directly with RPi. Thanks for the info.
But if i want to connect PIR using external battery. How can make it to trigger RPi. Should I connect PIR's ground with pi's ground and Power line with battery? I dont want to fry my Pi.
And yes I have made sure that PIR's output is 3.3 volts.
Thanks
If using a 9V battery to power the PIR, then the output from the PIR can go to any voltage up to 9V.
When you did the voltage test with the PIR
not connected to the PI,what did you meausre across the resistor?
I suspect it was about 9V. So you would need to put a
resistor divider on the PIR output to reduce the voltage output so the PIR output pin was at its nearly 9V connected to the top of the divider and the middle of the resistor divider is taken to the Pi with around 3V level and the bottom end of the
resistor divider taken to gnd (of battery
and PI).
As batteries drain down over timethe output level will drop and the divided output wil drop in the same ratio. So choosing the two resistor values will take some calclulations. Based on max battery level of new battery and minimum battery level you want to go down to. Then you have to find the right ratio to keep the divided voltage within the range acceptable for the Pi to recognoise the voltage within its limits.
As the device can work down to 2.7V it can work on a very dead battery, well below the normal dead battery voltage that most devices can work with. To work anything out you need to measure and define
1/ What battery voltage level range to use (bearing in mind a 9V battery new can be 10V)
2/ What voltages do you get out of the PIR with 9V battery currently not connected to Pi
3/ Length of cable between PIR and Pi
4/ What resistor values and types you have access to
5/ could you use a very low current 3V3 regulator from your battery to power the PIR
Personally for this type of application I would resitor divide the PIR output by 3 or 4, then feed it into an op-amp in voltage comparator mode to provide around 3V output all the time, so it can work on almost any battery level range. Also I would do something similar to monitor battery level so when a resistor divided voltage from the 9V battery went well below a threshold level the Pi on another GPIO could detect a battery low condition.
Just another techie on the net - For GPIO boards see http:///www.facebook.com/pcservicesreading
or http://www.pcserviceselectronics.co.uk/pi/