Last Updated: 14/01/2026

Projects & Components

A look at Arduino projects and some of the thought process behind them.

As a lot of the projects I have built are linked to Model Railway Control I have split the projects into 2 sections.

Non Model railway Projects

Model Railway Projects

Model Railway Control and Effects

Button controlled Indexing turntable Code
This project shows how to use an Arduino UNO R3 or Arduino Mega 2560 to create a button controlled indexing turntable for DCC or analogue layouts.
In this example the Peco turntable has been used but the code can be used on any turntable.

Stepper Motor Driver

Although the A4988 is used in the example the 2208 was used on the finished turntable and was quieter and had more torque so is recommended.

 

 

Download the code for this project

PButton controlled Indexing turntable Circuit

Useful resources

Stepper motor Lessons 30-32

24LC256 External EEPROM

DCC Indexing turntable Code
This project shows how to use an Arduino UNO R3 or Arduino Nano v3 (Original style Nano with ATmega328 chip) to create a DCC controlled indexing turntable.
In this example the Peco turntable has been used but the code can be used on any turntable.

Stepper Motor Driver

Although the A4988 is used in the example the 2208 was used on the finished turntable and was quieter and had more torque so is recommended.

DCC Decoder circuit Diode is a 1N4148

 

Download the code for this project

Peco DCC Indexing turntable Circuit
DCC Decoder circuit Diode is a 1N4148

Useful resources

Stepper motor Lessons 30-32

24LC256 External EEPROM

DCC Decoder Circuit

Arduino Uno with GT911 Capacitive Touch Screen
This lesson shows how to use a GT911 Capacitive Touch screen as a control panel.

The sketch shows how to use the GT911 for a single touch point.
The final sketch will use the touch points to control servo positions.

The code works with the Arduino Uno (via a level shifter) or ESP32 Dev module.

It will also run on the Mega 2560 (Level lifters required) or the 3.3v Arduino Due although The SDA pins will be in different positions on the boards.

Download the code for Lesson

Component Links

Touch Screen must be GT911 6 Pin I2C

Ribbon Cable Connector


I2C Safe Level Shifter (UK)

I2C Safe Level Shifter (USA)

Connections

WARNING WARNING WARNING WARNING
GT911 Capacitive touch screens are 3.3v. To use with an Arduino Uno Level lifters must be used on all communication pins.

GT911 Arduino Uno ESP32 Dev Module
RST Via Level Shifter Pin 8 5
INT Via Level Shifter Pin 2 2
SDA Via Level Shifter A4 21
SCL Via Level Shifter A5 22
GND GND GND
VDD 3.3V 3.3v

#146 Arduino C++ Interlock++ Model Railway signalbox interlocking system

Interlock++ Model Railway interlocking signalbox
MOdel railway servo setter

How to set up the movement of servos for turnout control of Kadee uncoupler.

This project allows the movement of the servo to be set using the potentiometer with the position displayed in the Serial Monitor and the optional LCD screen.

This lesson uses code from the Arduino C++ Course

Lesson 6 AnalogRead()

Lesson 10 Servos

Lesson 17 1602A I2C LCD Screen

STL files for download

Turnout Servo Mount

Kadee Uncoupler

Download the code for Lesson

Click image for larger version
Arduino Servo setter Circuit

Model Railway servos part 2, servo speed

NOTE: An extra sketch servoMove7 has been added to the zip file.
This sketch has 2 extra lines in the setup() that preset the servo position to the 90 degrees position.
This prevents the servo jumping to zero at the start of the first movement.
Check the READ_ME file for details.

This lesson covers servo speed control using millis() and micros() for timing and sero.write() and servo.writeMicroseconds() for position.

This lesson allows the movement of multiple servos at the same time moving in sync or own their own.

This lesson uses code from the Arduino C++ Course

Lesson 3 Controlling Timings with millis()

Lesson 10 Servos

STL files for download

Turnout Servo Mount

Kadee Uncoupler

