Short Range Personal Radar: Software

Program Download:

Main C File

The Software
           The IR range software for this project has three main portions to it.
    -Servo Control
    -Led Output Control
    -A/D Input

           Since the software for this project won't fit all on one page I'll explain these three elements and how they're implemented. If you have any lasting questions about the software just go to the forums and ask! The program is heavily commented so it should be readable.

Servo Control
           The method used for servo control is via timers & interrupts. A 50Hz signal is generated by two seperate interrupts that work together to create desired pulses that make the servo pan left and right in small steps so as to quiet the servo's squeaking movement noise.

Led Output Control
           The leds are all controlled via the 74LS373/74HCT373 latches. The pic inturn controls these devices by switching the control lines. The system constantly updates the latch information which can be seen by the led output.

A/D Input
           The IR range sensor output is in the form of a varying analog voltage. We use the a/d converter to find the value of this voltage which will tell us the distance that objects are away from the ir range sensor.

           Software loaded & hardware completely built. Let's test it out! Depending on the sensor you use, different output will be visible on the leds. Sensors to choose from: GP2D120, GP2Y0A21YK or GP2Y0A700K0F.