Remarks

ParallaxPir
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Motion.ParallaxPir

The Parallax PIR detects motion via infrared. It emits a high signal over the data pin when motion is detected. The pin returns to a low state when motion stops.

Code Example

private ParallaxPir parallaxPir;

public override Task Initialize()
{
    Resolver.Log.Info("Initialize...");

    parallaxPir = new ParallaxPir(Device.CreateDigitalInterruptPort(Device.Pins.D05, InterruptMode.EdgeBoth, ResistorMode.Disabled));

    parallaxPir.OnMotionStart += (sender) => Resolver.Log.Info($"Motion start  {DateTime.Now}");
    parallaxPir.OnMotionEnd += (sender) => Resolver.Log.Info($"Motion end  {DateTime.Now}");

    return Task.CompletedTask;
}

Sample project(s) available on GitHub

Wiring Example

The Parallax PIR sensor requires only three connections, power, ground and motion detection signal:

Characteristic Locus
Inheritance object > ParallaxPir
Implements IDisposable
Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString()
Namespace Meadow.Foundation.Sensors.Motion
Assembly ParallaxPir.dll

Syntax

public class ParallaxPir : IDisposable

Constructors

ParallaxPir(IDigitalInterruptPort)

Creates a new instance of the Parallax PIR sensor connected to a digital interrupt port.

Declaration
public ParallaxPir(IDigitalInterruptPort digitalInputPort)

Parameters

Type Name Description
IDigitalInterruptPort digitalInputPort

The digital interrupt port connected to the PIR sensor.

Remarks

ParallaxPir
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Motion.ParallaxPir

The Parallax PIR detects motion via infrared. It emits a high signal over the data pin when motion is detected. The pin returns to a low state when motion stops.

Code Example

private ParallaxPir parallaxPir;

public override Task Initialize()
{
    Resolver.Log.Info("Initialize...");

    parallaxPir = new ParallaxPir(Device.CreateDigitalInterruptPort(Device.Pins.D05, InterruptMode.EdgeBoth, ResistorMode.Disabled));

    parallaxPir.OnMotionStart += (sender) => Resolver.Log.Info($"Motion start  {DateTime.Now}");
    parallaxPir.OnMotionEnd += (sender) => Resolver.Log.Info($"Motion end  {DateTime.Now}");

    return Task.CompletedTask;
}

Sample project(s) available on GitHub

Wiring Example

The Parallax PIR sensor requires only three connections, power, ground and motion detection signal:

ParallaxPir(IPin, InterruptMode, ResistorMode)

Creates a new instance of the Parallax PIR sensor connected to an input pin with specified interrupt and resistor modes.

Declaration
public ParallaxPir(IPin pin, InterruptMode interruptMode, ResistorMode resistorMode)

Parameters

Type Name Description
IPin pin

The input pin to which the PIR sensor is connected.

InterruptMode interruptMode

The interrupt mode for the input pin.

ResistorMode resistorMode

The resistor mode for the input pin.

Remarks

ParallaxPir
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Motion.ParallaxPir

The Parallax PIR detects motion via infrared. It emits a high signal over the data pin when motion is detected. The pin returns to a low state when motion stops.

Code Example

private ParallaxPir parallaxPir;

public override Task Initialize()
{
    Resolver.Log.Info("Initialize...");

    parallaxPir = new ParallaxPir(Device.CreateDigitalInterruptPort(Device.Pins.D05, InterruptMode.EdgeBoth, ResistorMode.Disabled));

    parallaxPir.OnMotionStart += (sender) => Resolver.Log.Info($"Motion start  {DateTime.Now}");
    parallaxPir.OnMotionEnd += (sender) => Resolver.Log.Info($"Motion end  {DateTime.Now}");

    return Task.CompletedTask;
}

Sample project(s) available on GitHub

Wiring Example

The Parallax PIR sensor requires only three connections, power, ground and motion detection signal:

ParallaxPir(IPin, InterruptMode, ResistorMode, TimeSpan, TimeSpan)

Creates a new instance of the Parallax PIR sensor connected to an input pin with specified interrupt and resistor modes, debounce duration, and glitch filter cycle count.

Declaration
public ParallaxPir(IPin pin, InterruptMode interruptMode, ResistorMode resistorMode, TimeSpan debounceDuration, TimeSpan glitchFilterCycleCount)

Parameters

Type Name Description
IPin pin

The input pin to which the PIR sensor is connected.

InterruptMode interruptMode

The interrupt mode for the input pin.

ResistorMode resistorMode

The resistor mode for the input pin.

TimeSpan debounceDuration

The duration for input signal debouncing.

TimeSpan glitchFilterCycleCount

The glitch filter cycle count for input signal filtering.

Remarks

ParallaxPir
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Motion.ParallaxPir

The Parallax PIR detects motion via infrared. It emits a high signal over the data pin when motion is detected. The pin returns to a low state when motion stops.

Code Example

private ParallaxPir parallaxPir;

public override Task Initialize()
{
    Resolver.Log.Info("Initialize...");

    parallaxPir = new ParallaxPir(Device.CreateDigitalInterruptPort(Device.Pins.D05, InterruptMode.EdgeBoth, ResistorMode.Disabled));

    parallaxPir.OnMotionStart += (sender) => Resolver.Log.Info($"Motion start  {DateTime.Now}");
    parallaxPir.OnMotionEnd += (sender) => Resolver.Log.Info($"Motion end  {DateTime.Now}");

    return Task.CompletedTask;
}

Sample project(s) available on GitHub

