ESP32 S3 - Temperature Sensor - LED Matrix

This tutorial shows you how to use the ESP32 S3 to read temperature data from a DS18B20 one-wire sensor and display it live on an FC-16 LED Matrix. By combining two popular peripherals on a single board, you build a self-contained temperature display that scrolls the current reading across the LED matrix without any computer once programmed.

What you'll build:

  1. A circuit connecting the DS18B20 temperature sensor and FC-16 LED Matrix to the ESP32 S3
  2. Arduino code that reads temperature from the DS18B20 and writes it to the LED matrix in real time
  3. A scrolling display that shows both Celsius and Fahrenheit values across the LED matrix
  4. A foundation you can extend into weather stations, smart signs, or environmental monitors

https://newbiely.com/images/cover/esp32-s3-temperature-sensor-led-matrix.jpg

Hardware Preparation

1×ESP32 S3 WROOM N16R8
1×Alternatively, ESP32 S3 SuperMini Dev Module
1×Alternatively, ESP32 S3 Uno-form Board
1×Alternatively, ESP32 S3 Camera Board
1×USB Cable Type-A to Type-C (for USB-A PC)
1×USB Cable Type-C to Type-C (for USB-C PC)
1×FC-16 LED Matrix 32x8
1×DS18B20 Temperature Sensor (WITH Adapter)
1×DS18B20 Temperature Sensor (WITHOUT Adapter)
1×Breadboard
1×Jumper Wires
1×Optionally, DC Power Jack
1×Recommended: Screw Terminal Expansion Board for ESP32 S3
1×Recommended: Breakout Expansion Board for ESP32 S3
1×Recommended: Power Splitter for ESP32 S3

Or you can buy the following kits:

1×DIYables ESP32 S3 Starter Kit (ESP32 S3 included)
1×DIYables Sensor Kit (18 sensors/displays)
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.
Additionally, some of these links are for products from our own brand, DIYables .

Buy Note: Many DS18B20 sensors available in the market are unreliable. We strongly recommend buying the sensor from the DIYables brand using the link provided above. We tested it, and it worked reliably.

Overview of Temperature Sensor and LED Matrix

The DS18B20 temperature sensor and FC-16 LED Matrix are two versatile components that work well together on the ESP32 S3. The DS18B20 uses a single-wire 1-Wire protocol to deliver accurate digital temperature readings, while the FC-16 LED Matrix uses a simple SPI interface driven by the MAX7219 chip to display scrolling text and numbers across a 32×8 grid. Combining them lets you build a standalone temperature sign that updates continuously without any additional display hardware.

We have dedicated tutorials covering each component individually with full pinout information, wiring diagrams, and standalone code examples. Review them before starting this project if you are not yet familiar with either peripheral:

Key Specifications

The DS18B20 operates on 3.0V to 5.5V and is fully compatible with the ESP32 S3's 3.3V GPIO pins. It measures temperatures from -55°C to +125°C with ±0.5°C accuracy between -10°C and +85°C, and supports multiple sensors on a single data wire. The FC-16 LED Matrix consists of 8×8 blocks chained together and driven by MAX7219 chips over SPI; a 4-in-1 module provides a 32×8 display controlled through just three signal pins. Because the LED matrix can draw up to 1 A at maximum brightness, it should be powered from an external 5V supply rather than the ESP32 S3's onboard 5V pin.

Wiring Diagram

Connect the DS18B20 temperature sensor and the FC-16 LED Matrix to your ESP32 S3 following the diagrams below. Both components share the same ground rail, and using a DS18B20 adapter module with a built-in pull-up resistor simplifies the build by eliminating the need for a separate 4.7 kΩ resistor.

Safety Notes

Power the DS18B20 from the ESP32 S3's 3.3V pin to keep it within its recommended operating range. Power the LED matrix from an external 5V supply rather than the ESP32 S3's onboard 5V pin, because the matrix can draw enough current to cause instability if taken directly from the board. Connect the ground of the external 5V supply, the LED matrix, and the ESP32 S3 together so they share a common reference. If you are using the bare TO-92 DS18B20 package without an adapter, never omit the 4.7 kΩ pull-up resistor between the DATA and VCC lines, as the 1-Wire protocol requires it for reliable communication.

Wiring diagram:

The wiring diagram between ESP32 S3 Temperature Sensor LED Matrix

This image is created using Fritzing. Click to enlarge image

Loose wires are a common cause of strange bugs. To do that, mount the ESP32 S3 on a Screw Terminal Block for ESP32 S3. Below is the wiring diagram with the screw terminal board.

The wiring diagram between ESP32 S3 Temperature Sensor LED Matrix Screw Terminal

This image is created using Fritzing. Click to enlarge image

You can also use a GPIO Breakout Board for ESP32 S3. It gives each GPIO its own S, 3.3V and GND pins, so module wires plug straight in:

