Last Updated 07/09/2026

Components

 

Quick Reference Links

Buttons and Switches Led's and Neopixels Switching Analogue Sensors Digital Sensors

Buttons and debouncing
Switches
Rotary Encoders

Jump to Buttons and Switches

Led's and Neopixels controlled via Arduino or via PCA9685 for Led's

Jump to Led's and Neopixels

Relays
Transistors
Mosfets

Jump to Switching

Photoresistors
Thermistors
Potentiometers
Joysticks

Jump to Analogue Sensors

VL53 LOX Timer of flight sensor
PIR Sensor
IR sensors
Ultrasonic Sensors
Photointerrupters

Jump to Digital Sensors

Motors Servos MP3 Players IC Chips LCD Screens and Touch

Various types of Stepper Motor
(Bi Polar Nema styles
and 28BYJ-48)
Motor Driver Boards
(L298N, IBT2 BST7960, L293)

Jump to Motors

Servo motor Control
MG90 and SG90 Servos
GS-1502 Linear Servo
PCA9685 Servo driver board

Jump to Servos

JQ8900
DY-SV5W
DY-SV8F
DY-HV20T
DY-HV8F
DF MIni Player
MP3-TF16P v3.0
Serial UART MP3 Player

Jump to MP3

24LC256 EEPROM
CD4021BE Shift register
74HC595N Shift register
MCP23017 SCMCU-2317 I2C Port Expander

Jump to IC Chips

ILI9481
ILI9486
ILI9488
Resistive Touch Screen
FT6236 Capacitive Touch
ST7793
1602A I2C LCD screen
GT911 Touch Screen
5161AS 7 Segment Display

Jump to LCD Screens

 

If you wish to support the project buy me a coffee at: https://buymeacoffee.com/digitaltown

LESSONS
Arduino IDE download and tour
Arduino C++ Beginners Course
Arduino Uno Starter Kit Course
ESP32 Specific
Serial Communication
PROJECTS
Model Railway
nowRail
interlock++
Other Projects
Robot Car
Cat Washer
 
Project Wiring
Connectors and Plugs
Fail Safe
COMPONENTS
All Components
LCD Touch Screens
3D PRINTING
Servo Kadee Uncoupler
Turnout Servo Mount

Buttons and Switches

Lesson 4 Digital Pins digitalWrite() Lesson 5 Digital Pins digitalRead(), pull down resistors, debouncing buttons Arduino C++ Lesson 5B, Arduino UNO with toggle switches Arduino Uno Starter Kit - BUttons, breadboards and chopping boards
Arduino Uno Starter Kit - Multiple buttons and variables Arduino Uno Starter Kit - Button states and debouncing Lesson 14 - External Interrupts part 1 - Rotary Encoder Lesson 16 - Arduino Multi Mode Button
Arduino C++ Multi Mode duel use buttons Arduino Uno Starter Kit - Buttons and Leds Model Railway Momentary switches Model Railway latching or toggle switches

Led's and Neopixels

Lesson 4 Digital Pins digitalWrite() Arduino Uno Starter Kit - Photo resistors, Led's and analogWrite()
Arduino C++ Multi Mode duel use buttons
   

Switching

Lesson 7 Combining Sensors Arduino C++ Transistors and Mosfets Model Railway Arduino Stud and Probe control panel Model Railway Arduino Stud and Probe control panel
       

Analogue Sensors

Lesson 6 Analog Pins analogRead(), pmap() function, switch() statement Joystick control of the L298N motor driver Arduino Uno Starter Kit - Potentiometer, analogRead, map, float Arduino Uno Starter Kit - Potentiometer, analogRead, map, float
Arduino Uno Starter Kit - Photo resistors, Led's and analogWrite()    

Digital Sensors

Lesson 7 Combining Sensors Lesson 8 Combining sensors part 2 VL53L0X Laser ranging time of flight distance sensor
 

Motors and Stepper Motors

Lesson 12 - 28BYJ-48 ULN2003 Arduino UNO tutorial Lesson 13 - 28BYJ-48 ULN2003 Arduino UNO tutorial Lesson 19 L298N Motor Driver with Arduino UNO Joystick control of the L298N motor driver
Arduino C++ nema Stepper Motors Part 1 Arduino C++ nema Stepper Motors Part 2 indexing Arduino C++ nema Stepper Motors Part 3 Multiple stepper motors IBT2 BST7960 Motor Driver tutorial Arduino C++
Arduino Uno Starter Kit - L293D Motor driver with joystick control

