This post is part of the Rack Box Project series.

Controlling mute and lights in the rack box project. Uses an AVR ATtiny2313 microcontroller.

Table of contents

Details

This simple controller takes care of a few small tasks in the Rack box. It controls the system mute function, the lights inside, and the door sensor of the Rack box.

When the door is opened the light turns on automatically, and stays on for five minutes. The light can also be turned on manually with a switch, the light is then active for 30 minutes, or until the door is closed. Door N.O and N.C signals is made available for other modules.

Mute

When system mute (quiet mode) is active, sound alarms and the stack light is deactivated. Errors are only shown in Serial Client and on the Rack status panel. Mute can be enabled manually or with the computer, using the Serial I/O system. A timer automatically enabled the system mute at night.

On weekdays; mute is activated at 11 PM and deactivated at 9 AM. In the weekend; it is activated at 1 AM and deactivated 11 AM.

Crontab example for Linux:

01 23 * * 0-4 root /var/www/ctrl_files/turn_port 4 1 #weekday on
01 01 * * 0,6 root /var/www/ctrl_files/turn_port 4 1 #weekend of
01 09 * * 1-5 root /var/www/ctrl_files/turn_port 4 0 #weekday off
01 11 * * 0,6 root /var/www/ctrl_files/turn_port 4 0 #weekend off

I/O

Inputs

  1. Mute switch
  2. Mute auto signal from timer
  3. Light switch
  4. Door switch

Outputs

  1. Mute relay
  2. Lights
  3. Door N.O
  4. Door N.C
  5. Mute LED
  6. Life-signal to Module heartbeat monitor
  7. Life-light

Wires

Side

  • Red 5V+
  • White 0V
  • Black Life-signal (out)

Bottom

  • Yellow Mute switch (in)
  • Green Mute auto signal (in)
  • Orange Light switch (in)
  • Brown Door switch (in)
  • Red Mute relay (out)
  • Blue Lights (out)
  • White Door N.O (out)
  • Black Door N.C (out)
  • Black (clear) Mute LED (out)

Source code

Photos

Rack box light
Rack box door sensor
Circuit board in plastic enclosure
Backside of circuit board
Testing the module logic
Door LED; mute switch, LED and relay; light button; in the rack box
Module mounted in the rack box
Installing stabilizing capacitors
Inside the module
Inside the module

Schematic drawing

Schematics for the mute and light controller

Parts list

  • 1 × AVR ATtiny2313-20PU, DIL-20, 20 MHz, 18 I/Os
  • 1 × Capacitor, aluminium electrolytic, 10 µF, 25V
  • 2 × Capacitor, ceramic, 22 pF, 100V
  • 1 × Capacitor, ceramic, 1 nF, 100V
  • 1 × DIL socket, 20-pin, 7.62mm
  • 1 × Enclosure, plastic (1591 FL), 100x50x25mm, flange
  • 1 × LED 5mm coloured clear, Green, 2.1V, 20mA, 30mcd, 10°
  • 1 × LED holder 5mm, RTC51, black plastic
  • 32 cm2 PCB, stripboard, 100x160mm, 160cm2
  • 1 × Quartz crystal oscillator, 4 MHz
  • 5 × Resistor, carbon film, 0.25W, 330 Ω, 5%
  • 7 × Resistor, carbon film, 0.25W, 4.7 kΩ, 5%
  • 4 × Resistor, carbon film, 0.25W, 10 kΩ, 5%
  • 6 × Transistor, NPN, 100 mA, 45V, 0.5W, BC547B

Last commit 2024-11-11, with message: Add lots of tags to posts.

Rack Box Project series
All posts in Rack Box Project series
  1. Parallel port I/O module
  2. Power supply and fuse monitoring module, AVR
  3. Monitored fuse box, 6 channels
  4. Stack lights and horn controller — with AVR
  5. Mute and light controller for the Rack box — AVR module
  6. Monitored fuse box, 4 channels
  7. Module heartbeat monitor, 6 inputs — AVR
  8. Controller for lights and relays — AVR driven
  9. Emergency power off controller — controlled by 555 timers
  10. Fan controller with LCD — AVR powered
  11. Sound alarm control unit — AVR module
  12. Multiplexer output extender
  13. Multi-purpose AVR module
  14. Electric heater and timer controller — AVR
  15. Module heartbeat monitor, 15 inputs — LCD and AVR
  16. Serial port I/O module with 11 inputs — AVR
  17. Serial port I/O module with 9 in and outputs — AVR
  18. Serial interface for emergency power off — AVR
  19. Status panel for the Rack box project
  20. Intruder alarm system controller — AVR
  21. Serial port I/O module with 15 inputs — AVR
  22. Serial interface module, with analog and digital I/O — AVR
  23. The rack box project — an overview