SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By riden
#72929
Take the Arduino out of the picture for the moment. Connect a 10k resistor between the black (alarm) and red (VCC) pins of the PIR module. Then take a voltmeter and connect the negative lead to the brown (GND) lead of the module and the positive lead to the black (alarm) pin. Connect +5 to the red pin and GND to the brown pin. Watch the meter as you move about. The sensor should detect your movement and the voltage output should change.
By arduino_beginner21
#72981
riden wrote:Take the Arduino out of the picture for the moment. Connect a 10k resistor between the black (alarm) and red (VCC) pins of the PIR module. Then take a voltmeter and connect the negative lead to the brown (GND) lead of the module and the positive lead to the black (alarm) pin. Connect +5 to the red pin and GND to the brown pin. Watch the meter as you move about. The sensor should detect your movement and the voltage output should change.
Hmm.. I have detected no change in voltage with my current layout. (Red to 5V, GND to GND and black lead, Alarm to 10K resistor and red lead). I have connected the 5V pin to many devices on my breadboard. Does this mean that the power can't get to my sensor?
By riden
#72990
Here are a few questions...

1) Is the Alarm pin removed from the Arduino board?

2) When you connect the voltmeter between Alarm and GND, what does it read?

3) Have you confirmed that the wiring matches the datasheet? Sometimes, boards aren't assembled the same. DO NOT try connecting the power in different ways, just confirm that your board is the same as the datasheet.
By kwknowles
#73286
arduino_beginner21 wrote: BLACK (Alarm) ====> 10K ohm resistor ===> Digital Pin 2
This is where your trouble is. It should be hooked up like this:

BLACK (Alarm) ===> Digital Pin 2 ===> 10K ohm ===> +5V

Read on if you're curious why it works this way.

The term "open collector" means it isn't hooked to anything; also called "floating". Neither the voltmeter nor the arduino can get an accurate reading on the voltage. So, the 10K ohm resister weakly connects the alarm and pin 2 to +5V. In the absence of any other connection, this "pulls" the floating voltage up to +5V thus the term "pull-up resistor". When the motion detector triggers, it directly connects the alarm (and pin 2) to ground. This direct connection overcomes the weak "pull-up" and pulls the voltage down to 0.

FWIW your ATmega328 probably has internal pull-up resistors that can be enabled somehow. Worth some research maybe, but for now hook it up the way I drew it above.

Hope that helps - Ken
By riden
#76875
You want the resistor and diode to be in series. The resistor connects to 5v and the cathode of the diode to the Black wire. You will want reduce the value of the resistor to around 470 ohms if you want the LED to be brighter.

Leave the 10k resistor connected to the anode of the diode, but don't connect anode and resistor to the Black wire. Remove the cathode from GND and connect it to the Black wire.
By zouze
#76896
riden wrote:You want the resistor and diode to be in series. The resistor connects to 5v and the cathode of the diode to the Black wire. You will want reduce the value of the resistor to around 470 ohms if you want the LED to be brighter.

Leave the 10k resistor connected to the anode of the diode, but don't connect anode and resistor to the Black wire. Remove the cathode from GND and connect it to the Black wire.
can you elaborate?
By riden
#76898
Does this make things any clearer?

Image
By riden
#76916
There isn't a whole lot that could go wrong here. Even wiring it up the way you indicated wouldn't harm the open collector output.

Things that might or will damage the board:

1) Connecting the power leads backwards

2) Connecting the Black open-collector output directly to 5v or 9v without a resistor.

If you are sure things are wired as described, have clean power, and didn't commit any of the above errors, you probably have a defective board.
By kwknowles
#76924
In riden's LED circuit, the +5 and +9 volt sources must share a common ground.

Also, this still won't work with the arduino or a volt meter unless you add the 10K pull-up resistor.

zouze's original LED circuit doesn't work because, even though you have +5V at the LED anode, you don't have nearly enough current to light the LED.

You could substitute 1K ohm for 10K resistor and use a single +9V source instead of separate +5 and +9V connections.