Download the code for Lesson

Click image for larger version
Arduino UNO basic servo circuit

Model Railway servos part 3, PCA9685 Driver Board

This lesson shows how to use single or multiple PCA9685 servo driver boards.

The sample sketches show how to use control speed individually or together.

This lesson allows the movement of multiple servos at the same time moving in sync or own their own.

Issues covered include power supply and the limits of the I2C data bus.

This lesson uses code from the Arduino C++ Course

Lesson 3 Controlling Timings with millis()

GS-1502 Linear servo

STL files for download

Turnout Servo Mount

Kadee Uncoupler

Download the code for Lesson

Click image for larger version
Arduino PCA9685 servo circuit

Model Railway Momentary switches

This lesson shows how to create a function that will read multiple momentary switches.

The sketch is then combined with the previous servo control sketches to create different ways to control servos connected directly to the Arduino or via a PCA9685 servo driver board.

Servos Part 2 Servo Speed Control

Servos Part 3 PCA9685 servo driver board

Lesson 3 Controlling Timings with millis()

Lesson 4 DigitalRead(), debouncing buttons and pull down resistors

STL files for download

Turnout Servo Mount

Kadee Uncoupler

Download the code for Lesson

Click image for larger version
Arduino buttons servos and PCA9685 control panel circuit

Model Railway latching or toggle switches

This lesson shows how to create a function that will read multiple latching switches often known as toggle switches.

The sketch is then combined with the previous servo control sketches to create different ways to control servos connected directly to the Arduino or via a PCA9685 servo driver board.

Servos Part 2 Servo Speed Control

Servos Part 3 PCA9685 servo driver board

Lesson 3 Controlling Timings with millis()

Lesson 4 DigitalRead(), debouncing buttons and pull down resistors

STL files for download

Turnout Servo Mount

Kadee Uncoupler

Download the code for Lesson

Click image for larger version
Arduino latching swirches servos and PCA9685 control panel circuit

Model Railway Stud and Probe and wire in tube turnout control

This lesson covers a couple of old simple to implement turnout control systems using wire in tube and stud and probe.

 

These methods are tried and tested over the years and may well be suited to your project.

The advantage of these systems is that they do not require any programming and can be built using very basic tools and are effective in use as well as being very durable.

The Stud and Probe control panel used in this lessin will be expanded in future lessons to include led panel lights as well as outputting servo and solenoid turnout control.

Model Railway Arduino Stud and Probe control panel

This lesson uses a stud and probe control panel that controls solenoid turnouts via and Arduino and relays.
The lesson shows some of the issues around using relays as well as using exandable code to allow multiple relays to be added very easily.

Due to the number of buttons in the project the project uses CD4021 shift registers based on the code from Lesson 21 CD4021BE Shift register

 

Download the project code for this lesson

Click on the diagram for a larger version

Arduino Stud and probe model railway control panel with CD4021 shift register

Model Railway Arduino Stud and Probe control panel

This lesson uses a stud and probe control panel that controls solenoid turnouts via and Arduino and Mosfets instead of relays.
The lesson shows some of the issues around using mosfets, especially the issues regarding some of the mosfet modules.
The code and circuit are easily expanded to allow multiple mosfets to be added very easily.

Due to the number of buttons in the project the project uses CD4021 shift registers based on the code from Lesson 21 CD4021BE Shift register

 

Download the project code for this lesson

Click on the diagram for a larger version

Turnout Control Mosfet and solenoids

Model Railway Arduino Stud and Probe control panel with solenoids and servos

This lesson builds on the previous lesson using stud and probe or momentary switches to control turnouts with Mosfets and solenoids.
In this video the leds are added to the control panel and the code is also changed to allow servo control as well.
As the code is exandable adding extra servos, buttons or leds is very simple.

Due to the number of buttons in the project the project uses CD4021 shift registers based on the code from Lesson 21 CD4021BE Shift register and for the LED's it uses 74HC595N Shift registers from Lesson 22 74HC595N

 