Servos

Lesson 10 - Arduino UNO servos Lesson 11 Arduino UNO advanced servo control Arduino Uno Starter Kit - Servos Model Railway servos part 2, servo speed
Model Railway servos part 3, PCA9685 Driver Board

MP3 Players

JQ8900 MP3 player Arduino ESP32 DY-HV20T and DY-HV8F with ESP32, Arduino Uno and Arduino Mega 2560 DY-HV20T DY-HV8F DY-Sv*F DY-SV5W mp3 playrs with buttons and leds  
Arduino and Serial UART MP3 player
Serial UART MP3 player

IC Chips

Arduino C++ CD4021BE Shift register Arduino UNO, MEGA Arduino C++ 74HC595N Shift register Arduino UNO, MEGA CJMCU-2317 Tutorial  
   

LCD screens and Touch Screens

1602A I2C LCD Screen with Arduino UNO Arduino Uno with GT911 Capacitive Touch Screen ESP32 Dev Module with ILI9488 FT6236 Capacitive Touch Screen ESP32 S3 Dev Module with ILI9488 FT6236 Capacitive Touch Screen
ESP32 Dev Module with ILI9488 FT6236 Capacitive Touch Screen GT911 Capacitive Touch Screen with Arduino UNO and ESP32 ESP32 I2C 1602 Liquid Crystal Display
Arduino Uno Starter Kit - 5161AS Common Cathode 7 segment display

Components

VL53L0X Laser ranging time of flight distance sensor

How to use either a single or multiple VL53L0X distance sensors.

WARNING: The VL53L0X sensor is an infrared laser sensor. This means the beam CANNOT be seen so be careful to avoid pointing it towards eyes, human and animals.

This tutorial looks at some of the issues around using the VL53L0X sensor as well as some of the issues I discovered using different libraries.

I also discovered some variance between different versions of the sensor that had an impact on sensor range and accuracy.


After testing various libraries the one I settled for was the VL53L0X_mod version by Schnoog
downloadable from within the Arduino IDE or downloadable from github
This library was able to handle single and multiple VL53L0X sensors, seemed the most stable and displayed no warnings when compiling.
It also seemed to use the least amount of memory allowing for larger programs to be written.
VL53L0X

The version I found worked best are the VL53L0X version available on this link.https://www.amazon.co.uk/dp/B08219CPML

Click Image for larger Version

VL53LOX Arduino UNO Circuit diagram

Click to download sketches.

VL53L0X sensors


DY-HV8F, DY-HV20T, DY-SV8F and DY-SV5W integrating buttons and leds

DY-HV8F, DY-HV20T, DY-SV8F and DY-SV5W MP3 Players with Arduino UNO, Mega 2560 and ESP32.

WARNING: If using with 5v UNO or Mega 2560 use a voltage divider as shown in the ciruit diagram, this can be omitted for 3.3v boards such as the ESP32

DY-HV8F, DY-HV20T, DY-SV8F and DY-SV5W boards have 3.3v logic pins.

The boards give 4 Ohm/20W or 8 Ohm/10W sound output.


This project shows how to play a background set of tracks triggered by a button while using a 2nd button to interrupt and play a single track. The project also shows how to integrate a flashing LED into the code as an example of adding lighting sanimations to go with the sound.

This can be used as a basis for a lot of Model railway sound projects.

As my project is for few background sounds for a model railway the 8mb storage was just about enough.

Click Image for larger Version

DY-HV8F DY-HV20T DY-SV5W DY-SV8F integrating buttons and LED's Arduino UNO Mega 2560 ESP32

Click to download sketches.


Click to download Datasheet (Uses same system as DY-SV5W)

IMPORTANT: DIP switch Positions

1 OFF
2 OFF
3 ON

DY-HV20T DY-HV8F

DY-HV8F DY-HV20T MP3 Player Arduino ESP32

DY-HV8F and DY-HV20T MP3 Player with Arduino UNO, Mega 2560 and ESP32.

WARNING: If using with 5v UNO or Mega 2560 use a voltage divider in the same way as with the JQ8900

The DY-HV8F and DY-HV20T boards have 3.3v pins.

The boards give 4 Ohm/20W or 8 Ohm/10W sound output.

WARNING: This board is a 3.3v IO pins so for 5v boards such as the Arduino UNO/Mega 2560 you will require a voltage divider.

Ideal for short project sounds including voice commands.
Also ideal for model railway sounds.

