2019 Tech Advent Calendar Day 21: Arduino Bluetooth UI (Patreon)
Content
One of my lovely patreons recently asked if I could do an video illustrating how to create a Bluetooth connection to Arduino. There's already quite a few examples on the internet that illustrate a basic setup for the popular (and cheap!) HC-05 Bluetooth module, which is available for just $3 from https://www.banggood.com/custlink/DvmGNF87NU (I have no idea how anyone can manufacture something and post it from the other side of the world to me for less than the cup of coffee in Starbucks!), so I wanted to try to think up a slightly different angle...
Then, I came across the Blue Display library, which you can find at https://github.com/ArminJo/android-blue-display/blob/master/README.md , which I found really intriguing. It's a library of two halves - an Android app that runs on your phone, and an Arduino sketch, which talk to each other via Bluetooth. What's unique is that the user interface displayed on the phone is actually defined in the Arduino sketch, and sent via Bluetooth when the device first connects. I thought this was a great way to illustrate how the HC-05 transceiver module can both send and receive data over bluetooth, so here it is! Note the section of the video about wiring - although the HC-05 can be powered at 5V, the logic level of the data lines is only 3.3V, so you shouldn't connect it directly to the Arduino GPIO pins - instead, you can create a simple voltage divider circuit using one 1kΩ resistor, and one 2kΩ resistor. (Note that it's fine to connect the Tx output from the HC-05 directly to the Arduino).
If you have any questions about how it works, or can think of an example of how you might want to see Bluetooth technology used in a future escape room puzzle, please let me know!