Arduino Nano - Bluetooth LED Matrix

This tutorial instructs you how to use Arduino Nano to control an LED matrix display with a smartphone through either Bluetooth or BLE.

We will have the option to select between two different modules: HC-05 for Classic Bluetooth (Bluetooth 2.0) and HM-10 for Bluetooth Low Energy (BLE, Bluetooth 4.0). The tutorial will provide step-by-step instructions for both modules with Arduino Nano.

To send messages from the smartphone to the Arduino Nano, we will use the Bluetooth Serial Monitor App. Once the message is received by Arduino Nano, it will be displayed on the LED matrix display.

Arduino Nano LED matrix display Bluetooth

In detail, we will learn:

Hardware Preparation

1×Arduino Nano
1×USB A to Mini-B USB cable
1×HC-05 Bluetooth Module
1×(Alternative) HM-10 BLE Module
1×LED matrix display
1×Breadboard
1×Jumper Wires
1×(Optional) 9V Power Adapter for Arduino Nano
1×(Recommended) Screw Terminal Adapter for Arduino Nano

Or you can buy the following sensor kit:

1×DIYables Sensor Kit 30 types, 69 units
Disclosure: Some of the links provided in this section are Amazon affiliate links. We may receive a commission for any purchases made through these links at no additional cost to you. We appreciate your support.

Overview of LED matrix display and Bluetooth Module

Prior to beginning this tutorial, it is suggested that you have a general comprehension of LED matrix displays and Bluetooth modules, including their pinouts, how they operate, and how to program them. If you are not familiar with these concepts, please take a look at the following tutorials for more information:

Wiring Diagram

  • To control the LED matrix display via Classic Bluetooth, you can use the HC-05 Bluetooth module and connect it to Arduino Nano in accordance with the wiring diagram below:
The wiring diagram between Arduino Nano and LED matrix display Bluetooth

This image is created using Fritzing. Click to enlarge image

  • To control the LED matrix display via BLE, the HM-10 Bluetooth module should be linked to Arduino Nano in accordance with the wiring diagram below:
The wiring diagram between Arduino Nano and LED matrix display BLE

This image is created using Fritzing. Click to enlarge image

Arduino Nano Code - controls LED matrix display via Bluetooth/BLE

The code can be used with both the HC-10 Bluetooth module and the HM-10 BLE module. No changes necessary.

/* * This Arduino Nano code was developed by newbiely.com * * This Arduino Nano code is made available for public use without any restriction * * For comprehensive instructions and wiring diagrams, please visit: * https://newbiely.com/tutorials/arduino-nano/arduino-nano-bluetooth-led-matrix */ #include <MD_Parola.h> #include <MD_MAX72xx.h> #include <SoftwareSerial.h> #define HARDWARE_TYPE MD_MAX72XX::FC16_HW #define MAX_DEVICES 4 // 4 blocks #define CS_PIN 3 // The Arduino Nano pin connected to the CS pin of the LED matrix #define SOFT_RX 4 // The Arduino Nano pin connected to the TX of the bluetooth module #define SOFT_TX 5 // The Arduino Nano pin connected to the RX of the bluetooth module SoftwareSerial bluetooth(SOFT_RX, SOFT_TX); // create an instance of the MD_Parola class MD_Parola ledMatrix = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES); void setup() { Serial.begin(9600); bluetooth.begin(9600); ledMatrix.begin(); // initialize the object ledMatrix.setIntensity(0); // set the brightness of the LED matrix display (from 0 to 15) ledMatrix.displayClear(); // clear LED matrix display } void loop() { if (bluetooth.available()) { // if there is data comming String text = bluetooth.readStringUntil('\n'); // read string until meet newline character ledMatrix.displayClear(); // clear led matrix display ledMatrix.displayScroll(text.c_str(), PA_CENTER, PA_SCROLL_LEFT, 100); bluetooth.print("LED Matrix displayed: ");// reports action to smartphone app bluetooth.println(text); } if (ledMatrix.displayAnimate()) { ledMatrix.displayReset(); } }

Detailed Instructions

  • Click to the Libraries icon on the left bar of the Arduino IDE.
  • Search for “MD_Parola” and locate the MD_Parola library.
  • Then, click the Install button.
Arduino Nano MD_Parola library
  • You will be asked to install the “MD_MAX72XX” library
  • Click Install All button to install the dependency.
Arduino Nano MD_MAX72XX library
  • Download the Bluetooth Serial Monitor App onto your smartphone.
  • Take the code given and open it with the Arduino IDE. Upload the code to your Arduino Nano. If you have trouble uploading the code, try disconnecting the TX and RX pins from the Bluetooth module, upload the code, and then reconnect the RX/TX pins again.
  • Launch the Bluetooth Serial Monitor App on your smartphone.
  • Choose either Classic Bluetooth or BLE, depending on the module you are using.
Bluetooth Serial Monitor App
  • Connect the Bluetooth App to the HC-05 Bluetooth module or the HM-10 BLE module.
Bluetooth Serial Monitor pairing
  • Type a message, for instance “HELLO”, and then press the Send button to transmit it to the Arduino Nano.
Bluetooth Serial Monitor App
  • Examine the message shown on the LED matrix display and the Bluetooth App.
  • Confirm the outcome on the Android App.
Bluetooth Serial Monitor App

If you have found the Bluetooth Serial Monitor app to be useful, please take a moment to leave a 5-star rating on the Play Store. Your feedback would be greatly appreciated! Thank you!

Video Tutorial

Function References