Mee_n_Mac:
There are multiple ways of going about this. Most PIR sensors I’ve seen have an open collector type output. So w/a pullup resistor they produce a low pulse of some sort upon detection. Others are low and go TTL high upon detection. I might use a 555 timer as an oscillator (astable mode) and feed that into a cheapie AM x-mitter. The 555 would be set for something btw the min and max baud rates (1200 - 4800 Hz) and 50% duty cycle. Thus the RF is 100% binary AM, a string of 0’s and 1’s for some period of time. The PIR is holding the 555 in reset until a detection occurs. Upon detection you get a burst that AM RF.
The receiver output goes into your MCU, an Arduino if you want. These cheapie AM receivers are noisy, producing all sorts of garbage at their output. Your code should reject that noise and only when it sees a bitstream of 010101…01 at about the expected rate, and for some long enough period of time, would it recognize that the PIR had detected something. Then it commands the servo to move. You’ve not said when the servo should move back or what happens if the PIR keeps detecting more people or just the one person moving about.
Thanks for providing these options. I want the servo turn 45 degree slowly when it received the signal, then (say after 5 seconds) turn back slowly to its initial position. If PIR kept to detect people motion, no matter one or more than one people, this servo will do this repeatly.
Mee_n_Mac:
You’ve also not said how you’re going to power these devices. That actually impacts what I’d choose for parts.
I am going to use battery to power these devices, which means I need two batteries for the two modules as they are not wired together.
Mee_n_Mac:
An alternate to using the cheapie AM pair would be to use an XBee. Then you could tie the PIR directly into the XBee And use it in it’s ‘virtual wire’ mode. The receiver would be another XBee. You loose the 555 and it’s circuitry, the cheapie AM pair but gain the more expensive XBees and their regulator board and likely a shield, which then dictates an Uno-like MCU.
the XBee draws more power when compared with RF module. Since the system is powered by battery, so....and another issue is it costs more than RF module does.
Mee_n_Mac:
Another alternate would be IR. You’ve not made it clear to me why, being 1.5m apart, the sensor part couldn’t ‘talk’ to the brains part via IR, like a TV remote. In this case the 555 is set to run at 38 kHz and 33% DC. It directly drives the IR LED, no X-mitter needed. The brains end substitutes an IR receiver module for the AM receiver but basically performs the same processing. Less $$s and trouble all around.
There is no direct line-of-signt between two modules, that's because I'm going to put Module 2 inside a small box. In this case, IR module cannot work for me.
Mee_n_Mac:
Last alternative is 1.5m of wire. Somehow power has to get to both parts. That’s either batteries to be replaced or some wallwart power source. If you have power wires running up the wall, why not wire the PIR directly to the MCU ? If you don’t like the look, bury the wires in the wall. Then again some people aren’t handy in that area.
if I can use wire, the project will be a lot easier, I guess. but sorry, no wire.
so, I am going to use cheap RF module. Here is my list for this project:
1). 2 x arduino boards (need you advice, I do want one of them is as small as possible for Module 2, which one should I buy)
2). 1 x cheap RF 315MHz module pair
3). 1 x PIR motion sensor
4). 1 x small servo motor
5). 2 x bread boards for testing
6). some jumper wires
7). 1 x multimeter
8). 2 x Li-on battery
Did I miss anything?
Thanks again for your input.