Build and Use the BLE Volume Knob

Here we'll build a simple-yet-powerful volume knob using a rotary encoder and Circuit Playground Bluefruit.

Build on Breadboard

Following the schematic above, plug the rotary encoder into the breadboard, and then connect the alligator clip wires between the encoder pins and the CPB.

The encoder is essentially two components in one -- the three lower pins are for measuring the knob rotational position, while the two upper pins are for the push switch when the knob is pressed down.

This is the wiring connection list:

  • Encoder A pin to CPB A3
  • Encoder GND to CPB GND
  • Encoder B pin to CPB A2
  • Switch ground to CPB GND
  • Switch button to CPB A1

Pair (and Bond)

Now you can power up the device with a battery (or USB power) and it will begin to advertise and turn the NeoPixel ring yellow.

On your mobile device or computer with BLE, pick the device (the first time you connect it may have a nondescript name, or the name Bluefruit Volume Control as seen here on an iPad), and agree to the Pairing prompt.

The devices will be paired, and automatically bonded so they can auto reconnect later.

Remote Control

Once connected, the NeoPixel ring will turn cyan. Rotate the knob to raise and lower the volume. Neat huh?! You'll see the bright pixel rotating around along with the knob.

Now, press the push encoder knob down to mute, and the NeoPixels turn red. You can unmute by pressing the button again, or by turning the volume knob.

You can also use the button A on the CPB to toggle Play/Pause.

Fancy Version

If you like, you can build a more permanent version using a Perma-Proto Gizmo.

First, remove the side mounting legs from the encoder using some diagonal cutters. We don't have mounting holes for them, and they aren't part of the circuit, they are just for mechanical stability.

Insert the encoder in the board as shown.

Be sure to remove the twelve amber Kapton stickers from the standoffs, otherwise there won't be an electrical connection to the CPB when we screw them together.

Using short lengths of hookup wire, solder the connections as shown in the schematic drawing below.

You can run all of the wiring on the underside of the Gizmo if you like,for a neater appearance.

Trim all of the excess pin and wire lengths with diagonal side cutters.

Battery

Place the battery between the two boards, and then screw them together with the provided M3 mounting screws.

Plug in the power, pair the CPB with your mobile device or computer with BLE, and you can use your volume knob in style!

This guide was first published on Jan 21, 2020. It was last updated on Jan 21, 2020.
This page (Build and Use the BLE Volume Knob) was last updated on Aug 09, 2020.