ESP32-S3 RGB LED Matrix Project 5 - Arrow always up
Project 5 – Arrow Always Up (Orientation Indicator using QMI8658C)
Project 5 uses the QMI8658C motion sensor to detect the orientation of the ESP32-S3 RGB LED Matrix and always display an arrow pointing UP relative to gravity. No matter how you rotate the board—USB side up, OUSB side up, side “15”, or side “34”—the arrow automatically turns and points toward the physically upward direction.
This is a powerful demonstration of real-time orientation sensing using the onboard accelerometer. All six projects for this module are demonstrated in one YouTube video, which is also embedded on this page. The complete code for Project 5 loads automatically below the article, and affiliate links appear under the code section.

ESP32-S3 RGB LED Matrix Module Overview
The ESP32-S3 RGB LED Matrix module includes several components that make this project possible:

- ESP32-S3 microcontroller — provides Wi-Fi, BLE, and runs the LED/IMU logic.
- 8×8 RGB LED matrix — displays the arrow in any of four orientations.
- QMI8658C accelerometer — detects tilt, movement, and orientation.:contentReference[oaicite:0]{index=0}
- USB-C port for power and programming in Arduino IDE.
- Reset and Boot buttons for uploading sketches.
- GPIO pins available around the board for additional projects.
The arrow direction is determined entirely by the accelerometer readings. When the board is rotated, the QMI8658C senses the new X/Y/Z values, and the sketch chooses which arrow pattern (↑, ↓, ←, →) should be drawn.

Projects Covered in the Video (Timestamps)
- 00:00 – Introduction
- 02:01 – Installing ESP32 boards
- 03:32 – Installing libraries
- 05:32 – Project 1: Moving Dot
- 11:11 – Project 2: Text Scroll
- 12:59 – Project 3: HTTP Text
- 16:41 – Project 4: Tilt Dot
- 18:55 – Project 5: Arrow Always Up (this project)
- 20:02 – Project 6: Target Game
The video clearly shows how the arrow changes direction instantly based on how the module is turned. Watching this segment is strongly recommended.:contentReference[oaicite:1]{index=1}

Installing ESP32 Boards in Arduino IDE
If you completed any earlier project, the board setup is already done. Otherwise:
File > Preferences→ Add ESP32 board URLTools > Board > Boards Manager…→ Install “ESP32”- Select the ESP32-S3 board under
Tools > Board - Select the correct USB COM port under
Tools > Port
Installing Required Libraries
Project 5 uses:
Adafruit NeoMatrixAdafruit NeoPixelAdafruit GFXQMI8658(motion sensor)
Sketch > Include Library > Manage Libraries…- Search: NeoMatrix → Install
- Install dependencies: NeoPixel + GFX
- Search and install QMI8658 by its author
How Project 5 Works
The QMI8658C measures gravity on X, Y, and Z axes. By comparing these values, the sketch determines which physical side of the board is facing upward:
- USB side up
- OUSB side up (opposite USB)
- Side “15” up
- Side “34” up
Each orientation corresponds to a different arrow pattern on the 8×8 matrix. The mapping follows your confirmed orientation logic from earlier debugging sessions. The board’s rotation is read continuously, and the arrow updates as soon as the upward side changes.
Project 5 – Code Settings (Arrow Always Up)
Below are the user-adjustable values from the configuration area. The full project code appears automatically below the article.
Matrix Configuration
// Matrix configuration
const int MATRIX_PIN = 14; // fixed for this module
const int MATRIX_WIDTH = 8;
const int MATRIX_HEIGHT = 8;
// Recommended orientation: Top-Left origin, progressive mode
// (actual constructor is inside the code loaded below)
This project uses NEO_MATRIX_PROGRESSIVE layout to ensure the arrow points correctly based on actual movement.
Brightness
uint8_t matrixBrightness = 40; // 0–255
You may raise this value for brighter environments. For indoor use, 30–60 is comfortable.
Arrow Color
// Arrow color
uint8_t arrowRed = 255;
uint8_t arrowGreen = 0;
uint8_t arrowBlue = 0;
Change these values to modify the arrow’s color. For example:
- Green arrow:
(0, 255, 0) - Blue arrow:
(0, 0, 255) - White arrow:
(255, 255, 255)
Sensitivity and Smoothing
To avoid jitter, the code includes smoothing and threshold logic. In the settings you may find something like:
// Sensitivity / smoothing adjustment
float tiltThreshold = 0.30f; // adjust if arrow changes too easily
- If your arrow flips too easily → increase threshold.
- If arrow is too slow to change → decrease threshold.
Arrow Patterns
The sketch includes arrow bitmap patterns for:
- ↑ up
- ↓ down
- ← left
- → right
You do not need to modify these, but you can change the shapes inside the code if you want a different style.
Summary
Project 5 demonstrates how the ESP32-S3 RGB LED Matrix and the QMI8658C accelerometer work together to detect orientation and display an arrow that always points upward. This project builds on the Tilt Dot (Project 4) and prepares you for the final interactive game in Project 6.
The full “Arrow Always Up” sketch is available below this article (auto-loaded). Watching the corresponding part of the video is highly recommended to see how instantly the arrow responds to board rotation. If you wish to build this project at home, affiliate links for the ESP32-S3 RGB LED Matrix module appear under the code section.
画像
必要かもしれないもの
-
アマゾン
-
イーベイ
-
アリエクスプレスPurchase ESP32-S3 RGB Matrix from AliExpresss.click.aliexpress.com
-
アリエクスプレスPurchase ESP32-S3 RGB Matrix from AliExpress (2)s.click.aliexpress.com
リソースと参考文献
まだリソースはありません。
ファイル📁
ファイルは利用できません。