Raspberry Pi Logo.svg

Rocrail

RBD*

An Open Source, DIY Model Railroad Project

*Raspberry Block Detector

The Raspberry Block Detector is a stand alone or Roc-Pi integrated block detection system. It is an ideal and easy solution for the hobbyist that is starting to add block detectors to a Rocrail controlled layout with no additional controllers added to Rocrail.

While any block detection method could be used, I chose to use the current transformer type of detection because it is a zero loss system.

How it works.

The current detector is connected to one of the 16 channel I-O ports of one or more MCP23S17 chips. The MCP23S17 is connected to the Rpi's SPI bus. The SPI bus is capable of addressing 16 MCP23S17 devices for a total of 256 ports. The RBD software monitor (bdd) watches the ports and when triggered, sends a SRCP feedback message to a srcpd server. This server could be the internal Rocrail srcp server or any other server. Interrupt driven, the software consumes very little CPU time. The process bdd (Block Detection Daemon) is what runs in the background on the Rpi..