The main difference between the boards is that the DY-HV8F has a built in 8mb USB storage system while the DY-HV20T allows SD cards up to 32GB to be used to store tracks so is better if you want to run lots of larger tracks.

As my project is for few background sounds for a model railway the 8mb storage was just about enough.

Click Image for larger Version

DY-HV8F DY-HV20T ESP32 circuit UNO Mega 2560

Click to download sketches.

An extra sketch has been added with improved random play time as well as a bug fix on sketch 2 line 131


Click to download Datasheet (Uses same system as DY-SV5W)

IMPORTANT: DIP switch Positions

1 OFF
2 OFF
3 ON

DY-HV20T DY-HV8F

JQ8900 MP3 Player Arduino ESP32JQ8900 MP3 Player with Arduino UNO, Mega 2560 and ESP32.

Click to download sketches.


Click to download Datasheet

The JQ8900 is a small solid state MP3 player with 4mb of onboard storage.

The unit is best controlled using Serial commands (UART).
Sounds are loaded directly via a USB connector.

The unit claims to work with MP3 and WAV files. I have only tested using MP3 files.

WARNING: This board is a 3.3v IO pins so for 5v boards such as the Arduino UNO/Mega 2560 you will require a voltage divider.

Ideal for short project sounds including voice commands.
Also ideal for model railway sounds.

Click Images for larger Versions
JQ8900 Arduino ESP32
JQ8900 MP3 Player Arduino ESP32 bottom view

JQ8900 Circuit diagram for Arduino ESP32

CD4021B Shift Register 11/03/2024

PCA9685 servos controlled by buttons

GS-1502 Linear Servo 08/01/2024

PCA9685 servos controlled by buttons
ESP32 with ILI9488 SPI LCD Touch or is it a ILI9486?
FT6236 Capacitive touch screen.
17/01/2024
ESP32 with ILI9481 SPI LCD Touch Screen or is it a ILI9486

Multiple PCA9685 PWM Servo Boards with servos and LED's 05/01/2024

Multiple PCA9685 Servo driver circuit

PCA9685 PWM Servo Board 27/12/2023

PCA9685 PWM Servo Driver Board

DY-SV5W MP3 Player
ESP32 Dev Module and ESP8266 D1 mini
09/02/2024

DY-SV5W MP3 Player

DY-SV5W MP3 Player Arduino Uno and Mega 2560 15/12/2023

DY-SV5W MP3 Player

Stepper motors without microDelay() 25/11/2023

Stepper Motors

Arduino and Namur type sensor 10/11/2021

Controlling a NAMUR sensor with an Arduino

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

State Machine Example

DFmini player & MP3-TF-16P v3.0 Player 21/12/2022

PCA9685

Arduino UNO and ESP32 controlling LED's with PCA9685 05/05/2022

PCA9685
Arduino UNO with 24LC256 External EEPROM 16/03/2022

24LC256 External EEPROM

Arduino Uno built in EEPROM 08/12/2021

 
ESP32 with GT911 Capacitative Touch 10/01/2022

Arduino/ESP32 GT911 Touch Screen
ESP32 with ILI9481 SPI LCD Touch Screen or is it a ILI9486? 02/01/2022 ESP32 with ILI9481 SPI LCD Touch Screen or is it a ILI9486

Nema 17 stepper motor with and without delay() 08/12/2021

Nema 17 control with and without delay()

L298N Motor controller board 09/08/2021

L298N Motor Driver

HC-SR04 Ultrasonic Distance Sensor 12/08/2021

HC-SR04 Ultrasonic Sensor

Servos 13/08/2021

Servos

LCD Touch Screen Basics 09/09/2021

LCD Touch screen basics

ads1256 24bit ADC with Arduino Due 24/09/2021

ads1256 24bit ADC with Arduino Due

JSN-SR04T Waterproof Ultrasonic Sensor 24/09/2021

JSN-SR04T Waterproof Ultrasonic Module

Serial MP3 player 28/09/2021

Arduino and Serial UART MP3 player

Rain Drop Sensor 01/10/2021

Arduino Rain Drop Sensor

VL53L0X V2 Time-of-Flight Laser Distance Sensor08/10/2021

VL53L0X V2 Time-of-Flight Laser Distance Sensor

NeoPixels 04/11/2021

Arduino and Neopixels

Photointerrupter HY301 01/12/2021

Arduino and Photointerrupters

 

Contact

If you have a particular subject you want covered please email the address in this image: and use nowRail as a reference.
Please be aware that this is a hobby that fits around work so please be patient.