This is a Distance Sensor add-on that you can use with Marty the Robot to give the robot the ability to sense proximity to objects in front of it.
We’re including a simple 3D printed mount for the sensor as well as a nut and bolt so you can attach this sensor to Marty, poking out just under his chin.
The distance sensor also comes bundled with a cable that lets you plug it straight into Marty’s control board.
You can use the sensor readings in Scratch and also Python straight away! It’s also easy to use this add-on alongside our Raspberry Pi Camera Mount add-on.
Simple to use in Scratch or Python!
How to install
You can mount the sensor on Marty through the slots in his chin with the provided mount. Make sure your Marty is turned off before you plug in the sensor. Take care to line the pins up correctly as shown below, matching the names printed on each PCB for each wire. We recommend you don’t plug or unplug the sensor, nor have loose screws and a screwdriver poking around when Marty is on as this could break the sensor or your control board!
However! You can still use this sensor in an old Marty if you plug it in to a Raspberry Pi instead of Marty using some jumper wires, and do a little more programming to talk to the sensor over I2C.
This is a nifty little Breakout Board for the VCNL4200 distance/proximity and ambient light sensor.
Click here to see technical specs and more info!
The sensor has a remarkably broad measurement range of around up to 1.5m away to as close as 2cm! (59” to 1” for those from the 17th century). As the sensor employs an IRED (Infra-red Emitting Diode) and IR detector photocell to determine distance, mileage may vary based on the ambient conditions. This makes it fantastic for a wide variety of robotics applications, such as self-driving RC cars as well as for many Martys manoeuvring amid a maze…
The sensor is somewhat quirky in that it needs a 5V supply to help power the IR Laser Diode, but the logic level on the I2C bus is 3.3V and is not 5V tolerant. There’s a small LDO regulator on this board that handles supplying 3.3V to the sensor, so you only need to provide 5V. As always, see the datasheet for more details!
The I2C pins
SCL are broken out on the board, as well as the Interrupt pin
INT (see the datasheet below for further details. There’s a single hole sized to fit a M2.5 machine screw in the centre of the board. You can download the 3D Printing STL files for the mount that fits Marty here.
- VCNL4200 Module Datasheet
- I2C Address
- 5V input, logic 3V3 (not 5V tolerant)
- Product Schematic
- 26mm × 13.5mm × 13mm (with connector)
- Cable & Connector
- Approx 22cm long, JST XH 5 pin (10mil spaced) on board to 2 × 3 female pin header