KCX_BT_Emitter 5.3 name change
I needed a couple bluetooth devices for varius audio projects. One was a music stream point in my 1958 Plymouth, but the catch was that I wanted it to have a custom name. Instead of something like "Bluetooth Device" I wanted it to say "58 Plymouth" or whatever I needed it to be. And, I wanted it permanent in place, installed inside the original radio, no external buttons and absolutely no announcements.
After some research I ordered 5 modules almost for free from Aliexpress and set to work.
They are called KCX_BT_Emitter Bluetooth 5.3.
They are supposed to work with AT commands and serial communication, but I could not get it to work following online advice.
I first tried connecting the modules using an Arduino Nano as a serial bridge, but that did not work, possibly due to the Nano using SoftwareSerial. I then switched to an Arduino Mega. using hardware serial (D18 D19) and a minimal sketch, I got it to work, but not the way I expected, but in the end I got it to do what I needed.
Their default baudrate is 115200, and to have it receive bluetooth and stream audio out it's speaker connectors, you will have to close the tx/rx bridge on the board.
These are the connections:
MEGA D18 -- RX on KCX module
MEGA D19 -- TX on KCX module
MEGA 5V -- 5V on KCX module
MEGA GND -- PGND on KCX module
And heres the sketch.
void setup() {
Serial.begin(115200);
Serial1.begin(115200); // KCX default enligt forumklippet
Serial.println();
Serial.println("KCX raw terminal @115200");
Serial.println("Power-cycle KCX now. Väntar på POWER_ON...");
}
void loop() {
while (Serial1.available()) {
byte b = Serial1.read();
if (b >= 32 && b <= 126) {
Serial.write(b);
} else {
Serial.print("<0x");
if (b < 16) Serial.print("0");
Serial.print(b, HEX);
Serial.print(">");
}
}
while (Serial.available()) {
char c = Serial.read();
if (c == '\n') {
Serial1.print("\r\n"); // tvinga CR+LF
} else if (c != '\r') {
Serial1.write(c); }
}
}
This sketch uses the serial monitor as the input. One datasheet suggested the BT module should spit out an ON status, but these modules did not. To change name, the command I found was working was this:
AT+NAME+yourname
So AT+NAME+ 807 Amplifier gave this response
AT+NAME+807 Amplifier<0x0D><0x0A>
and now, with the bridge on the board (RX/TX) closed, I can connect to it and stream music to it.
There are probably other commands you can use, but for my use case, this was all that was needed
Perfect.
Regarding audio quality, it sounds just fine. No bluetooth hash, just clean audio. Using these modules as bluetooth transmitters on the other hand, might be more prone to noise.
Good Luck with your project
//Tommy
Comments
Post a Comment