Motion sensor (PIR module)

Hi guys i have a discontinued GHI PIR module. Is there any code samples how to set it up and use within gadgeeter project? I am using netmf v4.3. Thank you.

@ Alex Bilityuk - Check this link:

https://www.ghielectronics.com/docs/299/discontinued-gadgeteer-module-drivers

for a link to the SDK for discontinued modules.

If you’re using plain NETMF (rather than Gadgeteer), you can check the source for the PIR module driver to see how its implemented…that link is also in the link above.

Thank you for the link.

Hi to all. Does anybody meet the problem adding a discontinued modules to netmf v4.3 gadgeeter project? I want to add PIR module, but it says that it is not usable in netmf v4.3… how to overcome this problem? (picture attached)

Hi GHI, do you have a solution for my question?

@ Alex Bilityuk - I might be able to help you if GHI doesn’t mind me building a 4.3 driver for this module. If its OK, I’ll build the driver but can you test it?

The other thing to note is its American Thanksgiving so the GHI guys might be enjoying some holidays this weekend.

1 Like

@ Duke Nukem and Alex Bilityuk - This module will be re-added to the next SDK as announced in the latest news post. If you want to use this module in 4.3 now, since the current releases do not contain a 4.3 driver for it, you need to follow https://www.ghielectronics.com/docs/122/gadgeteer-driver-modification You can find the 4.3 source we will be releasing in the next SDK here: https://bitbucket.org/ghi_elect/gadgeteer/src/6066e566343a8f9554464a4d30673c11849043d7/Modules/GHIElectronics/PIR/PIR_43/PIR_43.cs?at=master

2 Likes

@ Duke Nukem and @ John, thank you for reply. I builded a simple project based on the PIR module code wich John provided


  void ProgramStarted()
        {
            Debug.Print("Program started");         
            PIR_Module.MotionSensed+=PIR_Module_MotionSensed;
          
        }      

        void PIR_Module_MotionSensed(GTM.GHIElectronics.PIR sender, GTM.GHIElectronics.PIR.State state)
        {
            Debug.Print("motion detected");  
        }

I set up the module with default settings (picture attached) in socket (1) of my Cerbuino bee and run the code in debug. And what i have? i have continiously triggered event and every time i got “motion detected” in my output window.

Can you explaine guys how actualy i should detect a motion with this module? I what to trigger the event when it really detects the motion…

@ Alex Bilityuk - To be honest I’ve always found this module to be a tad frustrating, not because it doesn’t work, but because I never took the time to understand how it works (I’m really just a software guy so I live for instant hardware gratification, and ultimately why I love Gadgeteer as nothing delivers instant hardware gratification like Gadgeteer). So a little research into the matter and I found this which looks to be the base module:

http://www.electrodragon.com/product/pir/

given the module uses a LHI778 PIR chip and has ‘adjustments’. Those adjustments are for distance and delay and the jumper I believe is for ‘Repeatable’ / ‘Non-repeatable trigger/ delay mode’.

Information as to adjustments etc here:

http://www.electrodragon.com/w/index.php?title=HC-SR501_PIR_Motion_Sensor_(Passive_Infrared_Sensor)

@ John apparently GHI hasn’t quite grasped the concept of weekends, vacations or holidays yet :slight_smile:

Very useful linkes, thank you very much! Yesterday i tried to tune the pots in different ways, switch the trigger jumper and so on, but nothing heleped, motion event handler handle the event continiously and that is it. It seems like module doesnt feel the motion at all.
Maybe we should use another technics?? John did you give a try for this frustrating PIR?

@ Alex Bilityuk - We have always had a bunch of trouble like this with the module, which is partly why it was discontinued. We never were able to track down why this occurred on some modules.

John, Do you mean that my PIR module is broken? And there is no way to set it up? Was anybody able to make it work?

@ Alex Bilityuk - It sounds like it is. The behavior you describe is not expected. Most of the modules we have tested did work.

Can you provide a module pots settings and jumper position please?

@ Alex Bilityuk - The link Duke provided has a lot of information on it: http://www.electrodragon.com/w/index.php?title=HC-SR501_PIR_Motion_Sensor_(Passive_Infrared_Sensor) The settings discussed towards the middle of the page should work for you.

If you get the same behavior regardless of position, then it seems like your module is broken.

This tutorial didn’t help me…

@ Alex Bilityuk - If you get the same behavior as before, then it seems your module is broken.

Do you have in future plans to produce anything similar to PIR or maybe you can advice anything similar to buy?

@ Alex Bilityuk - We have no current plans to and, regretfully, I do not have anything to suggest.

There are a few options that might work for you:

not Gadgeteer, but since it’s really just pulling one signal pin low when it triggers, it should be pretty easy to use even without a full Gadgeteer implementation.

Seeed has a similar module:

http://www.seeedstudio.com/depot/PIR-Motion-sensor-module-p-74.html?cPath=25_31

This one from Adafruit is a little pricier:

Looks to be very similar to the Gadgeteer PIR, but without the socket, so you might be able to use a breakout module to wire it up and use the Gadgeteer PIR driver.

The other thing that might be worth trying is using a breakout module to power the PIR without a microcontroller, and measure the signal pin with either a multimeter or (if you have one) a scope.

That way, you can isolate the sensor itself from the driver.

1 Like