Pyro Switch: Hidden IR detection

Ivan Quiroz

Monday, March 11th, 2019

Our Pyroelectric sensors are an interesting device that allows you to detect the presence of a person while hiding the sensor from view. This property works well when you want to create an otherwise static poster into an animated one. For simplicity, we used an LED, a microcontroller Arduino, and our SS-430 IR Pyroelectric Sensor.

Let me set the environment. Here at KAIC, our application intelligence lab, located in KEMET tower (check it out here), we wanted to highlight a message within a poster with in an interesting creative way. We had our new SS-430 sensor laying around, so we decided to add it to the back of one of our informative posters, which is made of foam core board material.

Simplicity

 

We attached the sensor to the back of the poster, added a microcontroller (Arduino) to read the sensor and drive an LED. This setup allowed us to detect when someone placed their hand in front of the poster and we would light up the switch. The set up works well to work as a switch. But to understand how this circuit works, let me start by explaining how our infrared sensor works.

Let’s Get Technical…

KEMET’s Pyroelectric Infrared (IR) Sensors use the pyroelectric effect of ceramic by absorbing infrared rays emitted from the human body. Different from your grandpa’s infrared sensor, where you need to have a dedicated emitter IR LED illuminating an area. When an object comes into the proximity, the IR bounces back to detect the object.

The SS-430 detects the presence of a person differently by identifying a base IR signature of the environment. When this signature changes, it generates a signal as following:

 

 

Note how when the hand approaches the embedded sensor, the signal from the sensor is 2 square waves of 200 msec each. When the IR presence is removed from the viewing area, then a second set of square waves can be detected.

The Connections

Knowing the behavior of the sensor, for this quick project we had the following connections:

  • We connected power from the Arduino 5V, ground the sensor’s 5V, and ground.
  • We also connected the Signal ground from the sensor to the Arduino’s A1 pin.
  • Finally, added a green LED via a 500 ohm resistor

 

Arduino Code

int Pyro = A1;
unsigned long PyroRead = 0;
unsigned long IR_threshold = 198000;

// Note: SS-430 has two pulses of 200msec per detection.
// IR_threshold is in microsec (usec), therefore 198msec threshold

int LED = 7;
int Detected = LOW;
int IR_sensed = 0;
void setup() {
pinMode (7, OUTPUT); //LED Connected to Pin 7
pinMode (A1,INPUT); // IR Sensor connected to A1
}


void loop() {
while ((IR_sensed < 2)){ //Break after 2 good triggers

PyroRead = pulseIn(A1, HIGH); //Measure trigger point
if(PyroRead > IR_threshold){ //Make sure trigger is over 198msec)
IR_sensed++; //Mark as a good trigger
}

}

if (Detected == HIGH){ // Turn LED OFF if it was previous ON
Detected = LOW;
digitalWrite(7, LOW);
}
else {
Detected = HIGH; // Turn LED ON if it was previous OFF
digitalWrite(7, HIGH);
}
PyroRead = 0; // Reset readings
IR_sensed = 0;

delay(1000); // Accept triggers after a second

How it works

As soon as the program starts, it will scan the A1 pin, looking to measure a pulse. We are expecting two pulses of 200 msec each when a person has been detected. We measure the pulse and determine if it is an OK pulse by counting for two pulses per triggering event. Once a trigger has been found, the LED is turned ON or OFF based on its prior status. We end by waiting for one second before a second trigger can be processed.

Conclusion

Working with KEMET’s Infrared Sensor is easy  and works well when embedded into a device. You can place discrete sensors that do not break the industrial design of a product, by having a window or filter.

For more information on the sensor: