Interfacing the Crazyflie With a Proximity Sensor

This article will teach you how to interface your Crazyflie with a proximity sensor.  It would be wise to test your Crazyflie and the proximity sensor before soldering everything together.  A detailed account of my experience can be found here.

Bill of Materials

  1. Crazyflie nano quadcopter (you can also use the 6-DOF version)
  2. LV-MaxSonar-EZ0 ultrasonic proximity sensor
  3. Solid wire capable of supporting a 5 gram sensor
  4. Soldering equipment

Methods

1.  Solder the proximity sensor pins  ->  to the Crazyflie expansion header (check out the reference):

+5  ->  pin 20
GND  -> pin 19
AN ->  pin 14

2.  Position the wire so the proximity sensor stands straight up, and the eye points towards the front of the copter as shown in the photo.

3.  Download the firmware binary.

OR

Clone my fork of the crazyflie-firmware and make the project if you have your development environment setup:

hg clone https://cfusting@bitbucket.org/cfusting/crazyflie-firmware-proximity-sensor

4.  Flash the Crazyflie firmware over the radio.  Instructions can be found here.

5.  Add the vProx logging parameter to your selecting logging parameters and restart the Crazyfly Client

6.  Fly around and watch as the Crazyflie detects objects in the Plotter tab!