I soldered a 10uF 50V capacitor to the + and - on the sensor and it's connected to analog pin 0.
When I turn it on the sensor starts to heat up really hot and the numbers in the serial monitor just go up. The numbers start at about 880 and go up to about 920.
Here's the code I'm using:
int LED =13;
void setup()
{
pinMode(LED, OUTPUT);
}
void loop()
{
int distance = analogRead(0);
if ( distance == 321 )
{
digitalWrite(LED,HIGH);
}
else
{
digitalWrite(LED,LOW);
}
}
You did not say how you are powering the sensor. The specification says it should dissipate 250mW (50mA @ 5V) Can you measure the power voltage and current?
I'm using the power from the Arduino. I tried to measure the current but its not working.
That sounds like you have connected it up wrong. Often this happens if you get the 5V and ground mixed up. It usually kills the sensor as well.
Is there anyway I can tell if I killed it?
Sorry, this is a technical forum. If you want an accurate response, it is necessary to provide precise details like which Arduino you are using, how it is powered, exactly which pin you are connecting to, etc. Else we are unable to offer anything but general sympathy.
I keep forgetting that there are different Arduinos. I'm using the Arduino Duemilanove, the sensor is plugged into Analog 0, Gnd, and 5v.
I also copied the wrong code, here's the one I'm using:
And when you say "it" what exactly are you refering to? The power source? the Arduino? the sensor? the meter? If you want technical answers you must provide technical details.