The wiring diagram between ESP32 S3 Temperature Sensor LED Matrix GPIO Breakout Board

This image is created using Fritzing. Click to enlarge image

DS18B20 Temperature Sensor connections:

DS18B20 Pin ESP32 S3 Pin
GND GND
VCC 3.3V
DATA GPIO1 (or any digital pin)

FC-16 LED Matrix connections:

LED Matrix Pin ESP32 S3 Pin
VCC External 5V
GND GND (shared with ESP32 S3)
DIN GPIO40 (MOSI)
CS GPIO39 (or any digital pin)
CLK GPIO38 (SCK)

ESP32 S3 Code

The following code reads temperature from the DS18B20 sensor using the DallasTemperature library and scrolls the current Celsius reading across the FC-16 LED Matrix display, updating the message every two seconds. It initializes the 1-Wire bus on the configured data pin, requests a temperature conversion, formats the result as a string, and then uses the MD_Parola library to scroll it across the matrix. Both the DallasTemperature and MD_Parola libraries handle the low-level communication, keeping your sketch concise and easy to adapt.

/* * This ESP32 S3 code was developed by newbiely.com * * This ESP32 S3 code is made available for public use without any restriction * * For comprehensive instructions and wiring diagrams, please visit: * https://newbiely.com/tutorials/esp32-s3/esp32-s3-temperature-sensor-led-matrix */ /* * This ESP32-S3 code is created by esp32io.com * * This ESP32-S3 code is released in the public domain * * For more detail (instruction and wiring diagram), visit https://esp32io.com/tutorials/esp32-s3-temperature-sensor-led-matrix */ #include <OneWire.h> #include <DallasTemperature.h> #include <MD_Parola.h> #include <MD_MAX72xx.h> #define SENSOR_PIN 1 // ESP32-S3 pin GPIO1 connected to DS18B20 sensor's DQ pin #define HARDWARE_TYPE MD_MAX72XX::FC16_HW #define MAX_DEVICES 4 // 4 blocks #define DATA_PIN 40 // ESP32-S3 pin GPIO40 connected to DIN pin of LED Matrix #define CLK_PIN 38 // ESP32-S3 pin GPIO38 connected to CLK pin of LED Matrix #define CS_PIN 39 // ESP32-S3 pin GPIO39 connected to CS pin of LED Matrix OneWire oneWire(SENSOR_PIN); // setup a oneWire instance DallasTemperature DS18B20(&oneWire); // pass oneWire to DallasTemperature library // create an instance of the MD_Parola class MD_Parola ledMatrix = MD_Parola(HARDWARE_TYPE, DATA_PIN, CLK_PIN, CS_PIN, MAX_DEVICES); float tempC; // temperature in Celsius float tempF; // temperature in Fahrenheit String tempString; void setup() { Serial.begin(115200); DS18B20.begin(); // initialize the sensor ledMatrix.begin(); // initialize the LED Matrix ledMatrix.setIntensity(15); // set the brightness of the LED matrix display (from 0 to 15) ledMatrix.displayClear(); // clear LED matrix display ledMatrix.setTextAlignment(PA_CENTER); tempString.reserve(10); // enough for the float + degree symbol + "C" } void loop() { DS18B20.requestTemperatures(); // send the command to get temperatures tempC = DS18B20.getTempCByIndex(0); // read temperature in Celsius tempF = tempC * 9 / 5 + 32; // convert Celsius to Fahrenheit // print temperature to Serial Monitor Serial.print("Temperature: "); Serial.print(tempC); Serial.print("°C ~ "); Serial.print(tempF); Serial.println("°F"); // display temperature in Celsius at the center of the LED Matrix tempString = String(tempC, 1); tempString += (char)176; // degree symbol in the MD_MAX72XX font tempString += "C"; ledMatrix.print(tempString.c_str()); delay(2000); // wait 2 seconds before taking the next reading }

※ NOTE THAT:

The code automatically centers the temperature text horizontally and vertically on the LED Matrix display.

Detailed Instructions

  1. New to ESP32 S3? Complete our Getting Started with ESP32 S3 guide first.
  2. Open Library Manager: Click the Libraries icon on the left sidebar of Arduino IDE.
  3. Install MD_Parola: Type "MD_Parola" in the search box, find the MD_Parola library, and click Install.
  • Search for MD_Parola created by majicDesigns and click the Install button.
