I have a Circuit Playground Classic and a Circuit Playground Express and have been trying to connect an HC-05 bluetooth module. They are both so rich in sensors that I thought it would be a great start to learn how to send data over the Bluetooth connection to my phone to view the sensor data.

So to begin I started learning all I could about the HC-05 Bluetooth module. I was able to use an FTDI board to hook it up to my computer. I booted it up into command mode and used the serial monitor to verify the settings of the Bluetooth module. It was setup with the follow settings which is basically the way they all come. AT+NAME:HC-05

The tutorial works through the entire concept and then has an Arduino page, a MakeCode page, and a Circuit Python code page. I'm still most comfortable in the Arduino world and so I gravitated to that page first. Unfortuantely its blank!

So I moved on to the MadeCode example.

Here is the MakeCode from the tutorial

But when I went tired to enter the same code in the MakeCode browser, they seem to have changed the serial plugin because you can only change the RX and TX pins, there is no third option to change the Baud rate. It actually looks like this

Screenshot 2019-02-10 21.38.30.png (6.5 KiB) Viewed 92 times

So I moved on to the circuit python example. I'm still learning and not at all comfortable with python but at this point I just wanted something that worked!And luckily it did. This picture shows how I hooked up the Bluetooth module using VBat, GND, TX, and RX,I know it is hard to see so here is the pin out. CPY ---> HC-05VBATT ---> VCC (RED) GND ---> GND (Black) TX ---> RXD (Yellow) RX <---- TXD (White)

IMG_20190210_223017797.jpg (57.76 KiB) Viewed 92 times

So with this success, I was happy that things were working but I really wanted to get this working under Arduino Code. So I switched to the Circuit Playground Classic, hooked it up exactly the same way and tried this code.

// the follow variables is a long because the time, measured in miliseconds,// will quickly become a bigger number than can be stored in an int.long interval = 1000; // interval at which to blink (milliseconds)

void setup() {

Serial.begin(9600); Serial.println("Circuit Playground test!");

CircuitPlayground.begin();}

void loop() { CircuitPlayground.redLED(LOW); // turn off the built in LED

while (Serial.available()) { CircuitPlayground.redLED(HIGH); // turn on the LED to let us know Serial is available

Serial.println( Serial.read() ); //Just echo it back out }

unsigned long currentMillis = millis();

if(currentMillis - previousMillis > interval) {

// save the last time you blinked the LED previousMillis = currentMillis;

The TX and RX pins on a Circuit Playground and Circuit Playground Express are identified in code as interface Serial1.

The microcontrollers on both boards handle USB internally, so the Serial connection that talks to the Arduino IDE's Serial Monitor only exists in code. The pads at the edge of the board are connected to a hardware Serial peripheral, and are free for connections to other Serial devices.

To set the baudrate, just use Serial1.begin(BAUDRATE), like with the connection to the computer.

The use of Serial1 is fairly standard on boards whose microcontrollers handle USB communication internally. The interface identified in code as 'Serial' is always assumed to be the one that talks to the computer.