Wiring Example

The Parallax PIR sensor requires only three connections, power, ground and motion detection signal:

Properties

IsDisposed

Gets a value indicating whether the object is disposed.

Declaration
public bool IsDisposed { get; }

Property Value

Type Description
bool

Remarks

ParallaxPir
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Motion.ParallaxPir

The Parallax PIR detects motion via infrared. It emits a high signal over the data pin when motion is detected. The pin returns to a low state when motion stops.

Code Example

private ParallaxPir parallaxPir;

public override Task Initialize()
{
    Resolver.Log.Info("Initialize...");

    parallaxPir = new ParallaxPir(Device.CreateDigitalInterruptPort(Device.Pins.D05, InterruptMode.EdgeBoth, ResistorMode.Disabled));

    parallaxPir.OnMotionStart += (sender) => Resolver.Log.Info($"Motion start  {DateTime.Now}");
    parallaxPir.OnMotionEnd += (sender) => Resolver.Log.Info($"Motion end  {DateTime.Now}");

    return Task.CompletedTask;
}

Sample project(s) available on GitHub

Wiring Example

The Parallax PIR sensor requires only three connections, power, ground and motion detection signal:

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Declaration
public void Dispose()

Remarks

ParallaxPir
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Motion.ParallaxPir

The Parallax PIR detects motion via infrared. It emits a high signal over the data pin when motion is detected. The pin returns to a low state when motion stops.

Code Example

private ParallaxPir parallaxPir;

public override Task Initialize()
{
    Resolver.Log.Info("Initialize...");

    parallaxPir = new ParallaxPir(Device.CreateDigitalInterruptPort(Device.Pins.D05, InterruptMode.EdgeBoth, ResistorMode.Disabled));

    parallaxPir.OnMotionStart += (sender) => Resolver.Log.Info($"Motion start  {DateTime.Now}");
    parallaxPir.OnMotionEnd += (sender) => Resolver.Log.Info($"Motion end  {DateTime.Now}");

    return Task.CompletedTask;
}

Sample project(s) available on GitHub

Wiring Example

The Parallax PIR sensor requires only three connections, power, ground and motion detection signal:

Dispose(bool)

Disposes of the object and releases any associated resources.

Declaration
protected virtual void Dispose(bool disposing)

Parameters

Type Name Description
bool disposing

A value indicating whether the object is being disposed.

Remarks

ParallaxPir
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Motion.ParallaxPir

The Parallax PIR detects motion via infrared. It emits a high signal over the data pin when motion is detected. The pin returns to a low state when motion stops.

Code Example

private ParallaxPir parallaxPir;

public override Task Initialize()
{
    Resolver.Log.Info("Initialize...");

    parallaxPir = new ParallaxPir(Device.CreateDigitalInterruptPort(Device.Pins.D05, InterruptMode.EdgeBoth, ResistorMode.Disabled));

    parallaxPir.OnMotionStart += (sender) => Resolver.Log.Info($"Motion start  {DateTime.Now}");
    parallaxPir.OnMotionEnd += (sender) => Resolver.Log.Info($"Motion end  {DateTime.Now}");

    return Task.CompletedTask;
}

Sample project(s) available on GitHub

Wiring Example

The Parallax PIR sensor requires only three connections, power, ground and motion detection signal:

Events

OnMotionEnd

Event raised when the PIR sensor indicates that there is no longer any motion.

Declaration
public event ParallaxPir.MotionChange OnMotionEnd

Event Type

Type Description
ParallaxPir.MotionChange

Remarks

ParallaxPir
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Motion.ParallaxPir

The Parallax PIR detects motion via infrared. It emits a high signal over the data pin when motion is detected. The pin returns to a low state when motion stops.

Code Example

private ParallaxPir parallaxPir;

public override Task Initialize()
{
    Resolver.Log.Info("Initialize...");

    parallaxPir = new ParallaxPir(Device.CreateDigitalInterruptPort(Device.Pins.D05, InterruptMode.EdgeBoth, ResistorMode.Disabled));

    parallaxPir.OnMotionStart += (sender) => Resolver.Log.Info($"Motion start  {DateTime.Now}");
    parallaxPir.OnMotionEnd += (sender) => Resolver.Log.Info($"Motion end  {DateTime.Now}");

    return Task.CompletedTask;
}

Sample project(s) available on GitHub

Wiring Example

The Parallax PIR sensor requires only three connections, power, ground and motion detection signal:

OnMotionStart

Event raised when motion is detected.

Declaration
public event ParallaxPir.MotionChange OnMotionStart

Event Type

Type Description
ParallaxPir.MotionChange

Remarks

ParallaxPir
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Motion.ParallaxPir

The Parallax PIR detects motion via infrared. It emits a high signal over the data pin when motion is detected. The pin returns to a low state when motion stops.

Code Example

private ParallaxPir parallaxPir;

public override Task Initialize()
{
    Resolver.Log.Info("Initialize...");

    parallaxPir = new ParallaxPir(Device.CreateDigitalInterruptPort(Device.Pins.D05, InterruptMode.EdgeBoth, ResistorMode.Disabled));

    parallaxPir.OnMotionStart += (sender) => Resolver.Log.Info($"Motion start  {DateTime.Now}");
    parallaxPir.OnMotionEnd += (sender) => Resolver.Log.Info($"Motion end  {DateTime.Now}");

    return Task.CompletedTask;
}

Sample project(s) available on GitHub

Wiring Example

The Parallax PIR sensor requires only three connections, power, ground and motion detection signal: