M5Stack Chain Captain Guide: Setup, ChainBus Wiring and First Project

M5Stack Chain Captain is an ESP32-S3-based ChainBus master for compact control panels. It brings a 1.54-inch display, three user buttons, an 800mAh battery, audio, motion sensing and a dedicated Chain port into one controller. Unlike a sensor node, the Captain is the part that reads Chain devices and sends commands back to them. A useful first project is a small status panel: connect one Chain RGB node, discover it on the bus, then use the Captain's buttons to select a state that the screen and LED matrix both show.

This guide explains the hardware, the direction-sensitive Chain Bridge connection, the Arduino preparation sequence and the checks that separate a working bus from a wiring or firmware problem. It is based on M5Stack's published documentation, not an OpenELAB hands-on test. M5Stack currently documents the hardware and general M5Chain APIs, but a complete Captain-specific upload example and verified screenshots are not yet available here. Treat the project sequence below as a build plan; confirm the exact board profile, library versions and firmware against current M5Stack resources before uploading code.

What is Chain Captain—and what is it not?

Chain Captain is best understood as the controller and user interface for a local ChainBus system. Its display can show a menu or sensor reading. Its buttons provide input. Its Chain port connects nearby addressable Chain nodes through a UART daisy chain. The nodes supply functions such as lights, sound, motion detection or distance measurement. The Captain does not turn ChainBus into a wireless mesh or a long-distance industrial fieldbus.

Device Role in the system Good first use
Chain Captain ChainBus master with display, buttons and battery Interactive portable or desktop control panel
Chain DualKey A different Chain controller focused on key input Simple button-led interaction without a display
Chain RGB, Buzzer, PIR or ToF Downstream input or output nodes Visible output, sound, motion input or distance input

The distinction matters when planning a build. A Chain RGB module is an output node, not a stand-alone controller; a Captain provides the logic that discovers and commands it. A Core or Atom controller can be useful for other M5Stack projects, but the Captain is distinctive because the display, buttons and ChainBus master role are integrated in one handheld-sized device. For the broader node ecosystem and ChainBus topology, see our M5Stack Chain Series and ChainBus overview.

Chain Captain hardware tour: the interfaces that matter first

The current M5Stack Chain Captain documentation identifies an ESP32-S3R8, 16MB Flash, 8MB PSRAM, a 1.54-inch 240 × 240 LCD, three user buttons, one power button and an 800mAh battery. The built-in BMI270 is a six-axis IMU, not a magnetometer or compass. There is also an RTC, microphone, speaker and infrared transmitter/receiver. These extra functions create room for later projects, but the first build only needs the screen, buttons and Chain port.

Hardware Why it matters in this project Boundary to remember
LCD and three keys Show READY, ACTIVE and ALERT; change or confirm a state The first UI should remain readable even when no Chain node is found
Chain port UART connection to Chain nodes Use the correct port and the Bridge in the documented direction
Grove port Optional expansion for a compatible external module It is a separate port, not an interchangeable second Chain port
USB-C Development power and data connection Use a data-capable cable when checking the serial port
Battery and RTC Portable or intermittent-use designs Capacity alone does not establish real-world runtime
BMI270, audio and infrared Possible later input and feedback channels Do not assume a ready-made voice assistant or compass function

The port map is specific to Captain. M5Stack lists the Chain UART as GPIO18 TX and GPIO17 RX; the Grove port uses GPIO6 TX and GPIO7 RX. A general ChainBus example written for Chain DualKey may use different pins. Copying that example's pin constants into a Captain sketch would make a correctly wired node appear missing. Keep the Captain PinMap beside the general ChainBus API guide when adapting a sketch.

Before you start: parts and software

The smallest useful bench setup is the Captain, its supplied Chain Bridge, one output node, a USB-C data cable and a computer. M5Stack currently lists one Chain Captain and one Chain Bridge in the package; a Chain RGB matrix or Chain Buzzer is a separate module. A visible output node makes the first check easier than a sensor alone: you can compare the serial response, screen state and physical output.

Item Required? Reason
Chain Captain and supplied Chain Bridge Yes Controller and directional link into the Chain system
One Chain RGB node Yes for the example project Produces an obvious visual response
USB-C data cable and computer Yes for Arduino development Power, upload and serial diagnostics
Chain Buzzer, PIR, Key or ToF Optional Add sound or a sensor input after the single-node test works
Arduino IDE, M5Stack board support and M5Chain library Yes for the Arduino route Compile, upload and discover Chain nodes

The official M5Chain Arduino library supplies the device-discovery and node-control APIs. Display and button work may also require the current M5Unified/M5GFX combination for the selected board profile. M5Stack lists Arduino, UiFlow2, ESP-IDF and PlatformIO as development platforms; that is not the same as a confirmed Captain-specific quick-start or firmware image for every platform. Check current support before following instructions written for another controller.

M5Stack Chain RGB 8x8 LED node proposed for the first Chain Captain status panel
The Chain RGB matrix gives the first project an output you can see immediately. Product image: OpenELAB catalog.

Step 1 — identify the ports and connect one Chain node

Do the first wiring check with the controller powered off. Find the port marked Chain, not the similarly shaped Grove connection. Place the supplied Chain Bridge so its triangular arrow points away from Chain Captain and toward the downstream node. Connect the first node at its IN side. If you later extend the chain, continue from that node's OUT side to the next node's IN side. The arrow rule is stated in the Captain hardware guide.

Connection order Check before power-up
Chain Captain → Chain Bridge → Chain RGB IN Bridge arrow points from Captain toward the node
Chain RGB OUT → next node IN (later) Only extend after the first node is detected reliably
USB-C → computer Cable supports data; computer recognizes a serial device

Do not use the Grove port as a shortcut when the Chain port seems inconvenient. Both are four-pin HY2.0 connectors, but the Captain documentation assigns them different UART pins and power controls. A module may fit mechanically while still being on the wrong bus. If you are unsure about the Bridge orientation, stop and compare the arrow and IN/OUT markings with the official photographs before applying power.

Step 2 — prepare Arduino and verify the controller first

Before trying to discover a node, prove that the Captain itself can be programmed. Install Arduino IDE, add the current M5Stack board package and install the libraries required by the chosen official example. Connect through USB-C and confirm that a serial port appears. Then select a board profile explicitly supported for Chain Captain in the current M5Stack instructions; do not silently substitute Chain DualKey simply because a ChainBus example was written for it.

For the first upload, keep the check small: a serial startup message, a visible LCD label and a change when a user button is pressed. If the computer sees no port, try a known data cable and inspect the USB connection before changing code. If upload works but the display stays blank, verify the board profile and display-library support; it is too early to blame ChainBus. If the buttons fail to change the indicated state, check the Captain-specific key mapping. M5Stack's current pin map shows KEYA/OK, KEYB/PREV and KEYC/NEXT on GPIO1, GPIO4 and GPIO5, respectively.

This is a verification sequence, not a claim that a particular sketch was compiled and run on our bench. Once M5Stack publishes a dedicated Captain example, use its stated board profile and dependency versions. A full copy-and-paste sketch belongs here only after a real Captain upload and serial/LCD check.

Step 3 — discover the first Chain node

The general ChainBus documentation shows the sequence a Captain sketch needs to implement: initialize the M5Chain object on the correct hardware UART, check whether any device responds, request the device count, then read the device list with IDs and types. For Captain, the UART must use its documented RX GPIO17 and TX GPIO18, rather than the pins in the Chain DualKey sample. The official API reference documents begin, isDeviceConnected, getDeviceNum and getDeviceList.

Check Expected result If it fails
Bus initializes Serial monitor reports that discovery has started Recheck board profile, UART selection, RX/TX assignment and library version
One node responds Connected-device check is positive and count is one Power off; inspect Bridge arrow, Chain versus Grove port, and IN/OUT orientation
Device list is read A stable ID and type are available to the program Check memory handling, bus timing and power before adding another node
Output command is acknowledged RGB matrix changes and serial status reports success Use the discovered node ID; inspect command result instead of assuming it worked

For an eventual tested screenshot, the useful evidence would show the serial line for one detected Chain RGB device, its ID and the matching LED change. A generic “upload successful” message alone would not prove that the Chain port works. The program should also handle an empty bus visibly: show “CHAIN DEVICE NOT FOUND” on the LCD and avoid silently presenting the last good state.

Step 4 — design the first project: a portable status panel

Use the three Captain buttons and one Chain RGB matrix to make a small, complete interaction. The LCD displays a state; the RGB node mirrors it with a color or simple pattern; the serial monitor records every state change and whether the node acknowledged it. The behavior can be designed before any hardware arrives, then implemented against a verified Captain-specific example.

State Captain display Chain RGB feedback Button action
READY “READY” and detected node count Neutral or low-brightness pattern A selects ACTIVE
ACTIVE “ACTIVE” and current node ID Green pattern B confirms; C returns to READY
ALERT “ALERT” with a clear acknowledgement prompt Red pattern B acknowledges; C returns
No node “CHAIN DEVICE NOT FOUND” No output assumed Recheck wiring before retrying

The information flow is button event → Captain state decision → ChainBus command → RGB response → serial/LCD confirmation. Keep the state transition local to the Captain so the screen still explains what happened when the output node is absent. If you add a Buzzer later, make ALERT produce a short sound only after that node is separately discovered. Avoid making a general alarm sound endlessly on startup or on a bus error.

A Chain ToF or Chain PIR node can be a second-stage input. For example, a ToF reading below a chosen threshold could propose ALERT; a user button would acknowledge it. That is a new sensor-validation task, not part of the one-node success criterion. Test raw readings, threshold behavior and false triggers before calling it a dependable proximity alarm.

M5Stack Chain Buzzer as an optional sound output for a Chain Captain alert panel
A Chain Buzzer can add audible feedback after the RGB-only state panel is working. Product image: OpenELAB catalog.

This official M5Stack clip demonstrates the Chain RGB node used as the proposed output. It does not show a Chain Captain build or an OpenELAB test.

Where does Chain Captain make sense?

Desktop equipment control: the user turns a Chain Encoder to adjust a setting, the Captain screen shows its value and Chain RGB confirms the selected mode. The limitation is application logic: the Chain nodes provide input and output, while the controlled equipment still needs a separately designed interface and safe operating rules.

Portable sensor viewer: add Chain ToF or PIR after the basic bus check, then display the live reading or event on the LCD. The built-in battery makes a movable terminal possible, but the 800mAh rating alone does not establish how long the display, radio and external nodes can run. Measure the actual load before planning untethered operation.

Local alert panel: let a sensor event trigger an LCD warning, an RGB pattern and, optionally, a Buzzer notification. This is a useful prototype for a workshop or maker project. It is not by itself a certified security alarm or industrial safety controller; those applications need separate reliability, power-failure and compliance design.

M5Stack Chain ToF distance sensor for a later Chain Captain proximity display project
Chain ToF is a possible next input once the first output-node project has been verified. Product image: OpenELAB catalog.

Common problems and FAQ

Is Chain Captain a ChainBus master or a Chain node?

It is a ChainBus master. It controls and reads downstream Chain nodes through its Chain port.

How do I connect the Chain Bridge?

Power the controller off. Insert the Bridge with its triangular arrow pointing from the Captain toward the downstream node, then connect the first node at its IN side. Check the current official diagram if the markings on your hardware differ.

Can I use a Grove module and a Chain module at the same time?

The Captain has one Grove port and one separate Chain port. A project may use both, but each peripheral needs its own compatible wiring, power budget and software driver. The Grove connection is not a second interchangeable Chain port.

Does Chain Captain support Arduino and UiFlow2?

M5Stack lists both as development platforms. Confirm the current Captain-specific board profile, firmware availability and examples before applying a procedure written for another M5Stack controller.

Does Chain Captain include a magnetometer?

The current M5Stack product documentation lists a BMI270 six-axis IMU. It does not list a magnetometer; do not treat this as a compass-equipped device without checking a later hardware revision.

What should I check if no Chain device is detected?

Check the Bridge arrow, the Chain rather than Grove port, node IN/OUT direction, power, Captain UART pins (RX 17, TX 18), selected board configuration and M5Chain library version. Test one node before extending the chain.

Can it be used as a battery-powered control panel?

The built-in 800mAh battery supports a portable design. Runtime depends on screen brightness, Wi-Fi, attached nodes, duty cycle and power-management code; it needs measurement on the actual build.

Is ChainBus RS485 or a wireless mesh?

No. M5Stack documents it as a local UART daisy-chain system for nearby Chain devices. Do not apply RS485 cable-length assumptions or mesh-network expectations to it.

Leave a comment

Your email address will not be published. Required fields are marked *

Register for our newsletter

Get the latest information about our products and special offers.

Website Feedback

Help us improve OpenELAB

Found a website issue or have an idea? Tell us what would make your experience better.