Last Updated 07/05/2026

Serial Communication

This page brings together a number of lessons and projects that all use Serial Communication

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
Lesson (Click to watch)
Lesson Resources
Arduino C++ Serial Communication Part 1

This lesson starts to explore Serial communication.

Serial communication can be used to communicate between Arduino boards but also with other devices.

This lesson covers the basics of how Serial communication works as well as showing some of the issues such as the Serial buffers and what happens when they overflow.

Download the code for Lesson 25

There is no circuit diagram for this lesson.

You just need an Arduino Uno

If you want to know more details of the technical side of Serial communication take a look at this page on UART basics


Click for m ore information on Ring buffers or FIFO buffers





Arduino C++ Serial Communication Part 2

This lesson looks at the basics of sending and receiving data via Serial communication between different types of boards including the issues when communicationg bertween 5v and 3.3v boards.

This lesson also covers some of the differences between using the built in Hardware serial ports and using software serial.

Download the code for Lesson 26

Circuit diagram for this lesson (Click image for larger version).

Serial communication between Arduinos circuit diagram


Arduino C++ Serial Communication Part 3 Data packets and error checking (checksums)

This lesson looks how to break down int's and long's into bytes to transmit via Serial.

It also covers the issues of bytes being read in the wring order by creating a packet for the transmission.

Finally to check for data corruption a checksum is then created and added to the data packet.

Download the code for Lesson 27

Circuit diagram for this lesson is the same as lesson 26 (Click image for larger version).

Serial communication between Arduinos circuit diagram


Arduino C++ Serial Communication Part 4 Master and Slave

This lesson starts to cover how to create a network protocol with a slave and master system with communication timing being controlled by the master at all times.

The lessons learnt in creating a simple network protocol helps to understand the basic structure of different types of communication such as CanBus or CabBus enabling users to understand and integrate with different standards of communication protocols.

The lessons learnt in this video will prepare the way for the next lesson when multiple Uno's will be connected together using RS-485.

Other Resources

Lesson 4 digitalWrite (leds)

Lesson 5 Debouncing Buttons

FIFO (Ring) buffers

Download the code for Lesson 28

Circuit diagram for this lesson (Click image for larger version).

Serial communication between Arduinos circuit diagram Master and Slave


Arduino C++ Serial Communication Part 5 RS485

This lesson combines takes the network protocol lessons learnt in lesson 28 and expands it using RS485 modules to allow up to 32 Arduinos to be connected together with a cable length of up to 1200 metres (4000ft).

The examples show how the Master to Slave communication works but also Slave to Slave and Slave to Master.

These sketches can be adapted to create a fast and efficient communication system allowing boards to not only share data but to send control codes triggering actions by other boards.

The examples given run on 5 boards but this can easily be expanded up to the 32 board limit.

Other Resources

Lesson 4 digitalWrite (leds)

Lesson 5 Debouncing Buttons

FIFO (Ring) buffers

Download the code for Lesson 29

Circuit diagrams for this lesson (Click image for larger versions).

RS485 Module pin out

Serial communication Arduino RS485 circuit diagram Master and Slave


Arduino C++ Serial Communication Part 6 Data Structures, multiple data types

This lesson looks at how to send multiple data types in a single transmission using a structure using struct to create a structure of data types.

This method of transmitting data removes the need to bit shift integers or longs before transmission.

This lesson shows how to send unsigned long, int, byte, Char and String all in one transmission.

Packet headers are also covered in this lesson.

Download the code for Lesson 33

Circuit diagram for this lesson is the same as lesson 26/27 (Click image for larger version).

Serial communication between Arduinos circuit diagram

 

Contact

If you have a particular subject you want covered please email the address in this image:.
Please give as much information as possible including the video/Lesson as this site contains hundreds of sketches so it makes it faster to track down the video/sketch. Please be aware that this is a hobby that fits around work so please be patient.