Last Updated: 19/04/2025

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

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

Model Railway Control and Effects

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 orject 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

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

 

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.