I might be dumb
So it says place an capacitor between Ground and Power on the Sensor. Does that mean I that the power from my board to the + side of the capacitor and then to the power on the sensor and take the ground from my board to the - side of my capacitor then to the ground on my sensor. Or + from my board to Power on Sensor to + on capacitor then - on capacitor to Ground on sensor to Ground on Board. I’m just having one of those brain freeze right now for some reason.
Use a ceramic capacitor,
Use a ceramic capacitor, they dont have polarity so you don
t have to worry which pin is which.
On the back of the sensor you should see the solder points for the connector. Find which are + and - and solder the cap on, 1 leg to each pin. Make them short so the capacitor will hide behind the sensor.
The idea is that the capacitor is as close to the sensor as possible. Can`t get much closer than stuck to the back of it
thanks
so just solder it to the power and ground wire on the back. Thanks, I really hate to solder anything to it, but I might just do it that way if its going to say me a lot of trouble. Now I would need a 10uf ceramic capacitor right, also do they have a volt on them. I bought some from a local electronic place and they have my cermaic disc mark as .47uf and 50V. How much is this really going to help with my spike though.
Equation
This is for a Sharp GP2Y0A02 but I guess it should work for your sensor with some adaptions
volts = analogRead(IRpin)0.0048828125;
distance = 65pow(volts, -1.10);
Distance is the distance in centimeters.
My Sharp acts strange… i
My Sharp acts strange… i get the highes reading of 520-560 by around 8 cm (yes i can not handle those imperial units ;-)) in 20 cm i get 300-330 and in 30 cm 195-205.
all the way to the rooms ceiling (180 cm above the table) spit out a reading of 62-67
all readings by closer than 7cm getting smaller values till down to 144 in 0.5 cm distance.
I used this code:
void setup()
{
Serial.begin(9600);
}
void loop()
{
int distance = analogRead(0);
Serial.println(distance);
delay(200);
}
What did i do wrong? My sensor is labeled as Sharp GP2D 12 F 77
There is nothing wrong with
There is nothing wrong with your sensor. This is the normal behaviour for the analogue Sharp GP2xxx sensors. At the end of this article you can see a diagram ‘Output voltage by distance’. You will need to write a function to convert the input voltage to cm.
Confused
because of the posts here i was really thinking i get the numbers right out of the sensor :-))) I tested it on “Steven X” and it was a success. Just have to figure out the distance…no need to convert it in cm (save memory and processing power ;-))
With “distance > 500” I am getting a danger distance of around 10cm and this is what i need. Now have to figure out how to detect an edge reliable.