∞
Newbiely | Arduino IDE 2.3.8
──
☐
✕
File
Edit
Sketch
Tools
Help
ESP32S3 Dev Module
Library Manager
Type:
All
Topic:
All
MD_Parola by majicDesigns
Implemented using the MD_MAX72xx library for hardware control. Provides functions to simplify the implementation of text special effects on the LED matrix. More info
3.7.2
INSTALL
Newbiely.ino
···
1 void setup() {
Output
Serial Monitor
Ln 1, Col 1
ESP32S3 Dev Module on COM15
1
  1. Install dependency: When prompted, click Install All to also install the required MD_MAX72XX library.
  2. Install DallasTemperature: Type "DallasTemperature" in the search box, find the library by Miles Burton, and click Install.
  • Search for DallasTemperature created by Miles Burton , Tim Newsome , Guil Barros , Rob Tillaart and click the Install button.
∞
Newbiely | Arduino IDE 2.3.8
──
☐
✕
File
Edit
Sketch
Tools
Help
ESP32S3 Dev Module
Library Manager
Type:
All
Topic:
All
DallasTemperature by Miles Burton , Tim Newsome , Guil Barros , Rob Tillaart
Supports DS18B20, DS18S20, DS1822, DS1820 More info
3.9.0
INSTALL
Newbiely.ino
···
1 void setup() {
Output
Serial Monitor
Ln 1, Col 1
ESP32S3 Dev Module on COM15
1
  1. Install OneWire: When prompted, click Install All to also install the required OneWire library.
ESP32 S3 onewire library
  1. Wire the components: Follow the wiring diagram above to connect both the DS18B20 sensor and the LED Matrix to your ESP32 S3.
  2. Connect your board: Plug the ESP32 S3 into your computer using a USB Type-C cable.
  3. Select your board: In Arduino IDE, choose the ESP32 S3 board and the correct COM port.
  4. Upload the code: Copy the code above, paste it into Arduino IDE, and click the Upload button.
  5. Observe the LED Matrix: The display will scroll the current temperature in Celsius every two seconds.
  6. Test the sensor: Hold the DS18B20 probe in your hand or place it in warm or cold water to see the reading change on the matrix.
  7. Pro Tip: If readings show -127°C on the matrix, check your DS18B20 wiring — this error value almost always means a missing pull-up resistor or a loose DATA wire.

Serial Monitor Output

Once you upload the code and open the Serial Monitor at 115200 baud, you will see temperature readings printed every two seconds alongside what is scrolling on the LED Matrix. The output below shows a typical session as the sensor warms up from room temperature.

∞
Newbiely | Arduino IDE 2.3.8
──
☐
✕
File
Edit
Sketch
Tools
Help
ESP32S3 Dev Module
Newbiely.ino
···
8 Serial.println("Hello World!");
Output
Serial Monitor
Message (Enter to send message to 'ESP32S3 Dev Module' on 'COM15')
New Line
9600 baud
[2026-06-16 09:12:01] Temperature: 23.12°C ~ 73.62°F [2026-06-16 09:12:03] Temperature: 23.25°C ~ 73.85°F [2026-06-16 09:12:05] Temperature: 23.44°C ~ 74.19°F [2026-06-16 09:12:07] Temperature: 23.62°C ~ 74.52°F
Ln 11, Col 1
ESP32S3 Dev Module on COM15
2

Applications and Project Ideas

Combining a temperature sensor and an LED matrix with the ESP32 S3 is ideal for any situation where temperature needs to be visible at a distance without a monitor or screen. Here are practical ways to use this project:

  1. Outdoor temperature sign: Mount the LED matrix at a window or entrance to show ambient temperature at a glance from across a room.
  2. Server room indicator: Display rack temperature on a matrix panel so technicians can spot overheating without logging in to any dashboard.
  3. Greenhouse thermometer: Scroll temperature data on a visible display inside a greenhouse so workers know conditions without checking a phone.
  4. Tutorial safety display: Show temperature in environments where heat is a hazard, giving workers a visible warning when conditions change.
  5. Science classroom demo: Use the scrolling temperature display as a live experiment to show how temperature changes with heat sources or insulation.
  6. Retail shelf display: Combine with a relay to trigger fans or alerts when a monitored enclosure exceeds a threshold, with the matrix showing the current state.

Video Tutorial

Watch the step-by-step video walkthrough for this ESP32 S3 project below.

Challenges

Try these challenges to deepen your understanding of combining the DS18B20 temperature sensor and LED matrix with the ESP32 S3.

  1. Beginner: Modify the code to scroll both Celsius and Fahrenheit values in the same message, separated by a slash, so the full reading wraps around continuously.
  2. Intermediate: Add a second DS18B20 sensor on the same data wire and alternate displaying the temperature from each sensor on successive scroll cycles.
  3. Advanced: Build a Wi-Fi-connected temperature sign where you can update the display message remotely via a simple web interface hosted on the ESP32 S3, blending live sensor readings with custom text.

※ OUR MESSAGES

  • As freelancers, We are AVAILABLE for HIRE. See how to outsource your project to us
  • Please feel free to share the link of this tutorial. However, Please do not use our content on any other websites. We invested a lot of effort and time to create the content, please respect our work!