Silícios LabPCBWay
Created February 17, 2020 © GPL3+

How to change the Bluetooth Module name easily with Arduino

In this project you'll learn how to name your Bluetooth Module and detect fails in the working of your bluetooth.

BeginnerProtip1 hour1
How to change the Bluetooth Module name easily with Arduino

Things used in this project

Hardware components

PCBWay Custom PCB
PCBWay Custom PCB
×1
HC-06 Bluetooth Module - UTSOURCE
×1
Jumper Wires - UTSOURCE
×1
UTSOURCE Breadboard - UTSOUR
×1
Arduino UNO - UTSOURCE
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Electronic Schematic

Code

Code

Arduino
#include <SoftwareSerial.h>


SoftwareSerial mySerial(10, 11); // RX, TX
String command = ""; // Stores response of bluetooth device
// which simply allows \n between each
// response.

void setup()
{
// Open serial communications and wait for port to open:
Serial.begin(115200);
Serial.println("Type AT commands!");
// SoftwareSerial "com port" data rate. JY-MCU v1.03 defaults to 9600.
mySerial.begin(9600);
}

void loop()
{
// Read device output if available.
if (mySerial.available())
{

while(mySerial.available())
{ // While there is more to be read, keep reading.
command += (char)mySerial.read();
}
Serial.println(command);
command = ""; // No repeats

}

// Read user input if available.
if (Serial.available())
{
delay(10); // The DELAY!
mySerial.write(Serial.read());
}

}

Credits

Silícios Lab

Silícios Lab

59 projects • 116 followers
Hello, I'm Diego Moreira, founder of the Silícios LAB and I love program microcontrollers and works with electronic projects.
PCBWay

PCBWay

61 projects • 93 followers
We are a pcb prototype and assembly manufacturer to help creators build projects. As low as $5/10pcs and 3 days delivery time.

Comments