leonsdrw8

A bit of local (Rochester, NY) band history as I was involved. These recordings go back 50 years.

Also known as “Do you really have to drag that thing around everywhere?” 

UNO Test of Kemet Proximity Sensor

Here’s what I found in my first test of the KEMET Proximity Sensor.

I use and Arduino UNO for the test – code is below. I hooked the VCC to the 5v on the UNO, Gnd and the signal out of the sensor to digital input pin 8. I ran the code (with the appropriate pin definition) and didn’t get anything out – couldn’t see a change from the signal line.

I then thought of moving the signal line to an analog input pin (A0) to see if there was anything on the signal line. That was it – there I could see the signal change depending on what was in front of the sensor. To the right is the plot that I got when moving my arm in front of the sensor. Because I had read in one of the descriptions that the signal line was the output of a comparator I thought the output would swing from 0v to 5v. What I saw was the signal line went from 0 to 615 on the A0 line – based on a VCC to the UNO of 4.99 volts it seems the high output is 3.0 volts. It may say that somewhere in the documentation but I have to admin I didn’t read everything so I missed it if it was in the docs.

So I went with this and the codes test to see if the A0 in is over 500. If so then that is considered a HIGH. Anything lower than 500 is a LOW. I found that it would be better to consider the sensor a CHANGE monitor rather than a presense type monitor. When I moved in front of the sensor it wen high. If I stayed still it went low. When I moved a bit it went high again. You can see that in the screen shot of the plotter output. This made much more sense to me after thinking doing this test and putting some thought into it – the sensor must pick a base line point – everything gives off some infrared – some a lot – some almost none. The sensor waits a bit, calls that zero and then if there is a change it raises the signal line high. If what ever it sensed stops moving it calls that a new base line and waits for the infrared pattern to change then calls that a high.

The code is below or CLICK HERE to download a zip of the ino file.

// KEMET sensor test with Arduino UNO
//  by Leon Zak
// info@zaks.com
// http://leonzak.com
// you can use either the Serial Monitor or Plotter

int ledPin = 13;

//****************************
// Kemet Proximity Sensor
//****************************
int proximitySensorInputPin = A0;
int proximitySensorReading = 0;

void setup() {
Serial.begin(115200);
pinMode(ledPin, OUTPUT);
}

void loop() {
// now check the sensor to see if there is someone in front of it
proximitySensorReading = analogRead(proximitySensorInputPin);
Serial.println(proximitySensorReading);
// My VCC was 4.99 volts into the UNO. When the sensor went high it gave an
// reading out of 613-616, so I figured anything over 500 was a high, under a low
if (proximitySensorReading >500) {
digitalWrite(ledPin, HIGH);
} else {
digitalWrite(ledPin, LOW);
}
delay(100); // change this to speed up/slow down the plotting
}