Hi Everyone,
For those of you who are taking part in the car challenge we were talking last night about different approaches to get the car to detect the wall. I figured I would save you all some research if you chose to use a distance sensor; one of the cheapest sensors available on the market is the HC-SR04 arduino sensor . This sensor takes a 10 microsecond signal and responds with a signal detailing how long it took for the signal to bounce back; or the distance to the object is half the time divided by the conversion of microseconds to m/s such that :
distance in cm = (duration/2) /29
There are two small problems with this sensor and the pi though:
1. It sends a 5V signal as output which since we are using the GPIO pins on the pi (3V3) has a chance of shorting the pi , this can be prevented by using voltage divison ; there are wiring diagrams available that are specific to the pi and this sensor but the math tells me the resistance given in the diagram will result in a 2V1 signal to the pi.
2. The sensor when interfacing directly with the pi has a standard deviation of around 8%; this is due to the nature of having the os able to interrupt your code, but if you are using an arduino to the distance sensing though it comes to a 1cm standard deviation up to 2 metres. I will probably end up getting an arduino uno as they are not too expensive and I prefer the more accurate sensing.
The hyperlinks are just there to show how cheap it is possible to get them on ebay choose vendors as you wish.
Rick Knoop