To construct a small wheeled robot and equip it with the typical ultrasonic sensor is quite relaxed. It is even more relaxed if the programming environment used includes a suitable library.
The resolution and accuracy of the ultrasonic sensor technology has to be compromised. Now there are not only ultrasonic sensors, but also infrared based ones.
Recently there are also affordable versions based on laser light. This is now in this showcase the talk.
The Pic left shows the VL53LOx in it's whole glance
This project has 4 unfinished ideas
Since the distance sensor is mounted on a servo and the servo needs a pulse every 20ms max
I used the same every 2ms interrupt to run an every 20ms event.
Also adding a variable for last turn, Added if obstacle left then servodir=left and same for obstacle right ie servodir=right. Solved problems with robot "oscillating"left/right.added reverse when obstacle forward.
The VL53L0x rangefinder is ideal for an obstacle avoiding robot. It is accurate..is for short distances. It has a narrow infrared laser beam to sense an obstacle and the response
is stable...is for different colours.
so I've learnt how to set up an interrupt to run 2 stepper motors and a servo and get a VL53L0x to work in an "application".
The point is here is no special Library used beside the I2C Lib, of course.
Demo in natural environment
See it in Action on a Desk avoiding a pen
As Microcontroller arduino uno clone for £5 was used.
geekcreit it has pins for spi, i2c, serial and grounds and 5V and 3.3V.
other Parts used:
I have two 3.6V li-ion batteries in series to give 7.2V to drive the robot.
a lead and plug is connected to the batteries unswitched. This connects to the uno DC in and so uses the onboard 5V reg. The uno only powers the VL53L0X.
The batteries go through a switch to a variable constant current/voltage supply
Drilling holes for the motors was not fun.
And underneath is a ballbearing castor.
Source Code is available here
More detailed Infos are here
Build by stan cartwright