Garage Door Controller

Design Challenge, Problem 2

Garage Door Controller

Design Challenge, Problem 2

This assignment is the embedded design for a garage door control using the chipKIT™Pro MX7 processor board.

Operations Requirements

UPLS—When the door is at the top, this input is true.

DNLS—When the door is at the bottom, this input is true.

Safety BEAM—There is a light beam that runs across the doorway and is detected by an electric eye. When the electric eye detects the light beam, this input is true. If the light beam is blocked, such as by a small child standing in the doorway, then this input is false.

OPERATE BUTTON—When the button on the remote control is pressed, this input becomes true. When the button on the remote control is released, this input becomes false.

Operations Requirements

RunUp—When this output (LEDA) is true, the motor moves the door upward to open it.

RunDown—When this output (LEDB) is true, the motor moves the door downward to close it.

If both RunUp and RunDown are false, then the motor will be stopped. The RunDown and RunDown outputs should never both be true at the same time to avoid damaging the motor.

Functional Specifications

  1. Use the following files for HW assignment:
    1. config_bits.h
    2. chipKIT_Pro_MX7.h
    3. chipKIT_Pro_MX7.c
  2. All buttons function as momentary contact pushbuttons.
    1. BTN1UPLS input = 1
    2. BTN2DNLS input = 1
    3. BTN1 and BTN2 simultaneously pressed—SAFETY BEAM = 1
    4. BTN3OPERATE BUTTON input = 1
  3. LED Assignments:
    1. LEDA—Motor running up—door is opening
    2. LEDB—Motor running down — door is closing
    3. LEDC—Door is fully open
    4. LEDD—Door is fully closed
  4. If the door is closed (LEDD is on), pressing the button (OPERATE BUTTON = 1) causes the door to begin opening, causing LEDA to turn on and LEDC to turn off.
  5. If the door reaches the top (UPLS = 1) while opening, the motor will stop (LEDA off) and LEDC, the door fully open indication, is turned on.
  6. If the door is open (LEDC on), pressing the button (DNLS = 1) causes the door to begin closing, causing LEDB to turn on and LEDD to turn off.
  7. If the door reaches the bottom (DNLS = 1) while closing, the motor will stop, causing LEDD to turn on and LEDB to turn off.
  8. If the electric eye detects that the light beam has been interrupted (SAFETY BEAM = 1) while the door is closing (LEDB on), the door will reverse direction and begin opening by turning LEDA on.
  9. If the light beam is interrupted (SAFETY BEAM = 1) while the door is opening, then the door continues opening.
  10. Pressing the button (OPERATE BUTTON = 1) while the door is opening causes the door to stop (LEDA and LEDB off). Pressing the button again (OPERATE BUTTON = 1) causes the door to begin closing (LEDB on).
  11. Pressing the button (OPERATE BUTTON = 1) while the door is closing causes the door to stop (LEDA and LEDB off). Pressing the button again (OPERATE BUTTON = 1) causes the door to begin opening (LEDA on).
  12. 50 ms switch contact debouncing is required for all inputs.
  13. Only one operation is permitted per OPERATE button press. (An OPERATE button press will only cause one operation. It must return to the inactive condition before the OPERATE will cause a new action.)


  • Other product and company names mentioned herein are trademarks or trade names of their respective companies. © 2014 Digilent Inc. All rights reserved.