Skip to content
If this is your first visit, please click here to learn about shipping and delivery.
If this is your first visit, please touch here to learn about shipping and delivery.
Four-channel Bluetooth relay control board with terminal connections

Controlling a Bluetooth Relay Board: Serial Commands, App State and Reconnection

A Bluetooth relay board needs more than a successful phone pairing. The application must open the correct kind of connection, send the exact command format expected by the board and keep its display honest when the link is lost. A button changing colour on a phone does not prove that a relay changed state.

PMD Way's four-channel Bluetooth relay module is listed for Bluetooth 2.1 serial communication, with an Android-oriented interface and a 6.5–25 V DC board supply. The listing explicitly excludes iOS compatibility. Confirm the supplied revision and command documentation before building an application; do not infer a protocol from another four-relay board.

Distinguish Bluetooth Classic from BLE

Bluetooth is a family of technologies and profiles. A serial-style Bluetooth Classic module is not automatically usable by an app designed for Bluetooth Low Energy services. The discovery screens, connection methods and application protocols can differ.

The Bluetooth SIG's Serial Port Profile test specification describes virtual serial communication through RFCOMM. This explains the transport model used by SPP-style devices; the bytes carried over that connection still need their own board-specific meaning.

Choose an application tool that supports the documented transport. MIT App Inventor's BluetoothClient documentation is a useful starting point for compatible serial Bluetooth projects. Do not assume a generic BLE scanner or a Bluetooth audio connection will control this relay module.

Obtain the command table first

Before designing buttons, obtain the exact commands for each channel and state. Record whether the board expects text characters, binary bytes, delimiters, checksums or a fixed packet length. Also establish whether it returns acknowledgements or supports a status query.

The store description does not provide that command table, so a complete app cannot safely be created by inventing ON and OFF strings. A terminal tool can help test a documented protocol, but trial-and-error messages are a poor substitute when unknown commands might change settings or operate several outputs.

Keep a small protocol worksheet with a row for each operation: channel number, desired state, transmitted bytes, expected response and timeout behaviour. Include the board's firmware or revision if available. This becomes the reference for both manual testing and the finished app.

Understand text versus bytes

The character “1” is not the same as the numeric byte value 1. A hexadecimal packet written as a sequence of numbers in a manual is also not necessarily a string containing those printed characters. Sending the wrong representation can produce silence even though Bluetooth is connected correctly.

Likewise, some terminal apps automatically append a newline or carriage return. That may be required for a text protocol or may corrupt a fixed-length binary packet. Configure the sending tool to match the actual specification and log the exact data transmitted during the first tests.

Do not apply a serial baud-rate setting from the module's internal electronics indiscriminately to the phone connection. Follow the host-side instructions for the selected Bluetooth profile and tool. Separate radio connection configuration from the command format carried over it.

Prepare the board without a real load

Use a suitable current-limited DC supply within the documented range, with verified polarity. The ability to accept a range of supply voltages does not make the board's exposed pins interchangeable or establish the current required when all relays operate.

Leave contact loads disconnected during pairing and protocol tests. Identify COM, NO and NC from the actual board markings, then verify contact operation independently. A relay LED may reflect its drive circuit rather than proving that the external load path is correct.

Start with one channel and one documented command. Confirm the result, return the channel to the intended inactive state and repeat. Only after that baseline works should you add the other channels and test simultaneous operation.

Build an interface that distinguishes requests from results

Useful application states
State What the user should see
Disconnected No claim about current relay states; controls requiring a link are unavailable.
Connected The selected board identity and connection status.
Command sent A request is pending until the documented response or timeout.
State confirmed Confirmation only if the board provides meaningful status feedback.
Response unavailable A clearly labelled last-commanded state rather than a measured state.

If the board offers only one-way commands, make that limitation visible. The app can remember what it requested, but it cannot know whether a relay contact moved or a load is energised. Applications requiring verified operation need appropriate independent feedback.

Prefer explicit set-state commands where the protocol supports them. Retrying “set channel two off” is easier to reason about than retrying “toggle channel two”, which can undo a successful first command if the response was merely lost.

Handle permissions and reconnection

Modern Android releases have version-dependent Bluetooth permission requirements. The official Android Bluetooth permissions guide explains scan and connection permissions. A pairing entry in system settings does not prove that your app currently has permission to discover or connect.

Test the application after denying a permission and after granting it again. Explain the missing capability clearly rather than showing an endless connecting indicator. Also test screen locking, leaving radio range and restarting the board.

On reconnection, do not immediately replay every old command unless that is an intentional, documented requirement. First establish the board's state if possible, then let the user or application policy decide what should happen next. Test power-return behaviour separately from Bluetooth reconnection.

Keep the installation proportionate to the project

A pairing PIN is not a complete access-control design. Restrict physical access and use documented security settings where available. Do not depend on an ordinary hobby Bluetooth relay board as an emergency-stop system or a safety interlock.

Once communication works, begin with a modest low-voltage test load. Establish the actual contact, terminal and wiring limits instead of treating the relay's headline rating as a universal board rating. Compare the Bluetooth relay board collection with the required protocol and feedback features in mind. A reliable controller makes its connection state and its knowledge of the load explicit.

Previous article Battery Power for Arduino Projects: Voltage Range, Runtime and Regulator Heat