This post is part of the Rack Box Project series.

RS-232 interface module, with voltage measurement. Used to communicate with the emergency power off unit in the Rack box project. Installed inside Rack box status panel. Uses an AVR ATmega8 microcontroller.

Table of contents

Details

With this interface it’s possible to trigger and reset the emergency power off from Serial Client. The voltage on the 12V emergency supply is also measured and shown in Serial Client.

The module also registers if the emergency power off is triggered and gives the option of disabling the emergency strobe.

It has three LEDs and one two-way switch on the Rack box status panel, a yellow LED flashes when there is serial activity.

Two LEDs are dual colored (green/red), the color can be controlled from the computer. The switch can be set up using triggers in Serial Server.

Commands

Inputs

  1. Value from emergency supply 12V
  2. Emergency shutdown status
  3. Status on switch 1
  4. Status on switch 2

Outputs

  1. Trigger emergency shutdown (1 sec pulse)
  2. Reset emergency shutdown (10 sec pulse)
  3. Deactivate strobe (on/off)
  4. LED 1
    • 0: Off
    • 1: Green
    • 2: Red
  5. LED 2
    • 0: Off
    • 1: Green
    • 2: Red

I/O

Inputs

  1. PC0 - Emergency supply 12V voltage for volt meter
  2. PC1 - Emergency shutdown active (Emergency power off unit)
  3. PC2 - Switch 1
  4. PC3 - Switch 2

Calculations

Voltage

(ADC × 5) × 0.006 ≈ V ± 0.03 

Outputs

  1. PB0 - Trigger emergency shutdown (Emergency power off unit)
  2. PB1 - Reset emergency shutdown (Emergency power off unit)
  3. PB2 - Deactivate strobe
  4. PB3 - LED 1 Green
  5. PB4 - LED 1 Red
  6. PB5 - LED 2 Green
  7. PD6 - LED 2 Red
  8. PD7 - Activity LED
  9. PD5 - Life-signal (to Module stability monitoring unit 2) (opto-isolator)

D-Sub connector

See Rack box status panel for D-Sub connector.

Communication

Interfacing is done with RS-232, using MAX232 or MAX202 and the SIOS protocol.

Serial settings

  • Baud: 9600
  • Data bits: 8
  • Parity: None
  • Stop bits: 1

Source code

Photos

Circuit board complete, AVR microcontroller not yet installed
Circuit board installed in the Rack box status panel
Circuit board installed in the Rack box status panel

Schematic drawing

Schematics for the emergency power off serial interface

Parts list

  • 1 × AVR ATmega8-16PU, DIL-28, 16 MHz, 23 I/Os
  • 5 × Capacitor, aluminium electrolytic, 1 µF, 50V
  • 1 × Capacitor, aluminium electrolytic, 10 µF, 25V
  • 2 × Capacitor, aluminium electrolytic, 47 µF, 25V
  • 2 × Capacitor, ceramic, 1 nF, 100V
  • 2 × Capacitor, metallized polyester foil, 10 nF, (0.01 µF)
  • 1 × DIL socket, 16-pin, 7.62mm
  • 1 × DIL socket, 28-pin, 7.62mm
  • 1 × DIL socket, 6-pin, 7.62mm
  • 1 × Diode, small signal, 1N4148/Ph
  • 1 × Heat conducting film for heatsink, Adhesive, TO220
  • 1 × Heatsink, 15K/W @ 4W, 28mm 7g, TO220
  • 1 × Optocoupler, single, CNY17F-3, DIL-6
  • 32 cm2 PCB, stripboard, 100x160mm, 160cm2
  • 4 × Resistor, carbon film, 0.25W, 330 Ω, 5%
  • 4 × Resistor, carbon film, 0.25W, 4.7 kΩ, 5%
  • 3 × Resistor, carbon film, 0.25W, 10 kΩ, 5%
  • 1 × Resistor, carbon film, 0.25W, 100 kΩ, 5%
  • 1 × Resistor, metal film, 0.6W, 20 kΩ, 1%
  • 1 × RS232 interface, MAX232CPE, dual
  • 1 × Spacer, round unthreaded, 3mm, Ø6mm, Delrin
  • 17 × Straight pin header, female, Single row, 2.54mm
  • 24 × Straight pin header, male, Single row, 2.54mm
  • 3 × Transistor, NPN, 100 mA, 45V, 0.5W, BC547B
  • 1 × Voltage regulator +5V, 1 A, 7805PI

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


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