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, we wanted to highlight a message within a poster 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.
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.
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 KEMET SS-430 IR Pyroelectric Sensor 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 illustrated in Figure 1.
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.
Knowing the behavior of the sensor, for this quick project we had the following connections:
Figure 2 shows an illustration of these connections.
Table 1 provides the Arduino code used in this project.
Table 1: Arduino Code for the KEMET SS-430 Pyroelectric IR Sensor Project.
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 |
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.