OBU Hardware


The final version 1.0 of the OBU hardware includes following elements:

  • Power supply
  • Micro processor with Radio module (JeeNode)
  • Balise reader (TAG-reader)
  • Nominel direction detection
  • Odometer
  • Traction power control
  • Head light control

OBU Hardware Overview

The diagram to the right provides an overview of the OBU hardware. Each part will be described in the next. The circuit diagram of the final OBU hardware can be found at the bottom of the page. Component references are referring to this diagram.

Power supply and direction detection

The idea of installing a controller in each train, allows for individual direction and speed control independent of the polarity and tension of the traction power in the rails. However, in order to make driving direction unambiguous, the polarity of the traction power will be fixed. In this way, the positive rail will define the right hand side of the track, when driving in direction up.

A bridge rectifier (U2) is included in the power supply of the train. This makes the power supply independent of whether the right side wheel is at the positive or negative rail.

Due to the poor wheel-rail contact, the power available at the train is quite unreliable. Diode D2 and the large capacitor C3 provides a stable power supply for the JeeNode, keeping the JeeNode running for several seconds after a power failure. As an option, a battery can be connected as well. Diode Z1 prevents this battery from being charged by the power supply.

A DC/DC converter (U1) provides +5V for the controller circuit, JeeNode and tag reader.

Nominal driving direction

The circuit consisting of Z4, R3, R4 and C4 will detect if the wheel at the right side of the train is positive. In this case, Z4 will block the current in R4, leaving the input of the JeeNode at 3.3V. If the right hand side wheel is at 0V, Z4 will allow a current in R4, leaving a low voltage at the JeeNode input. Note, that JeeNode pin A0 is used as a digital input. The 3.3V supply for this circuit is taken from the build-in 3.3V supply of the JeeNode.

Traction power control

LGB locomotives are equipped with a normal DC motor allowing for simple PWM control of the speed. The PWM signal is taken directly from the JeeNode and feed to a MOS-FET (Q4). A normal relay (K1) is used to select the rotation direction of the motor.

During the first test runs, the motor generated an audible noise equal to the PWN frequency of the JeeNode, which is 400 Hz. Due to this, the PWM frequency was changed to 62.5 kHz (Ref. Arduino PWM Cheatsheet).


A JeeNode was selected as the controller of the OBU. It has the advantage of including a small radio module, 3.3V power supply and necessary support hardware on a quite small foot print.

Balises and balise reader

As balises for the Winter Train standard RFID “keyfob” tags used for access control will be used. Key ring tags fits nicely between the rails of the track (see photo), even if the scaled size is not correct (real balises are smaller). Sush tags and the associated readers are readily available from the net. For the Winter Train, tags of type 125kHz Proximity Access Tags Keyfobs EM4102 and reader of type RDM6300 125KHz (ID) RFID reader module, was selected.

Antenna location

In order for the OBU to read the tag, an antenna is mounted under the train. An obvious position for the antenna is under the front of the locomotive as close to the track as possible. This will relate the position of the balise to the front of the train. However, during the first test runs, it turned out, that balise reading was much less reliable when the train was going backwards compared to driving forwards.

The tag is a passive device, that gets its energy from the tag reader. The frequency (125 kHz), used by the tag reader to transmit energy to the tag, is the double of the PWM frequency (62.5 kHz) used by the traction controller. When driving forwards, the antenna will be located over the tag first activating the tag. When driving backwards, the motor will be located over the tag before the antenna is over the tag. Hence is it likely that the electromagnetic field from the motor partly will activate the tag.

Balise reader

The solution was to move the tag reader antenna to under the first wagon after the locomotive.

TAG-reader interface

The chosen tag reader provides the content of the read tag (the ID) via a standard serial interface. In order to allow for debugging via the FTDI serial interface of the JeeNode, the tag reader was not connected to the FTDI interface, but to a normal digital input. The Arduino library SoftwareSerial was used to read the serial data from the tag reader.

However, this setup was quite unreliable, if useable at all. After running for a while, the main loop of the JeeNode simply stopped running. In some cases the loop started again after maybe half a minute, in other cases a reset was necessary. After some trial and error testing, the tag reader was connected to the FTDI interface, elimination the need for the SoftwareSerial library. This solved the problem, so apparently the SoftwareSerial library and the JeeNode library are interfering with each other.



The first idea to determine the (relative) position of the train, was to calculate the actual driving distance based on the speed of the motor (in fact the PWM signal). This turned out to completely unreliable, partly due to varying friction. Instead a wagon was equipped with a simple tachometer consisting of two small magnets mounted at a wheel axle and a reed contact fixed over the axle (see picture).


In order to turn on the right head light (front or back) depending on the driving direction, two open collector outputs were included in the OBU.

Prototype OBU

As the available space in a LGB locomotive is limited and in order to allow for testing, the very first prototype of an OBU vas installed on top of a fraight waggon attached to the locomotive. In order to control the motor power, the original power circuit was disconnected. Instead wire connections to the wheels and to the motor was brought out.

The blue PCB in the middle is the JeeNode with (hidden) connectors to the main PCB. This is holding the motor controller and power supply. The small green PCB to the left is the TAG-reader circuit.


OBU Circuit Diagram

it/wintertrain/implementation/obu/obuhw.txt · Last modified: 2017/09/25 18:00 by jabe