Skip to main content

There are many tutorials online on using an LED Matrix to display data—many of them require wiring up a screen, external power supplies, or flashing boards. We wanted to highlight a slightly more accessible way to get an LED Matrix—in our case, a Hub 75, 32×64 pixel up and running using an Interstate75W from Pimoroni. The benefit of the Interstate is that it plugs indirectly into the matrix and can power a single screen directly from the board.

Interstate75W

Interstate75W

We wanted a way to display any data we wanted on the screen with the screen lighting up and data scrolling up as it arrives and then turning off. To use this we use MQTT to load our data (a test feed is included in the scripts – which displays Time, News and Environmental Information) – see below for a demo:

 

We also incorporate manual brightness control and reconnecting for the MQTT for message handling, making it easy to update the display from anywhere. Setting up your own MQTT is beyond this post, but its easier than you may think and once you have one it can be used to display any data, from external feeds such as weather apis through to data from systems such as Home Assistant.

Features

  • Scrolling Text Messages: Display messages that scroll across the HUB75 LED matrix.
  • Manual Brightness Control: Adjust the brightness of the display manually.
  • MQTT Integration: Receive and display messages via MQTT.

Hardware Requirements

To get started, you’ll need the following hardware:

Software Requirements

You’ll also need the following software – all available from our GitHub

  • MicroPython
  • Required MicroPython libraries:
    • interstate75
    • mqtt_as
    • uasyncio

Setup

1. Clone the Repository

First, clone the project repository from GitHub, or just download the files directly:

“`sh
git clone https://github.com/yourusername/interstate75w-mqtt-display.git
cd interstate75w-mqtt-display
“`

2. Upload the Code

Next, upload the code to your microcontroller. You can use tools like Thonny or ampy to do this.

3. Configure WiFi and MQTT

Update the config.py file with your WiFi credentials, the MQTT details can also be updated if you have your own server, if not then leave them for our demo feed.

“`python
config = {
‘ssid’: ‘your_wifi_ssid’,
‘wifi_pw’: ‘your_wifi_password’,
‘server’: ‘mqtt_broker_address’,
‘user’: ‘mqtt_user’,
‘password’: ‘mqtt_password’,
‘port’: 1883,
‘keepalive’: 60,
}
“`

Usage

Run the Script

The script will automatically connect to WiFi and the MQTT broker, then start displaying messages – our MQQ feed displays messages approximatly every 3 minutes.

Constants and Initial Setup

The script defines constants for controlling the scrolling text speed, how long the screen says on for after displaying the message and brightness settings. It also initializes the Interstate75W object:

Constants for controlling scrolling text

BACKGROUND_COLOUR = (0, 0, 0) # Black background to turn off the screen
HOLD_TIME = 2.0
BLANK_SCREEN_TIME = 10.0
BUFFER_PIXELS = 2 # Increased buffer to ensure full scroll off
SCROLL_SPEED_LEVEL = 8 # Set the desired scrolling speed level (1 to 10)
SCROLL_SPEED = 1 / SCROLL_SPEED_LEVEL # Convert to a delay in seconds

Brightness settings

brightness = 50 # Initial brightness (0 to 100)

Do let us know if you make one – we would love to see images of your own set up and we hope this made it a little easier for anyone new looking to run an LED matrix using MQTT.

Leave a Reply