Since I’ve had an arduino I’ve been wanting to build a tracked robot, and slowly but surely I’ve been picking up sensors and motors to use.
The latest sensor I’ve picked up is an infra red distance sensor namely the pololu GP2Y0D810Z0F Sharp sensor. This is a great little sensor that can detect items between 10cm and 2cm from itself, it has only 3 pins, power, ground and output. If an item is between 10cm and 2cm then the output is high, else it is low, perfect for sensing if a wall is approaching. A nice little touch with the sensor is that to test it all you need to do is connect the power and ground, there’s a built in red LED that goes off if it detects an object.
As a quick little test for the sensor I hooked it up to the arduino with a red and green LED, green means the sensor cant see anything, red means the sensor has picked something up.
Code: