I have started migrating content to my Hugo blog at https://blog.cavelab.dev, already migrated pages will redirect there.

Module heartbeat monitor with 15 inputs and LCD

From CaveLab
This page is kept for historical interest. It may document projects or methods that are obsolete and/or no longer relevant. The information here is not kept up-to-date.

This module was part of the rack box project — which was terminated when I moved out of my first apartment.
MSMU2 installed in the Rack box

Detects and alerts if any of the monitored modules goes silent; meaning their heartbeat stops. Uses an AVR AT90S8515 microcontroller.


As I started putting more and more modules into my rack box project, the previous monitoring module quickly ran out of inputs. I needed to build something bigger and better. I realized that using LEDs to show module status just wasn't practical as the number of inputs increased. So this unit shows the module statuses on an LCD display instead, and has 15 inputs.

If you've read about my first module heartbeat monitor you already know why I built it, if not; here is a recap: I needed a way to know that the modules inside the rack box project were not only powered, but running. Monitoring their heartbeat output was the solution.

If more than 10 seconds passed, without receiving a heartbeat this monitor unit would go into alarm state. A blue LED would flash, and the LCD display would show which module failed.

10 FAIL!

All alarms had to be manually reset, even if the heartbeat came back. The reason for this was so that I would see it if a module had been dead for some time, but came back by itself. This would still indicate a problem with that module. If a heartbeat was not detected at all after a reset, that input was marked as inactive and #n/a was shown on the LCD. Inactive inputs did not produce alarms.

4  #n/a

The remaining time was also shown on the LCD display, it was split into half seconds; so 20 meant that there was 10 seconds left.

1  Ok>20




  • PA2 Module 1
  • PA3 Module 2
  • PC2 Module 3
  • PC3 Module 4
  • PC4 Module 5
  • PC5 Module 6
  • PC6 Module 7
  • PC7 Module 8
  • PD0 Module 9
  • PD1 Module 10
  • PD2 Module 11
  • PD3 Module 12
  • PD4 Module 13
  • PD5 Module 14
  • PD6 Module 15
  • PD7 Reset



D-Sub 9-pin

  1. 5v
  2. 0v
  3. Reset
  4. Module error LED

D-Sub 15-pin

  • Module 1 → 15

LCD display

I used a broken LCD display on this module, of the 16 characters on the display only the first 8 worked. Below are the different messages and statuses shown on the display.

1  Ok>21
4  #n/a
10 FAIL!

Source code

Bascom-AVR source is available in a git repository:


Schematic drawing


Parts used

Qty. Part
1 × AVR AT90S8515-8PC, DIL-40, 8 MHz, 32 I/Os
1 × Capacitor, aluminium electrolytic, 10 µF, 25V
2 × Capacitor, ceramic, 22 pF, 100V
1 × Capacitor, ceramic, 1 nF, 100V
1 × D-sub soldering cups, 15 pin female
1 × D-sub soldering cups, 9 pin male
1 × DIL socket, 40-pin, 15.24mm
2 × Diode, small signal, 1N4148/Ph
1 × Enclosure, plastic (1591), 120x80x59mm
1 × Fuse 5x20 mm, 500 mA, fast-acting
1 × Fuse holder, open, PCB, 5x20mm
1 × Fuse holder, open, PCB, Protective cover
1 × LCD display, dot matrix, 16x1, LED green
1 × LED 5mm clear, Blue, 4.9V, 20mA, 350mcd, 12°
1 × LED 5mm clear, Green, 2.1V, 20mA, 385mcd, 6°
2 × LED holder 5mm, RTC51, black plastic
2 × Mounting bracket, DIN rail, Metal
1 × Quartz crystal oscillator, 4 MHz
1 × Resistor, carbon film, 0.25W, 120 Ω, 5%
18 × Resistor, carbon film, 0.25W, 330 Ω, 5%
2 × Resistor, carbon film, 0.25W, 4.7 kΩ, 5%
16 × Resistor, carbon film, 0.25W, 10 kΩ, 5%
1 × Switch, push-button, 1-pole, 1A, 50VAC, off-(on)
1 × Switch, toggle, 1-pole, micro, on-on
1 × Transistor, NPN, 100 mA, 45V, 0.5W, BC547B
1 × Trimmer, carbon, 10 kΩ, horizontal