
glenrswanson
I am having a problem with the ping sensor. I have the sensor hooked up to D8 and D9. I have servos and an H Bridge connected but not doing anything with them.
I am using the ping distance control to view the result and they seem very unstable. With a stationary target the reading are bounce between 16 to 18 (which is probably an accurate value and 255 with half of the reading or more being 255.
The other things that I notice is that it rarely reports a reading higher than 20 unless it is 255. There is fairly linear progression from ~1 to 20 but rarely anything beyond that.
My first question is - Are these values and instability normal? Next question - Are some ports better than others for this purpose? Third question - Can you offer any guidance?
Thanks,
Glen
I checked the wiring- good connections and no shorts
I checked the power- 8.6 from the pack and 5.06 at the sensor
The sensor does not seem to sense anything beyond about 25 to 30cm with any predictability.
For a stationary target 13cm from the sensor face, The values range from 12 to 15. I am not sure if the is normal for static use.
I found an object that it could detect at 10cm 100% of the time and moved it to 24cm. If you look at 10 consecutive readings they vary between 23 and 26 and over half of them are 255.
I am not sure what else to do. I wouldn't mind ordering a new sensor but the website is quoting 5 to 7 weeks for delivery and I am still waiting for parts that I ordered in September.
What do you recommend for an ultrasonic sensor? For an IR sensor?
Thanks,
Glen
You can pick up the hc-sr04 from ebay or many other online shops for quite cheap.
It may be the wire to the sensor, I've had problems with some of mine before now. The length of the wire made a difference as did the quality of the wire. I found the cheap extensions I got from ebay/china gave me problems. I rewired it with a better extension and the problems went away. I still get some fluctuation in the readings but never any 255s when they shouldn't be.
Sharp IR sensors are what I use, they do a lot of them depending on the range you want to check, but basically any of the IR sensors work well. You need to use scripts to use them though and connect to the ADC ports, unless you pick the exact same one DJ used in the tutorial (for which there is a control).
The wires are 6" 22AWG. I did change both trigger and echo with no change in result. The occasional 255 reading would be ok but the fact that once you get beyond 20, it rarely reads anything is really leading me to a defective sensor.