Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Introduction

The delayed shutdown module provides a means to delay power-off of your Raspberry Pi in conjunction with an SDC I/O hat. This enables the device to close down properly, save its state, close any datalog files, and gives a nice key-off sequence showing the boot screen, which you can change to your own image using SDC Tools.

Connections

When connecting to screw terminals on both the I/O hat and the delay module, make sure you put enough torque into the screws otherwise they may work themselves loose. However, when tightening the terminals make sure you hold them with your fingers to avoid putting torque through the solder connections on the underside. I recommend using a flat screwdriver that is the largest that will fit in the screw slots. Posi-style cross head screwdrivers tend to slip out easily.

Make the following connections:

  • Connect a permanent fused +12v to the input labelled VCC.
  • Connect a battery ground to the input labelled GND.
  • Connect an ignition key switched +12v source to the input labelled SVCC.
  • Connect the lower right hand side output terminal to the BAT 12V main power input on the I/O hat. This will power on the hat and your Pi when the relay is triggered.
  • The SIG pin and the relay’s common input pin are connected for you on the underside; you do not need to connect anything to them.

In addition to this, you will require the following connections on your I/O hat:

  • A permanent battery ground
  • Your 3 serial connections (ECU TX, PI TX, ECU GND)
  • A +12v switched ignition source

The permanent +12v connection taken directly from the battery should be fused. 5A is sufficient.

Operation

When you connect VCC and GND, the module will turn on for a couple of seconds and then turn off again. Once this has occurred, the module will only turn on when the trigger (SVCC) receives +12v, and will turn off when the SVCC signal is removed by turning off the ignition.

When +12v is removed from SVCC, the delay module will switch into shutdown mode. This makes it wait for a short period of time before disengaging the power relay. The time it waits for can be controlled by altering the potentiometer. Turn it anticlockwise to lengthen the time and clockwise to shorten it. When it arrives it will be set for approximately 3 seconds. Normally this is the minimum you would want to set it to in order for SDC to safely perform its shutdown activities before the power is removed.

Software Configuration

To enable controlled shutdown within SDC, you will need to configure an input in the SDC.INI file. From SDC Tools, connect to the device and Press the “Edit ini file…” button. Scroll down the file until you find the section labelled [buttons]. You should find a line that says:

;shutdownbutton=13.pd,shutdown

The semicolon signifies that the line is a comment. Remove the semicolon from the beginning of the line to convert it from a comment to an actual setting, and press OK. The file will be saved back to the device.

You will need to restart the device for the configuration to take effect.

Powering Other Devices

The relay on the shutdown module is rated for 10A but I would not recommend going beyond about 5A. A typical I/O hat / Pi / 7” Screen combination requires about 1.2A depending upon the screen. You can use the +12v output from the module (the bottom right connection in the image above) to power other devices in parallel with the hat, but you will of course require a voltage regulator in front of each device according to its requirements.

If you need to power a screen that uses a USB cable you can use an inline USB switched mode power supply that has 12v input on one side and a USB port for the output. These are very small (just slightly larger than the USB port itself) and can be integrated easily into the end of a short wiring harness with a bit of heat shrink. Take the 12v input for the supply from the delayed shutdown module’s power output. My own installation uses this method.