Infrared Sensor As Switch

Hi,
I am a sculptor and I make inflatables.
I’m currently working on an inflatable piece that is run with constant air flow.
When someone walks in to the piece, I want the blower to switch off and when they leave the piece, I want the blower to switch back on. The sensor can not be a motion sensor because the material is constantly moving… so it must be infrared. Will this sensor work for this purpose?

robotshop.com/dfrobot-adjustable-infrared-sensor-switch.html?utm_source=google&utm_medium=base&utm_campaign=jos

If not, do you have any ideas on what could work?

Thanks!

Thanks!
I received the sensor.
Now I’m working on the code and I can’t seem to locate analogue input numbers for the code that I’m writing for the Arduino. Do you know what they are or where I can find them?

The code that I have written so far is:

[code] int analogPin=A0;
int analogValue=0;

void setup() {
Serial.begin(9600);
pinMode(12, OUTPUT);
}

void loop() {
analogValue = analogRead(analogPin);
Serial.println(analogValue);

if (analogValue > .25){ // analogValue WILL NOT BE A DECIMAL NUMBER. LOOK AT THE SERIAL MONITOR TO SEE ACTUAL NUMBERS
delay(3000); //wait 3 seconds…
digitalWrite(12, LOW); //turn fan off

} else if (analogValue <.25){ // analogValue WILL NOT BE A DECIMAL NUMBER. LOOK AT THE SERIAL MONITOR TO SEE ACTUAL NUMBERS
delay(1000); //wait 1 second…
digitalWrite(12, HIGH); //turn fan on

}[/code]

My Arduino/IR Sensor set up is attached if you’re curious.

help?
Thanks!

Hi Again. Thanks so much for all of your help.
I have the sensor working and hooked up to my fan and arduino as planned below.
The problem is that the sensor I have (robotshop.com/sharp-gp2y0a02yk0f-ir-range-sensor.html) also detects objects other then people (ex: fabric). Is there a sensor that can only sense people [not movement] (maybe by slight temp. increases when someone gets near it)?
Do you think this one could work? robotshop.com/phidgets-motion-sensor-1.html
Thanks again for all your help. I’m slowly catching on to how all this works.

Really any infrared sensor will work so long as you place it strategically in the path of the person walking into the piece. The one you selected is really more of a “point” sensor whereas an analog IR distance sensor will probably work better.

You need to use the serial terminal window (black box at the far right of the Arduino software). Click that, select the right Baud rate and you’ll see the output.

No “people” sensors as of yet - if you invent one it will certainly be popular! A heat sensor would also help, but it simply detects temperature of whatever is in front of it… person, dog, heater… The closest things you might use are a camera vision system or a Kinect (both would require a lot of programming).