This assignment is the embedded design for a garage door control using the chipKIT™Pro MX7 processor board.
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.
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.
- Use the following files for HW assignment:
- All buttons function as momentary contact pushbuttons.
- BTN1—UPLS input = 1
- BTN2—DNLS input = 1
- BTN1 and BTN2 simultaneously pressed—SAFETY BEAM = 1
- BTN3—OPERATE BUTTON input = 1
- LED Assignments:
- LEDA—Motor running up—door is opening
- LEDB—Motor running down — door is closing
- LEDC—Door is fully open
- LEDD—Door is fully closed
- 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.
- 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.
- 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.
- If the door reaches the bottom (DNLS = 1) while closing, the motor will stop, causing LEDD to turn on and LEDB to turn off.
- 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.
- If the light beam is interrupted (SAFETY BEAM = 1) while the door is opening, then the door continues opening.
- 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).
- 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).
- 50 ms switch contact debouncing is required for all inputs.
- 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.)