Mute and illumination controlling unit
From uCtrl.net
| The Rack box project is being discontinued! I am moving to a new location, and therefor terminating the Rack box project, my plan is to build an even bigger system based on slot-in cards in a full size rack. I'll keep you posted. Feel tree to leave a comment if you have any question. |
MICU, driven by AVR ATTiny2313.
Contents |
Information
MICU takes care of misc 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 affected manually with a switch, the light is then active for 30 minutes but is turned off if the door is closed. Door N.O and N.C signal is 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 Status panel. Mute can be affected manually or with the computer, using the Serial I/O system. A timer automatically sets the system in mute at night.
Weekdays mute is activated at 11PM and deactivated at 9AM. In the weekend it's activated 1AM and deactivated 11AM.
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
- Mute switch
- Mute auto signal from timer
- Light switch
- Door switch
Outputs
Wires
Side
- Red 5V+
- White 0V
- Black Lifesignal (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)
Images
Testing with SIM6IO |
Capacitors installed |
PCB under |
|
24V supply, mute and away relay |
Lights inside the Rack box |
MICU installed in the Rack box |
Schematic drawing
Source code
The program is written in basic, using Bascom-AVR.
'-------------------------------------------------------------- ' Thomas Jensen '-------------------------------------------------------------- ' file: AVR_MICU ' date: 20/04/2006 '-------------------------------------------------------------- $crystal = 500000 Config Portd = Input Config Portb = Output Config Watchdog = 1024 Dim Lifesignal As Integer Dim Lystimer As Integer Dim Muteled As Integer Dim Dor As Integer Dim A As Byte Lifesignal = 21 Lystimer = 0 Muteled = 0 Dor = 0 Portb = 0 'boot For A = 1 To 20 Portb.4 = Not Portb.4 Portb.6 = Not Portb.6 Waitms 250 Next A Waitms 1000 Start Watchdog Portb = 0 Main: Portb.2 = Pind.3 'door switch Portb.3 = Not Pind.3 If Pind.2 = 0 And Lystimer = 0 Then Lystimer = 18000 'lights timer If Pind.2 = 0 And Lystimer < 17975 Then Lystimer = 15 If Pind.3 = 0 Then Lystimer = 0 If Pind.3 = 1 Then If Dor = 0 Then Lystimer = 3000 Dor = 1 End If End If If Dor = 1 And Pind.3 = 0 Then Dor = 0 If Lystimer > 0 Then 'set light Lystimer = Lystimer - 1 Portb.1 = 1 End If If Lystimer = 0 Then Portb.1 = 0 If Pind.1 = 0 Then 'mute relay If Muteled = 0 Then Muteled = 10 Portb.0 = 1 End If If Pind.0 = 0 Then If Muteled = 0 Then Muteled = 5 Portb.0 = 1 End If If Pind.0 = 1 And Pind.1 = 1 Then Portb.0 = 0 End If If Muteled = 3 Then Portb.4 = 1 'mute led If Muteled = 1 Then Portb.4 = 0 If Muteled > 0 Then Muteled = Muteled - 1 If Lifesignal > 0 Then Lifesignal = Lifesignal - 1 'lifesignal If Lifesignal = 6 Then Portb.5 = 1 If Lifesignal = 1 Then Portb.5 = 0 If Lifesignal = 0 Then Lifesignal = 21 Reset Watchdog 'loop cycle Portb.6 = 1 Waitms 25 Portb.6 = 0 Waitms 75 Goto Main End