Pre-Compiled miniThrottle Relay

miniThrottle: A model railroad WiFi throttle.

What is it?

An example of a precompiled miniThrottle unit incorporating a 5V buck converter which allows the miniThrottle and DCC-Ex to be driven by the same 12 or 15 volt power supply at the trains.

It is a pre-configured and pre-compiled version of miniThrottle set to operate as a DCC-Ex relay. There isn't a precompiled version of miniThrottle as a throttle only at this stage. Calling it prebuilt is a bit of a misnomer as it is not a ready-to-run option. It is a pre compiled image. You still need to source your own hardware and assemble it yourself. But the firmware is ready to install, and assembly follows a recipe. As such it can be installed on a specific hardware configuation, which then allows:

The local throttle controls are optional, but may be useful in situations where you are attempting to run DCC with a minimum of additional "stuff". Where the additional "stuff" may include addional physical boxes and wired interconnects or simply installing a mobile phone app.

Note: This pre-compiled version is not suitable for a stand-alone / hand-held WiFi throttle. However it may work as either a relay and/or a tethered throttle.

While it is possible to connect the module directly to DCC-Ex, this is not recommended. Mounting the module on an Arduino prototyping board, requires slightly more effort and allows the module to be stacked on DCC-Ex.

If you wish to run on an alternative hardware selection or with different options then you may still compile from source code.

The example on right shows a precompiled miniThrottle unit incorporating a 5V buck converter which allows the miniThrottle and DCC-Ex to be driven by the same 12 or 15 volt power supply as the trains. This is built on a prototyping-hat that can be seated on top of your DCC-Ex modules.

Install a Pre-Compiled miniThrottle System

As a precompiled version, no compiler / Arduino-IDE is required. Some downloads are required as indicated below. And the Esp32 module is connected via a USB cable in order to flash the precompiled image to it.

By downloading from this site you accept the conditions of use.

  1. Start by downloading the ESP flash download tools. If you don't already have these and unzip the file to your pc. Note these tools are only available for Windows systems.
  2. Download the pre compiled image and unzip to a working directory. There are 3 variants of relay available as precompiled images as indicated below. This should contain files with memory location in their names which we will use at a later stage.
    NB: These images are still in testing use at own risk, some functions may not work:
    File NameSave AtFunction
    miniThrottle_bin/0x1000_bootloader.bin0x1000Boot loader
    miniThrottle_bin/0x8000_partitions.bin0x8000Partition table
    miniThrottle_bin/0xe000_ota_data.bin0xe000Over The Air (OTA) update data
    miniThrottle_bin/0x10000_miniThrottle.bin0x10000Program code

    zip FileDescriptionComments
    miniThrotPreBuild.zipRelay with local controls Display, Keypad, Potentiometer
    Local controls
    Up to 8 relay clients
    Web configurable
    programming track accessible though local controls
    miniThrotPreBuildNoCtrl.zipRelay with local display and no controls Display only
    Display shows status info
    Up to 8 relay clients
    Web configurable
    miniThrotPreBuildNoDisp.zipRelay with no local interface No local interface
    Up to 8 relay clients
    Web configurable
    May work with many Esp32 modules but only expected to work for the unit as shown here
  3. Connect the Esp32 module to your PC using a USB cable.
  4. Go to the folder containing the ESP flash download tools, and run the application. This opens both a control and a status window. The control windows are discussed below.
  5. initial control menu from ESP Tools In the window select processor type of ESP32, and develop mode. Factory mode would allow you to perform the install on to multiple units simultaneosly.
  6. Define files to upload in ESP Tools Now using the elipisis button next to the file names select the files you want to write to the Esp32 module. Note if the option is unchecked in the left column then that image file won't be written to the module. Copy the file location to the @ location. Other settings to look for are
    • SPI Speed = 40MHz
    • SPI Mode = DIO
    • Com port to match your USB com port
    • Speed = 921600 or less

    Once set you should be able to select start to flash the image to the module. The status window should show details and give an indication of progress. Once compete a blue Finished indicator will appear in the control window, and you can close the ESP tools window(s).

    After the image is burnt to the module, you should boot it before typing to access it. You will be able to access it using either the serial port (say using putty or TeraTerm terminal emulation) or using a web browser. Initially it on't have details of your local network, but the module will initially presnt a "dccStation" network which you can join. On this dccStation network connect to and if prompted for a password, your initial user is "admin" with a password of "secret". (without the quotes in either user name or password.)

