PIR module on the inMoov Robot

The inMoov will be fitted with a PIR module. This Passive Infrared Sensor measures the infrared light radiates from object it’s pointed at. A PIR module can be used to detect if somebody is in front of the inMoov robot. I am thinking of using the sensor to power up the inmoov robot so it can reduce power when nobody is in front of it.

I used a simple module what can be purchased on several web shops around the world.

IMG_3465

This module has a footprint of 32,5 mm x 24,5 mm x 25 mm and has three pins. One pin is for 5V power and one ground pin. The third pin is the data pin and is High when motion is detected. The modules as two potentiometers. The left potentiometer is for the sensitivity and the right is for the duration the pin should be high after motion is detected. The sensitivity is depending on your situation. For the duration I used the shortest setting because I don’t expect I to miss this trigger.

The picture below shows how the PIR module is connected with an Arduino. I used this to test the module.

IMG_3498

The PIR module has it’s own connection on the Nervo Board. It’s located next to pin A15, D44 and D46. I made a ribbon cable to connect the sensor to the board. The pins on the PIR module and the Nervo Board are not in the same order. I needed to swap the vcc pin and the signal pin on one end as you can see in the picture below.

IMG_6018

To test the PIR module and it connections I used a little piece of Arduino code.  The signal pin of the PIR module is connected to pin 23 on the Nervo Board. The code is checking every second if motion is detected and prints the results in the Serial Monitor.

[code lang=”cpp”]
/*
* This is an example of how to use a PIR sensor with an Arduino.
* www.swanrobotics.com
*/

// Define pin 23 as input for the sensor
#define MOTION_PIN 23

int reading;

void setup()
{
// Setup Motion pin
pinMode(MOTION_PIN, INPUT);

// Initilize serial link for debugging
Serial.begin(9600);
delay(1000); // 1 second delay to open the serial monitor after uploading
Serial.println (“Start”);
}

void loop()
{

reading = digitalRead(MOTION_PIN);
if (reading == HIGH) {
Serial.println (“Motion Detected”);
} else {
Serial.println (“No Motion Detected”);
}

// Wait a second
delay(1000);
}

[/code]

I have printed the MiddleChest+PIRV1 part which has a space for the PIR sensor. This part is already mounted on my inMoov so I only had to hotglue the PIR module in place.

IMG_6025 IMG_6024

This picture below shows the final result in the chest of the inMoov robot

IMG_6034

To show you how the PIR is mounted in the inMoov robot I made a small video.

All this was not possible by the creator of the inMoov robot. Please visit his website www.inmoov.fr