Hi. I did another project with raspberry pi. This time I got ultrasonic ranging module HC – SR04. This sensor can measure distance using sound, ranging accuracy can reach around 4m. It works simple – You send signal to trigger module, and then you count time until response. Distance can be calculated with equation – (time x velocity of sound)/2 .
In my project I wanted to make autostabilizing bar. Module would check distance to the ground, and it rotate bar using motor when values are not right. See movie below to see what I mean 😀 I like the result, it was fun to calibrate this construction.