Bluetooth Rotary Knob for mock-up interfaces on Android
Source code is available in our GitHub repository: https://github.com/InstituteOfErgonomics/DDS
Pairing and hello world application:
<iframe width="560" height="315" src="https://www.youtube.com/embed/JXzMa86kK9Q" frameborder="0" allowfullscreen></iframe>
How to use the Arduino / Android DRT setup
<iframe width="560" height="315" src="https://www.youtube.com/embed/-pPLVVqk_XY" frameborder="0" allowfullscreen></iframe>
We have seen several times, that simulators were equipped with rotary knobs without haptic feedback (free spinning). Often USB devices are involved, that are originaly intended e.g., for video cutting on a desktop PCs. For the automobile domain these are not suited, due to the missing haptic feedback.
Here you find a low price way, to enable the development of own mock-up in-vehicle interfaces for experiments, that can be controlled with a suited rotary knob.
For this small project a rotary knob (spare part number BMW 6944884) from Ebay was used. Disassembled, equiped with an Arduino Nano and a JY MCU HC-06 bluetooth module. Aim was to controll some self-writen Android app prototypes on smartphones and tablet, for driver distraction studies. So, the repository above not only holds an Arduino sketch; additionaly a small rotary knob hello world app for Android.
To connect and configure the JY MCU HC-06 bluetooth module with the right parameters, e.g., rate, PIN and bluetooth name please consult https://github.com/rwaldron/johnny-five/wiki/JY-MCU-Bluetooth-Serial-Port-Module-Notes.For this project:Rate 57600(AT+BAUD7)Name myDDS
DDS is German and stands for Dreh-Drücksteller (rotary and push knob).If you have coupled the bluetooth devices (phone and DDS), the app expects that the DDS has the bluetooth name myDDS.
The knob was opened. There are two circuit boards inside. The smaller (upper) board and the larger (lower) board. The upper board has three light barriers/sensors. Two light barriers sense the rotary motion, like in old mechanical mouses (phase shifted A, B signal). The third light barrier is interrupted, when someone pushes on top of the knob. The connector between the boards was disconnected and the wires were tapped to the Arduino. The power for the upper boards is also provided from the Arduino Nano (5V). On the lower boards are four mechanical switches for the 4-way navigation (joystick). These were disconnected from the circuit (scratching) and routed with thin wires to a new connector, which was glued with expoxy to the board. From there connected to some Arduino Nano active low inputs, so we need five wires (buttons connect to GND when closed).
The bluetooth module and the Arduino Nano fitts into the original housing. The USB cable is used for power supply, to upload updates to the Arduino Nano or to transmit the rotary knob commands also via USB if you want.
The commands are coded into a 3char string like ‘#PU’ or ‘#tl’ + new line. The first char # is always the same. The second char holds the event:
- ‘t’ turn (only for rotary)
- ‘P’ press (for 4way and Ok-Press)
- ‘H’ hold (for 4way and Ok-Press) repeat rate 6,67Hz after 500ms hold
- ‘R’ release (for 4way and Ok-Press)
The third char provides more specific information:
- ‘l’ turn left (only for rotary)
- ‘r’ turn right (only for rotary)
- ‘P’ push Ok-button
- ‘U’ 4-way up
- ‘D’ 4-way down
- ‘L’ 4-way left
- ‘R’ 4-way right
This documentation is not in the public domain, but the following is valid for it:
THE DOCUMENTATION IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE DOCUMENTATION OR THE USE OR OTHER DEALINGS IN THE DOCUMENTATION.