Physical Connections

Wiring diagram for the pre-compiled miniThrottle

The module used can found by searching Google (or other search engines) using the term "esp32 oled", and purchased from AliExpress, Ebay, Amazon etc.

Left Hand Side
36 / SVP10k - 20k potentiometer centre / slider, pot pin 2 (any linear potentioneter in this range should be OK.)
25, 264 x 4 keypad, membrane type recommended, same keypad as pins 0, 2, 14, 12, 13 and 15.
S1, CM, SO, CLno connection - used to access internal memory
3Vpotentiometer high / fast side / pot pin 3
GNDpotentiometer low / slow side / pot pin 1
Right Hand Side
SVN, 39RX connect to DCC-Ex TX pin (via 5K resistor to DCC-Ex and 10K resistor to GND)
16TX connect to DCC-Ex RX pin
5, 4no connection - used by I2C connection of display
0, 2, 14, 12, 13, 154 x 4 keypad, membrane type recommended, same keypad as pins 25 and 26.
RX, TXno connection - same console connection as USB serial
GNDConnect DCC-Ex GND, common ground
5V5v supply from DCC-Ex

Note: If using this as WiFi relay only (ie no local controls) then the potentiometer and keypad connections are left disconnected. In this case you don't need a module with a display, as long as pins SVN (39) and 16 are available to connect to the DCC-Ex module.

In the config.h file of CommandStation-EX, you may want to check the following and reflash the CommandStation-EX module:

First Time Use

Time to customise the unit!

There are numerous customisations that can be set through the web interface as shown in the WiFi Options

You can configure the unit either via web page or connecting to the serial port. The serial port parameters are 115200 (speed), 8bits, no parity, 1 stop bit and no flow control. On a PC you need a terminal emulation such as Putty or TeraTerm-Pro and a USB cable attached to the miniThrottle device. It is assumed that for most users the web page will be the best option. However, the serial port option can still be useful if you have forgotten the admin password.

On the first start the unit should run an unsecured access point called "dccStation". No password is required. Connect to this access point and use your web browser to go to To access anything other than the status page you will need an admin password. This is initally a user of "admin" and a password of "mysecret", neither of which contain either quotes or capital letters. Now work through the various options to customise your miniThrottle device. See the web interface configuration page to review details, but here are some general comments.

The Keypad

There are 2 modes of keypad operation: menu mode and driving mode. Driving mode is used when contolling a locomotive.

Menu mode

The numeric keys can be thought of as acting as a directional control / arrow keyad, except when entering numbers such as a loco address. In this mode:

2, AGo up one option
8, BGo down one option
4, CGo to previous menu, or if at top menu refresh display
6, DGo into selected option
5, #Go into selected option

Note potentiometer is ignored in menu mode.

Driving Mode

0 - 9Functions 0 - 9
ASpeed up
BSpeed down
*Engage/Disengage potentiometer (allows keypad-only control)
#Locomotive menu, when speed is zero

In standard driving mode the extremes of the potentiometer represent stop and full speed. In bidirectional mode the potentiometer center position represents stop, while the extremes represent full speed in either forward or reverse.

Changing direction of a moving train will stop it.

The locomotives selection option is not expected to display if there is no track power. If it does not appear after applying power, you may need to refresh the menu using the back button, either 4 or C.

When removing locomotives in an in-throttle consist, you can only remove the lead loco if it is the last locomotive in the consist.

Thank you for visiting camelthorn.cloudHome