3
\$\begingroup\$

I've ordered XBee wireless transceiver and PIR (motion, here is link) sensor.

When I enable DIO0 digital input port on XBee with "ATD0 3" command it becomes high. I measure it with volmeter and get value of 3.3v. Same with PIR sensor, when motion is detected, output pin becomes high with same 3.3v, but when it becomes low it does not pull to the ground. How is it possible to get movement alert in such scheme?

Because when movement is detected, 3.3v on both sides gives nothing, same for state of rest, when 3.3v on XBee pin and ±0v (but not ground) on PIR sensor output pin could not be detected in Xbee.

On my Arduino I had no problems with that with simply plugging PIR output pin to Digital input port.

I'm a newbie in electronics, excuse me for such dumb question and my mistakes =)

Thanks!

\$\endgroup\$
2
\$\begingroup\$

You need an external pull-down resister.

It sounds like your sensor can only source current, it can't sink current. The sensor can't pull it low on its own, so need a pull-down resister to do that when the sensor isn't driving the pin. Many microcontrollers have internal pull-ups or pull-downs on their inputs. Unfortunately, assuming your XBee follows this datasheet, the XBee does not have an internal pull-up. In that case you'll need an external resister to act as a pull-down for you. If you include more details on how you are wiring this up, someone may have a suggestion for how to put a pull-down in place.

\$\endgroup\$
3
\$\begingroup\$

Like the Ben Gartner said, you'll need a pull-down resistor that will drain out any floating electrons in the wire.

To do this is very simple, you need a 4.7k resistor, attach it to the input line and attach it to the ground line. This resistor will "pull-down" or drain the electrons to ground. If this is not done then there can be a "floating voltage" as the electrons have no where else to go. This causes a problem when you try to read the line, the floating electrons will dump into the input pin and will mistakenly register the pin as being on.

Just for information, a "pull-up" or "pull-down" describes how a resistor is used and not what it is. So a 4.7k "pull-up" resistor is actually the same as 4.7k "pull-down" resistor but the difference is that "pull-down" resistor is attached to ground and "pull-up" resistor is attached to a live wire.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.