Tangible Interfaces Class Bluetooth Media Remote Control project
A micro:bit can pretend to be a Bluetooth keyboard, mouse, gamepad, or media remote and your laptop or phone won’t know the difference.
This program acts as a media remote. Bluetooth pair it with a computer or phone, and every microbit events can be sent as real media-key command — play/pause, volume, skip track — that Spotify, YouTube, etc; the operating system already has a driver for “Bluetooth remote,” and this project just becomes one.
Design Brief: Design and make a working remote control for music/video on your laptop or phone for an unusual customer type via a tangible interface. You have been hired by an electronics company to research an interesting use case and demonstrate a flagship interface for their remote control technology. Example software will be provided, your task is to design the physical form and one or more sensors and outputs to make an engaging and innovative experience.
This is a deceptively simple product that everyone can understand and we can build in class. The project rewards exploration of user needs and technical opportunities.
Example users found by previous students:
- “I work in an operating room and music always makes the day better. For years, I’ve used radio frequency remotes to control iPods while scrubbed in, all the while unable to utilize an iOS device for this purpose until now. This is the answer to a tiny prayer that somebody make a remote for the iPhone. I love this thing. I love it so much.” product review
- “I bought this for my motorcycle so I could control my music in my bluetooth helmet without taking my hands off of the handle bars. The steering wheel attachment is awesome and I used it to help mount it to my handlebars.” product review
- “I am unable to use a touchscreen with my Parkinson’s condition. this device is a lifesaver. I love podcasts.”
Parts
This is a fun little demo project using a Micro:bit as a Bluetooth media control remote. It doesn’t play music, it controls your computer / phone. Note: this works, but is really a basic tech demo for students to extend and explore. Opportunities include adding other features, using other fun sensors, adding a power switch or rechargeable battery, adding lights, etc.
This project uses the the microbit-pxt-blehid extension by Bill Siever. A Human Interface Device (HID) is Operating System code thats sends keyboard or media-key input to software listening to it, like Spotify.
- Microbit v2
- Sensor(s)
- Lights?
- 2 AAA batteries
- metal strips for battery contacts, or reuse from other products
- various short wires, soldered or ribbon cables
Instructions
- Play around with microbit and sensors
- Identify your user and where they will use it (while biking? in Surgery?, without the use of their hands?)
- What constraints do they have? What opportunities?
- Select a sensor(s)
- Program Microbit via USB cable
- Test program on breadboard
- Pair via bluetooth to target device
- Design your container
- Print parts
- Assemble frame
- Test program
- Rock on!🤘
Bluetooth Media Service commands
- next
- previous
- stop
- play/pause
- mute
- volume up
- volume down
- eject
Note that the same code also enables the microbit to become a keyboard, mouse or gamepad
Controlling YouTube videos demonstrates the “jump back 10 seconds” for learning guitar, etc It only works for YouTube on a laptop Chrome browser. (This is a limitation of the iPhone, not the microbit)
Example Project
This is a sample project using the common KY-040 rotary encoder sensor.
- Example reference 3D model
- Microbit Code for example
- example of saving state of the volume of the device
References
- The Microbit Bluetooth code example uses the awesome microbit-pxt-blehid extension by bsiever
- How to Pair and Unpair the Microbit to your phone & computer
- Human interface device
- Bluetooth Media Control Service Official Docs -not beginner-friendly