Saturday, August 16, 2014



So we have an ultrasonic sensor now, courtesy of SainSmart. This sensor is particularly straight-forward to use. The only thing to actually take into account is that the GPIO pins of the Raspberry Pi use a signalling voltage of 3.3V, while our sensor produces 5V. So following the excellent instructions at http://www.gtkdb.de/index_36_2272.html, I built a voltage divider, using a screw terminal to fixate the resistors. Running a small Python test script finally confirms that the sensor is working. I've connected it directly to the Raspberry Pi for now as opposed to wiring it up to the Arduino. Let's see how that goes. The sensor's logic is simple: Setting its input to high for about 10 μs will trigger a measurement. You then count the time until its output pin becomes high. Now the time counting piece is what makes me a bit worried as I start doing more complex stuff on the Raspberry Pi. Plan B would be to wire the sensor to the Arduino, whose ATMega controller is capable of dealing with this in real time.

No comments:

Post a Comment