Arduino and proper proximity sensor

Hi guys. I want to use a proximity sensor and an arduino to know when a person is in the shower. What I have in mind if that if the sensor measures a range of distance it would mean that the person is in the shower. I have made some research and the infrared Sharp GP2Y0A21YK0F seems appropriate for the distance range I need that is around 20-60 cm depending on the size of the shower. However I am ignorant in this topic and I want to know if the water from the shower will make an interference when measuring the distance and generally speaking if this is a suitable sensor for my objective. The person will be of course moving and won’t be perpendicular to the sensor would this be problematic ? additionally I read that the voltage output from this type of sensor is not linear, would it be difficult to actually know the distance? too many questions sorry but I am a newbie
Many thanks in advance

Hi,

The Sharp sensor RB-Dem-01 is a great choice of sensor when trying to find the distance of something roughly perpendicular. It is especially useful if the target object is large and consistently in front of the sensor. This is why this sensor is often use to detect obstacles like walls for mobile robots.

But, for detecting a person, there are many much more appropriate sensors called PIR sensors. We actually have a nice selection of those available here. These sensors are designed for this exact type of activity and are very simple to use.

Here is an example code from the manufacturer of the RB-Dfr-566:

[code]// # Hardware Connection:
// # PIR Sensor -> Digital pin 2
// # Indicator LED -> Digital pin 13
// #

byte sensorPin = 2;
byte indicator = 13;

void setup()
{
pinMode(sensorPin,INPUT);
pinMode(indicator,OUTPUT);
Serial.begin(9600);
}

void loop()
{
byte state = digitalRead(sensorPin);
digitalWrite(indicator,state);
if(state == 1)Serial.println(“Somebody is in this area!”);
else if(state == 0)Serial.println(“No one!”);
delay(500);
}[/code]
We hope this helps!

Sincerely,