A Bluetooth Smart way to Toggle RF Switches

Article

TJ Dahunsi

Mar 14 2017 · 1 min

Last week I decided I was going to try to build a way to turn on the fan at the foot of my bed without getting up. It's almost spring, so temperatures vary between hot and cold for the near reptilian blood temperatures I prefer to sleep at, and getting up to turn the fan on and off had become a chore.

I had attempted this earlier using NSD with Android things on a Raspberry Pi 3, going as far as to port the RcSwitch library to Java, but with Android Things being as abhorrently slow as it is, that failed miserably. Without the useful Wi-Fi NSD APIs provided by Android, I figured the easiest thing to do was to use BLE to control the Arduino remotely, and it proved a great success.

The resulting app can sniff 433/315Mhz transmissions, and replicate them on demand essentially replacing the remote of the device with your phone. It also gives a handy UI to let you rename what was sniffed so you don't have to memorize what number controls what switch.

The app BLE client and Arduino BLE server code are in the same repository on Github. A video overview of the project is embedded below:

,