Serial text command

1 min read · updated 23 Jul 2026

Suits automation systems and Arduino-style controllers that can send defined start and stop text over a COM port.

ControlGuidance
PortSelect the COM port created by the USB serial device, Arduino or serial interface. Recheck this after moving the device to another USB socket.
BaudSet the same speed at both ends. The example below uses 9600 baud.
Start commandThe exact text that starts recording, for example REC ON.
Stop commandThe exact text that requests recording to stop, for example REC OFF.
Run-onBroadcastLogger continues recording for this period after the stop command before closing the file.

Basic Arduino example

This sketch uses a button connected between digital pin 2 and GND. Pressing the button sends REC ON; releasing it sends REC OFF. Set BroadcastLogger to the same COM port, 9600 baud and matching command text.

const int triggerPin = 2;
bool lastActive = false;

void setup() {
  pinMode(triggerPin, INPUT_PULLUP);
  Serial.begin(9600);
}

void loop() {
  bool active = (digitalRead(triggerPin) == LOW);

  if (active != lastActive) {
    Serial.println(active ? "REC ON" : "REC OFF");
    lastActive = active;
    delay(25);  // simple switch debounce
  }
}

Serial.println() adds a line ending. Keep the command spelling, spaces and letter case consistent with the fields in BroadcastLogger.

Was this page helpful?

Still stuck? Ask in the community forum .