In this part of the lesson, you will add a proximity sensor to your Raspberry Pi, and read distance from it.
## Hardware
The Raspberry Pi needs a proximity sensor.
The sensor you'll use is a [Grove Time of Flight distance sensor](https://www.seeedstudio.com/Grove-Time-of-Flight-Distance-Sensor-VL53L0X.html). This sensor uses a laser ranging module to detect distance. This sensor has a range of 10mm to 2000mm (1cm - 2m), and will report values in that range pretty accurately, with distances above 1000mm reported as 8109mm.
The laser rangefinder is on the back of the sensor, the opposite side to the Grove socket.
This is an I<sup>2</sup>C sensor.
### Connect the time of flight sensor
The Grove time of flight sensor can be connected to the Raspberry Pi.
#### Task - connect the time of flight sensor
Connect the time of flight sensor.
![A grove time of flight sensor](../../../images/grove-time-of-flight-sensor.png)
1. Insert one end of a Grove cable into the socket on the time of flight sensor. It will only go in one way round.
1. With the Raspberry Pi powered off, connect the other end of the Grove cable to one of the I<sup>2</sup>C sockets marked **I<sup>2</sup>C** on the Grove Base hat attached to the Pi. These sockets are on the bottom row, the opposite end to the GPI pins and next to the camera cable slot.
![The grove time of flight sensor connected to the I squared C socket](../../../images/pi-time-of-flight-sensor.png)
## Program the time of flight sensor
The Raspberry Pi can now be programmed to use the attached time of flight sensor.
### Task - program the time of flight sensor
Program the device.
1. Power up the Pi and wait for it to boot.
1. Open the `fruit-quality-detector` code in VS Code, either directly on the Pi, or connect via the Remote SSH extension.
1. Install the rpi-vl53l0x Pip package, a Python package that interacts with a VL53L0X time-of-flight distance sensor. Install it using this pip command