Tuesday 13 October 2015

ElMo goes ultrasonic

This weekend we managed to add ultrasonic sensors to ElMo.  We bought an UltraBorg from the PiBorg people, which made this very straightforward - although we did seek out some warm words of encouragement on their forum before starting.  Piborg also sell a mounting kit to hold an SR04 ultrasonic sensor, so we grabbed some of those as well.  Fitting the screws was a job for small fingers

We brilliantly designed the metalwork we added last time so the spacing was exactly the same width as the mounting holes on the ultraborg - or was that just a very satisfying fluke?!
Communication with the board is using I2C - the same 6 pin set up as the picoborg reverse, so we were able to just daisy chain this board in between the picoborg and the raspberry pi - simple.  The ultraborg would apparently need an extra power supply if we were to add servos, but this is not required for ultrasonic sensors, they can just draw power from the pi.  We fitted two sensors to the front (they are connected with the white/lilac/purple/blue wires in the picture above.  We may add two more on the side later, to help with steering in the straight line speed test.  Looking good :)
We also swapped the crazy breadboard connection to the line following sensor for some female/female wires in fetching rainbow colours - these came from robotshop.

We seem to be getting relatively reliable readings from the sensors, which is pleasing - I thought we might end up using an IR distance sensor instead, but actually these seem OK.  We wrote a little program that approaches a wall at full speed, drops to quarter speed when the distance is less than 300mm and stops when the distance is less that 30mm.  It might need some fine tuning and we may not get as close to the wall as some (apparently they needed calipers last year), but I think this is a great start.  Here's the video of take two - take one didn't go quite so well ;)

Next time we'll hopefully be harnessing the power of the cannon...

No comments:

Post a Comment