I am busy toying with some PIR sensors to detect movement etc for a nightlight for my kids. One of the sensors I ordered is the PYM-1 PIR sensor.

The data sheet states the following:

  • Operating Voltage: 4,5~5V.
  • Standby current: 65 micro-amps (65uA)
  • Operating Current: 40mA (40 milli-amps)

The limit for current on the arduino pins is 40mA. According to documentation at the arduino site 40mA is the upper limit per pin and the site clearly states: Absolute Maximum Ratings - the point where damage will start to happen I would rather avoid sinking the current directly on the Arduino.

So my question is will sinking 40mA on a pin cause damage? I have not been visited by the blue smoke genie yet and would rather avoid it at this point.

I suspect it might be safer to run this via a transistor and external power than directly on the arduino?

2 Answers 2


This is completely acceptable for your intended purpose.

By itself it will act as a light on/off trigger as others have noted.
An Arduino could be added if you wish to add extra features when the PIR is triggered. In it's most basic light-switching form using an Arduino is overkill.

By itself it will act as a light on/off trigger as others have noted.
An Arduino could be added if you wish to add extra features when the PIR is triggered. In it's most basic light-switching form adding an Arduino is overkill.

When it comes to playing overkill can be good :-)

To use it to provide input to an Arduino and NOT to a mains level light:

NB relay contacts may only be connected to mains for light switching OR to the Arduino. NEVER to both at the same time.

Connect it's DC supply input to your Arduino (or other) power supply.
As long as the supply can provide 40 mA when needed it will work OK.
40 mA is a power supply rating This is unrelated to the Arduino pin loading.

Connect the output to an Arduino digital pin configured as an input.

enter image description here

The output is a relay, activated when an object is sensed.
When inactive the centre pin is probably connected to the right pin - Check with Ohm meter.

When activated the left pin in connected to the centre pin (see their diagram)

Connect ground to right pin.
Connect Arduino digital input to centre pin. Connect a "high" level to left hand pin.
OR as Majenko suggests, just set the pin to have pullups enabled.

If connecting to V+ as shown then V+ can be Vcc (=5V for a 5V Arduino, 3v3 for a 3V3 Arduino) DO NOT set V+ to higher than Arduino's Vcc. You can connect a say 1k to 10k resistor from V+ to the voltage source bur still do not set V+ above Vcc.
OK - just have pullups enabled:-)

eg (untested)

int ADCMode = 0;
int PIRPin = 6; // PIR connected to digital pin 6
void setup()
pinMode(PIRPin, INPUT_PULLUP); // set PIRpin as input with pullup
void loop()
ADCMode = digitalRead(PIRpin); // $Read PIR status

When the circuit activates digitalRead() will return a high.
When the circuit is not activated digitalRead() will return a low.

See here re Arduino pin modes

  • Thanks for the information but could you clarify the following: DO NOT set V+ to higher than Arduino's Vcc. The sensor has no adjustable setting except for distance and time which are both related to the functioning of the IR motion detection. Do you mean when using an external power source do NOT go over the VCC of the arduino?
    – Namphibian
    Jun 9, 2015 at 9:51
  • That is not a good way to wire the relay to the Arduino. Forget the V+ connection and just wire the middle terminal to the Arduino's IO pin and the Ground terminal to the Arduino. Enable the internal pullup resistor on that IO pin of the Arduino. Connect the Arduino's 5V and GND pins to the power (red and black wires respectively) pins of the board. Wiring the relay like that will result in a dead zone between switching HIGH and LOW where the input is floating, which is not nice. The bounce effect would be 1,000,000,000x worse that way.
    – Majenko
    Jun 9, 2015 at 10:29
  • @Majenko For some values of "not" :-) / And but, or add a resistor externally or polish its doorknobs etc. My main aim was to try to provide a clearly understandable counter to the statements that the module was not suitable. Descent into pullups etc may be good if needed but may drive OP back into "it doesn't work" camp. | Aside: I wonder if the leakage current of an O/C input pin driving input capacitance of IC + PCB + ... has a time constant < to << the relay changeover time as you imply. It may BUT I (strongly) suspect that if bounce is an issue in the application then Jun 9, 2015 at 11:23
  • @Majenko formal debouncing is likely to be needed. Which is simple indeed in this application. All this I know you know. . Jun 9, 2015 at 11:24
  • @RussellMcMahon That is all very well, but you have to remember - these are Arduino users. They a) have very little knowledge, and b) what they do know is generally wrong thanks to Arduino teaching them the wrong things. It is my quest to undo that bad teaching, and getting them away from switching like this is one of those steps.
    – Majenko
    Jun 9, 2015 at 11:37

When I look at the PYM-1 seen here:


I don't see any need for an external microprocessor such as an Arduino. It seems that one just applies 5V as input and it switches on/off up to 300W of power. Where would one use an Arduino GPIO?

  • I would like to use the sensor with other sensors so when there is movement and sound for example. I do understand that this unit is probably more than I need however it does have the photoresistor which will allow me to trigger at certain light levels i.e. when it is dark when it lighter etc. This is part of a larger system in other words.
    – Namphibian
    Jun 9, 2015 at 2:59
  • I get the impression that this module is a stand-alone device ... a PIR that detects movement and closes a circuit ... and that's it. If you want to build a circuit that can detect movement, sound, light level changes etc etc ... you probably don't want to start with the PYM-1 but instead get parts such as an HC-SR501 and use THAT with the Arduino.
    – Kolban
    Jun 9, 2015 at 3:03
  • Also starting to get that impression. Love how they mark things as Arduino on the site though. I have another one the HC-SR501 as well. Ordered two just in case the one is wrong. I will power the PYM-1 separately and play with it a bit more. I could probably just use it to close the circuit on one of the arduino pins and thus sending a signal.
    – Namphibian
    Jun 9, 2015 at 3:09
  • I understand ... I too have bought parts before understanding what they were ... and its a lesson I learned well. Now I study parts before purchase (unless they are so cheap it is unimportant). I imagine I have it in front of me and set myself the puzzle of "how would I wire it?". I then use Fritzing to build a circuit and if all still holds in theory, then I purchase.
    – Kolban
    Jun 9, 2015 at 3:37
  • Indeed I normally do that however this one was on special on DX.com and tried as I may I could not get a manual. Today I did get a manual however it is some of the worst english I have read. Might as well be no manual as it not worth the paper it is written on. I do however have another use for this sensor.... scary halloween puppet coming up.
    – Namphibian
    Jun 9, 2015 at 5:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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