Almost of us remember how Grover (super Coco in Spain) teached us the concepts about “NEAR” “FAR”, now like a child , the drones, robots need this concepts to.
After a few exercises with the Infrared sensors. I made something closer to the project for drones.
The infrared sensors that I use (GP2D120XJ00F, GP2Y0A21YK) has a lot of noise in his signal, and to have an stable signal we need to add some capacitors. (this is a very good page, http://www.robotroom.com/DistanceSensor3.html)
But the drone will work with the concepts near, far, so we can work with a noise signal, by the moment, in the future I’ll reduce the noise with the capacitors, but for a trial it’s ok
I read directly the signal from the sensor, and change to a cm approximately, near and far are abstract concepts.
Nothing close :),
30 means : 30 cm or far
The back sensor (13) is the short range
So I defined a differents thresholds for the GP2Y0A21YK
Green: >15 cm
Yellow: <=15 && >10cm
Red <= 10 cm
For the short distance (GP2D120XJ00F)
Green >10 cm;
yellow <=10 && >5;
The measures were taken by the empiric mode, with my straightedge, and the reference is the box not the sensor, by this I have measures lower than 10 in the sensor. (every thing is relative 🙂 )
The blue value is the time in milliseconds to take 100 measures for each sensor.
To have a quite stable value, I took 100 measures for each sensor and I use the mean.
For the final project I’ll add the capacitors to have an stable signal, and I’ll take less measures, to reduce this time to 4 milliseconds or less