This post is part of the Rack Box Project series.

Simple monitoring module for the essentials in the rack box project; power supplies, fuses and communication. Uses an AVR AT90S2313 microcontroller.

Table of contents


This was the first AVR microcontroller module I ever built, it was made for, and installed in the rack box project. As the name suggests it monitored that the essentials were OK, that means power supplies, fuses and communication. It used optocouplers to detect if the 5 or 12 V power supply failed, but depended on other modules for the fuse, emergency supply and communication failure.

When a situation were detected the corresponding LED would flash, and there was a sound signal. These LED outputs were later also used to notify other modules, like the controller for the stack lights and the sound signals. So it was a daisy chain of connected inputs and outputs.

One problem with monitoring the 12 V power supply was that this module needed 12 V to work… So it bypassed the 12 V main fuses, but if that supply failed completely the monitoring module would also fail. And thus no alarms, it wasn’t really a bullet-proof solution 😛

Alarm situations

Alarm situation diagram

Server timeout

To make sure my Linux server was present, responding and the I/O module was OK; a heartbeat signal was sent every 60 seconds. If this signal went silent for over 310 seconds, meaning 5 minutes and a bit, the server was regarded as timed-out and the alarm triggered.

Emergency supply failure

Without the emergency supply voltage the emergency stop would not work, so that was important. A N.C relay was connected to this supply, and if the supply dropped the relay would activate the emergency failure input.

Power supply failure

The 5 and 12 V supply were monitored with internal optocouplers, so if any voltage or polarity was dropped; it was detected by the module. When a 24 V power supply was added later; an additional optocoupler was installed between 5 V ground and the monitoring module input.

Fuse error

The detecting of broken fuses happened in the fuse boxes (this and this), they sent a signal when a fuse broke which caused this module to sound the alarm.

Try and try again

This being the my very first AVR microcontroller project, it took a bit of time to get it to work and I made some schematic mistakes. That’s why you can see a few extra strip boards stuffed into the box in the images, I used the wrong resistor values for all the inputs and had to redo those. That was also when I added the optocouplers.


In retrospect I don’t think the module was very useful, but it was a fun learning experience back then. If a main power supply fails, it is going to have a big impact. Like if the 5 V supply failed, all microcontrollers would stop. Meaning no controller would be alive to receive the error signal.

If the 12 or 24 V supply dies there would be no horn, sirens or lights to show the error. So it seems that the best option for a monitoring module like this would have been to have been completely self sufficient, own warning lights, horns etc. And a battery failover. Maybe next time 🙂



  1. Server heartbeat
  2. Fuse error (N.O)
  3. Emergency supply failure (see Emergency shutdown unit) (N.O)
  4. 5V supply (N.C)
  5. 12V supply (N.C)


  1. Buzzer (not in use)
  2. Error signal (to Signal and lights controlling unit)
  3. Fuse error LED
  4. Supply failure LED
  5. Life-light (built-in LED)
  6. Life-signal to Module heartbeat monitor
  7. Server timeout LED


  • Yellow 12V+
  • Blue 0V
  • Black Server life-signal (in)
  • Red Fuse error (in)
  • Purple Emergency supply failure (in)
  • Green 5V+ supply (to opto-isolator)
  • White 5V- supply (to opto-isolator)
  • Orange 12V+ supply (to opto-isolator)
  • Brown 12V- supply (to opto-isolator)
  • Green Buzzer (out)
  • Yellow Error signal (out)
  • Orange Fuse error (out)
  • Grey Supply failure (out)
  • Brown Life-signal (out)
  • Cyan Server timeout (out)

Source code


Assembly; strip boards cut to size
Started soldering and installing strip boards
Testing the module
Testing the module
Inside module, with Norwegian labels
Module installed in the Rack box project
Module installed in the Rack box project
Close-up of the power board
Close-up of the AVR microcontroller
Inside the module

Schematic drawing

Schematics for the monitoring module

Parts list

  • 1 × AVR AT90S2313-10PI, DIL-20, 10 MHz, 15 I/Os
  • 1 × Capacitor, aluminium electrolytic, 10 µF, 25V
  • 2 × Capacitor, aluminium electrolytic, 22 µF, 25V
  • 2 × Capacitor, ceramic, 22 pF, 100V
  • 1 × DIL socket, 20-pin, 7.62mm
  • 2 × DIL socket, 6-pin, 7.62mm
  • 1 × Enclosure, plastic (1591 FL), 150x80x50mm, flange
  • 2 × Fuse 5x20 mm, 400 mA, fast-acting
  • 2 × Fuse holder, open, PCB, 5x20mm
  • 1 × LED 5mm coloured clear, Green, 2.1V, 20mA, 30mcd, 10°
  • 1 × LED holder 5mm, RNG 268, Fixing ring
  • 2 × Optocoupler, single, CNY17F-3, DIL-6
  • 128 cm2 PCB, stripboard, 100x160mm, 160cm2
  • 1 × Quartz crystal oscillator, 4 MHz
  • 5 × Resistor, carbon film, 0.25W, 330 Ω, 5%
  • 9 × Resistor, carbon film, 0.25W, 4.7 kΩ, 5%
  • 5 × Resistor, carbon film, 0.25W, 10 kΩ, 5%
  • 3 × Resistor, metal film, 0.6W, 1 kΩ, 1%
  • 1 × Switch, push-button, PCB, 1-pole, H4.3mm, vertical, black
  • 1 × Terminal block, pluggable, 3.5 mm, 2-pin screw female
  • 1 × Terminal block, pluggable, 3.5 mm, 2-pin vertical male
  • 1 × Terminal block, pluggable, 3.5 mm, 4-pin screw female
  • 1 × Terminal block, pluggable, 3.5 mm, 4-pin vertical male
  • 8 × Transistor, NPN, 100 mA, 45V, 0.5W, BC547B
  • 1 × Voltage regulator +5V, 2 A, L78S05CV

Last commit 2023-12-25, with message: replace emoji slight_smile/slightly_smiling_face

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