Using wired PIR sensors.

626 views
Skip to first unread message

Jay Gordon

unread,
Aug 30, 2014, 7:36:48 PM8/30/14
to ope...@googlegroups.com
What would be the best way of interfacing low cost wired PIR sensors to OH?  I would like to use the wired PIR sensors meant for alarm systems as they seem much cheaper and more reliable than a zwave motion sensor.  I am running OH on a windows box.

Dennis van Velzen

unread,
Aug 31, 2014, 4:33:42 PM8/31/14
to ope...@googlegroups.com
You could use a arduino or pic micro board with opto couplers.

I used an pic micro development board before that would trigger another board that sent a SMS message to a mobile phone.

The pic micro dev board had 7 pir sensors and one key switch connected.

With some simple logic programmed on the pic.

Key switch false, alarm off.
Key switch true, count down timer 30s, activate.
On PIR detection. You have 30s to put the key switch to true otherwise alarm trigger (send SMS message).

Add pull down resistors to the PIRs and you could use the sabotage contacts together in serie.

Off course any uC with some GPIOS together with opto couplers can be used.

Regards, Dennis

Mat Smith

unread,
Aug 31, 2014, 9:06:38 PM8/31/14
to ope...@googlegroups.com
I bought a load of these PIRs. 5 units for £3.50!


Add it to an Arduino Nano clone for £2, a network shield for £3.50 and a network cable back to your switch, and you can implement MQTT right into OpenHAB!

I've already done this to test and it works a dream. Audio follows me around the house...

In fact I have also purchased some ambient light sensors and temp/humidity sensors and I plan to combine these into the same tiny housing that is mounted into the ceiling void, flush mount.

I'm still searching for the ultimate PIR housing, but picked up a very cheap £4 one from China on Ebay to test. The kind that clips into the ceiling.

Dennis van Velzen

unread,
Sep 1, 2014, 6:09:23 PM9/1/14
to ope...@googlegroups.com
Hi Mat,

Where did you get the network modules? Is this the microchip ENC28J60? Are the Arduinos running stable for some time already? Are you using interupts, watchdog, ... Any taughts on sharing the arduino MQTT code?
I found some nice PIR enclosures including a sensor which may have some space left to fit an arduino pro and an network module. For approx 10 usd each.

Link to the mobile version because I am currently browsing on my mobile phone.

http://m.alibaba.com/product/815180789/Wired_Microwave_Passive_Infrared_Sensor.html

What is the curent (idle) of the arduino pro, network module and pir sensor?

Regards, Dennis

nwe...@gmail.com

unread,
Sep 2, 2014, 12:14:36 AM9/2/14
to ope...@googlegroups.com
Just out of interest, I use 1wire to each PIR. Running power, rs485 and 1wire on a single cat5 cable. Loop the cable from pir to pir to light to relay etc.
Neil.

Greg

unread,
Sep 2, 2014, 9:43:57 AM9/2/14
to ope...@googlegroups.com
That's interesting.  What do you use to interface the PIR with 1wire?  I was thinking of doing this using a ds2413.

Nicolas Karp

unread,
Sep 3, 2014, 2:21:13 AM9/3/14
to ope...@googlegroups.com
Hi,

I'm also interristing in using a PIR wired with a raspberry or arduino. The problem is that i'm not able to find any standard PIR (with a case) with a dry switch. I'm able to find some PIR like this one : IS215T but the alarm relay output is 24V, so i can't really connect the PIR directly to the GPIO. I need to use a octo coupler.. The parallax is working but it's not very WAF and i'm not able to find a good case.

Do you have any idea ?

Thanks.

Best Regards,

Nicolas.

Dennis van Velzen

unread,
Sep 3, 2014, 7:10:38 AM9/3/14
to ope...@googlegroups.com
Normal pir alarm sensors have a C and NC contact. Just supply them 12V power and 12V to the common and measure the NC... If the voltage drops or in other words the loop breaks the pir detected something. Better would we a small resistor to ground, to avoid line noise problems.

Some pir sensors also have more intelligent features. Check the included docs. But the basics as far as I know should be very straight forward...

With an optocoupler this detection can be translated from 12V to low voltage logic. Off course you could also measure the resistance...

nwe...@gmail.com

unread,
Sep 3, 2014, 7:53:29 AM9/3/14
to ope...@googlegroups.com
Hi
I use the DS2406 (3pin TO92 package) and feed the relay in the pir directly into the input. The DS2406 is mounted on a small pcb inside the pir housing. You could do the same with the ic you are referring to. A piece of cake.
I also use the DS2406P (dual I/O) using one io as the input from the pir and the other io as the output to drive a relay and switch the light.
This has been working on numerous rooms for over 10 years.
Neil.
Message has been deleted
Message has been deleted

Mat Smith

unread,
Sep 3, 2014, 8:35:34 AM9/3/14
to ope...@googlegroups.com
Interesting to hear how others do this!

I'm about to wire up my house from scratch (big refurb project) and
plan to connect PIRs and other sensors dto central arduinos irectly
over CAT5, using 5v IC connections.

Crazy I know, but I've tested it and it works a treat over 20m which
is the longest run.

Even the temp / humidity sensors which send digital signals over IC
work over this length!

So no need to separately power the sensors...

Question for you all. Where can I find a PIR sensor housing for the
ceiling? One that has the Fresnel lens but without any sensor so I can
put my own in?
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "openhab" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/openhab/_bAk82k1Vdc/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> openhab+u...@googlegroups.com.
> To post to this group, send email to ope...@googlegroups.com.
> Visit this group at http://groups.google.com/group/openhab.
> For more options, visit https://groups.google.com/d/optout.
>

Greg

unread,
Sep 3, 2014, 12:05:57 PM9/3/14
to ope...@googlegroups.com
Thanks.
Currently I've got all my PIRs wired in series all with different voltage dividers across the tamper and alarm circuits feeding to an analog input on an arduino so I can isolate which PIR is being triggered, then publishing to mqtt.  1-wire would simplify it all, and that TO92 is sure easier to deal with that a TSOC package!

nwe...@gmail.com

unread,
Sep 3, 2014, 5:41:05 PM9/3/14
to ope...@googlegroups.com
Greg
I made these at home over ten years ago.
http://www.nwe.net.au/JustForFun_1Wire.html
Neil.
Reply all
Reply to author
Forward
0 new messages