Download the project code for this lesson

Click on the diagram for a larger version

Turnout Control Servos, Mosfet and solenoids and stud and probe

8 - Project design, choosing sensors for railway speedometer project

In this lesson I will go through the steps and considerations when choosing sensors for a project, in this case a speedometer for a model railway.
The project will use the LCD screen from lesson 17, a debounced button from Lesson 5 and the IR sensors from Lesson 7.

Download the code for Lesson 18

Click image for larger version
Lesson 18 Railway speedometer

ESP32 or Arduino DCC Accessory Decoder Circuit 03/04/2024

ESP32 or Arduino DCC Accessory Decoder Circuit

#73 Arduino C++ nonRail introduction 25/03/2024

nowRail Introduction

#63 Arduino C++ Gas Light effects using an Arduino and PCA9685 servo driver board 26/01/2024

PCA9685 servos controlled by buttons

#62 DCC decoder controlling servos and LED's 23/01/2024

PCA9685 servos controlled by buttons

State Machine Example based around model railway requirements 08/03/2023

State Machine Example

#58 Model railway crossing with Servo Barriers, LED lighting and sound 08/01/2024

PCA9685 servos controlled by buttons

Isle of Mudd Model Railway 27/12/2023

Isle of Mudd Model Railway

PCA9685 Servo Control with buttons, point/turnout control for model railways 01/01/2024

PCA9685 servos controlled by buttons

PCA9685 Servo Setter Project 29/12/23

PCA9685 Servo Setter

Arduino Indexing DCC Traverser 24/12/23

Traverser

Arduino Indexing DCC Model Railway Traverser 20/03/23

Arduino Indexing DCC Model Railway Traverser

DCC Modular Layouts and Control Panels 02/02/2022

DCC Modular Layouts and Control Panels

Model Railway Indexing DCC Turntable 26/12/2021

Model Railway Indexing DCC Turntable

ESP32 DCC Accessory Decoder 27/10/2021

ESP32 DCC Accessory Decoder

DCC Accessory Decoder, sounds and lights Arduino UNO 12/10/2021

DCC Accessory Decoder, sounds and lights Arduino UNO

#62 DCC decoder controlling servos and LED's 23/01/2024

PCA9685 servos controlled by buttons

Model Railway Light Effects using PCA685 and LED's with Arduino or ESP32 09/05/2022

Model Railway Light Effects using PCA685 and LED's with Arduino or ESP32

 

Projects

#70 ESP-NOW Broadcast Mode 06/03/2024

PCA9685 servos controlled by buttons

#69 Fail Safe project planning 21/02/2024

PCA9685 servos controlled by buttons

#60 Arduino Connectors and Plugs 15/01/2024

PCA9685 servos controlled by buttons

#59 Arduino Project Wiring 13/01/2024

Project wiring

Arduino Robot Car

10/11/2021

Arduino Robot Car

State Machine Example based around model railway requirements 08/03/2023

State Machine Example

PCA9685 Servo Control with buttons, point/turnout control for model railways 01/01/2024

PCA9685 servos controlled by buttons

PCA9685 Servo Setter Project 29/12/23

PCA9685 Servo Setter

CatWasherV4 Cat deterrent 27/09/2021

CatWasherV4 Cat deterrent2

Power Supply and Oscilloscope 24/09/2021

Power Supply and Oscilloscope

How To's

How To 1 : Debouncing buttons 15/09/2021

How To 2 : Multiple HC-SR04 Ultrasonic sensors using bit shifting with 74HC595 05/10/2021

How To 3 : Issues when joining two sketches together 22/10/2021

How To 4 : Creating a Project - Alarm example 25/10/2021

How To 5 : Nema 17 stepper motor using micros() for timing. 08/12/2021

How To 6 : FIFO (Circular) Buffer 23/12/2023

Comments


If you have any projects you would like videos on please email the address in this image: and use Projects & Components as a reference.