With the choice of microcontroller all figured out, I needed a way to connect the user's phone to my device. The idea was that the user's phone would connect to the MSP430 + APDS-9960 and then would send different commands to control the phone and music on the user's phone. From there the user would hear their music or phone call through the auxilary cord in their car.
My first idea at making this work was to send the commands through the phone's USB port. This way the user doesn't have to download an app on their phone for the device to work. However this proved to be very difficult. The MSP430 doesn't have a hardware USB protocol on the chip so USB would have to be bit-banged. Even if the MSP430 did have a hardware USB or I could big-bang the protocol, sending commands through USB proved to be a non-trivial task, even on a desktop computer. I figured this would be too much trouble than it would be worth.
I then turned to using Bluetooth to send commands to the phone. I didn't know much about bluetooth so I had to look up if there was a way to send media commands to the phone such as Answer Call, Decline Call, Pause Music, Skip Track, etc. It turns out there is. The proflie in particular is called Advanced Audio Distribution Profile (A2DP). I looked up a couple of Bluetooth modules that support this profile however, they all seemed to expensive for this application. The MSP430G2553 is $0.70 and the APDS-9960 Module is $15 so the current cost of the device is around $15.70. A particular bluetooth module I was interested in was the RN-52:
This module cost $25 on Sparkfun which was more than my device cost already! Other stores had similar prices for this module and others that were similar to it, so I decided to look for another solution.
With media bluetooth profiles costing too much for this project I decided to look at another bluetooth profile to send data to the user's phone. In particular I thought of using a Serial Port Profile (SPP). This profile is very simple as it essentially imitates an RS-232 cable. I originally thought that perhaps I could send different AT Commands to control different functions on the phone, however I quickly learned that you would need to write an app in order to make that possible. I really didn't want to have the user download an app (nor did I really want to write one), but I found that Serial Bluetooth Modules were much cheaper. The two that I came across were the
and the HC-06:
If you think these two modules look exactly the same, then you're right because they are the same! The only difference between them is the firmware that is loaded onto them. The HC-05 is able to act as a Bluetooth Master Device and a Slave Device, while the HC-06 is only able to act as a Slave Device. This means that the HC-05 can connect to multiple devices and send and receive data to multiple devices, while the HC-06 is only able to connect to one Master and send and receive with only the master. For this project we only need the device to send data to the phone so either devices work for this case. I ultimately decided to use the HC-06 for this project because it is typically cheaper than the HC-05 (not by much, but still on average, cheaper).
Since I am using a Serial Port Profile bluetooth device, I need to create an app which will relay the different gestures to commands on the phone... Which will be in the next project log!