Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Arduino body movement sensor does not work


  • Please log in to reply
5 replies to this topic

#1 tranceash

tranceash

    Member

  • Members
  • PipPip
  • 12 posts

Posted 11 April 2012 - 11:58 AM

I am have a problem connecting this PIR body PIR Sensor to work.

I cant get it to detect any movement. There are 3 wires blue,white,orange. I have connected the blue to the ground pin, white wire to digitalIO pin 5 and yellow wire to the 5v pin on the netduino board.
Is this wiring correct ?

I have this code but the interrupt never fires. Has anyone played with this Arduino body movement sensor and got it to work

using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.Netduino;

namespace SensorTest
{
    public class Program
    {
       static OutputPort led = new OutputPort(Pins.ONBOARD_LED, false);

        static InterruptPort port = new InterruptPort(Pins.GPIO_PIN_D5, false, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeLow);
        
        public static void Main()
        {
            // write your code here
            Debug.Print("Application Start!");

            port.OnInterrupt += new NativeEventHandler(port_OnInterrupt);

            Thread.Sleep(Timeout.Infinite);


        }

        static void port_OnInterrupt(uint portId, uint state, DateTime time)
        {
            Debug.Print("Interrupt fired");

            led.Write(true);

            Thread.Sleep(1000);

            led.Write(false);

            Thread.Sleep(1000);

        }





    }
}


#2 JerseyTechGuy

JerseyTechGuy

    Advanced Member

  • Members
  • PipPipPip
  • 870 posts

Posted 11 April 2012 - 12:18 PM

Is there silk screening on the board indicating which wires are +5, GND and OUT? I haven't found any good pictures or wiring diagrams for this sensor.

#3 ErikN

ErikN

    Advanced Member

  • Members
  • PipPipPip
  • 119 posts
  • LocationNew York, NY

Posted 11 April 2012 - 02:05 PM

Looking at the third picture on a site that sells them, it looks to me like maybe the connector is set up as |- DET +| when the jumper pins are to the left and the connector is on the bottom of the board facing you.
http://www.geeetech....odule-p-70.html

But otherwise I too can't find any documentation about the module in my, admittedly short, search. At least this suggests there IS a silkscreen on the board. Unless my eyes are really that bad!

#4 ErikN

ErikN

    Advanced Member

  • Members
  • PipPipPip
  • 119 posts
  • LocationNew York, NY

Posted 11 April 2012 - 02:08 PM

Looking further at the board, the output goes high when it detects. Your InterruptPort looks like it might be configured for the opposite...

#5 Geancarlo2

Geancarlo2

    Advanced Member

  • Members
  • PipPipPip
  • 70 posts

Posted 11 April 2012 - 02:59 PM

First, I suggest you experiment polling the sensor. Second, it seems to me there is a threshold potentiometer, so you should try playing with that...

#6 Giuliano

Giuliano

    Advanced Member

  • Members
  • PipPipPip
  • 361 posts
  • LocationSimi Valley, CA

Posted 12 September 2012 - 05:59 AM

Hi Tranceash, Are you using a 10K Ohms resistor? Did you get it to work? If so, how?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.