Jump to: navigation, search

Due Date

Breadboard: Monday, January 28, 2019

Soldering: Wednesday, January 30, 2019

About the Project

We will be creating a circuit that allows us to sense the distance of any object (useful for the capstone!). To do this, we will be using infrared diodes to send out infrared light, and phototransistors to receive the IR light. If an object is closer to the emitter and receiver, more light is absorbed by the transistor! You will need to use your Arduino in this project to power the circuit, read data from the phototransistors, and output PWM signals to two LEDs based on your readings.

Slides: https://docs.google.com/presentation/d/1514g2ag057a8ww3D1leQ4K8ehFIl2aPWmhLAHqdYaxo/edit?usp=sharing

Note: If you are a Mac OS user, please refer to the slides from the previous project to handle issues :)

Overarching Idea


Distance Sensor Schematic


  • Placement of your emitter and receiver matters! Make sure you pair up an emitter with a receiver to best achieve the diagram above
  • If you're having trouble with the brightness range, try using the serial monitor to print out the values you're reading, so you can adjust your map/constrain statements
  • You don't need the usb cable to power your Arduino! If you hook up your battery to the Vin and GND pins on the Arduino, it will be powered and run the latest code you uploaded to it.