Arduino + Motion Detector not working

I’m not having any luck trying to get my Sparkfun motion detector http://www.sparkfun.com/commerce/produc … ts_id=8630 to work an Arduino.

Here’s my circuit http://rappnet.dyndns.org:8080/img217.jpg

I’m doing a digitalRead on the Arduino pin but it’s jumping back and forth between 0 and 1, even when the motion detector is completely shielded from any possible motion. Any advice is appreciated. Thanks.

From the website:

The alarm pin (black) is an open collector meaning you will need a pull up resistor on the alarm pin. The open drain setup allows multiple motion sensors to be connected on a single input pin. If any of the motion sensors go off, the input pin will be pulled low.

I have no experience with Arduino, but something tells me that this is the problem:

If the pin isn’t connected to anything, digitalRead() can return either HIGH or LOW (and this can change randomly).

http://www.arduino.cc/en/Reference/DigitalRead

Clearly you’ve got the pin connected to something, but would you mind posting your code? Perhaps you haven’t set the DDRx properly? (not sure how Arduino manages DDR, but I can look it up)

Try disconnecting the motion sensor entirely and just having the 4.7k pullup on that pin — it should read constantly HIGH (1) then, of course. This should help you figure out whether the problem is with the sensor or the Arduino.

Another idea: are you reading the right pin?

Thanks for the suggestions. As it turns out, the motion detector does not work at 5V. I hooked it up to 9V and it works great.

As it turns out, the motion detector does not work at 5V. I hooked it up to 9V and it works great.

You might check what voltage is on the alarm pin so you don't destroy a pin on your arduino.