[#NETMF] HowTo: Create a movements sensor (I)

image

Buenas

today’s example does not attempt to replace a Kinect, or much less. However shows us that with a small hardware little more than €12, can create a sensor’s movements when it detects movements, begin to record the input from a camera.

On this basis, we started with the following hardware for example, where we will see the simple which can be create a Motion Detector

with these three elements, we connect the same guided by the following scheme

image

At this point, with the connected sensor we work with it is pretty simple.

Line 10 shows us that we have an event Motion_Sensed () that is activated when the sensor detects motion.

   1: using Gadgeteer.Modules.GHIElectronics;

   2: using Microsoft.SPOT;

   3:  

   4: namespace GadgeteerApp14

   5: {

   6:     public partial class Program

   7:     {

   8:         void ProgramStarted()

   9:         {

  10:             motion_Sensor.Motion_Sensed += MotionSensorMotionSensed;

  11:         }

  12:  

  13:         void MotionSensorMotionSensed(Motion_Sensor sender, Motion_Sensor.Motion_SensorState state)

  14:         {

  15:             Debug.Print("motion detected !");

  16:             // also check >> motion_Sensor.SensorStillActive

  17:         }

  18:     }

  19: }

Well, we can subscribe to this event or can change the focus and do a PULL of the status of the sensor. For this second case we check the Boolean value of the property SensorStillActive (line 15).

The sensor is quite small and has a range of about 7 meters according to official indications that we can readhere .

image

In the next post, add a camera and keep the contents of it on an SD card.

Saludos @ Home

El Bruno

image image image

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.