I was thinking of a wireless controller for my presentation so that I can walk all over the room during the presentation. I found some proprietary software that can turn your cellphone into something like this. But I thought I should make my own.
The first thing that came into my mind was to use a Bluetooth UART interface as my laptop aslo has a Bluetooth. I did buy one from RhydoLabz few months ago. This was a chance to put that to work. I simple hooked up a PIC microcontroller to the Bluetooth serial modem and paired the modem with my laptop and set up the COM port for accessing it from PC.
I had to use PIC microcontroller at that time because I didn’t have any other options. I don’t have my AVR programmer with me, and MSP430G series doesn’t have hardware UART. I admit using a PIC18F2550 for this job is overkill, but I had that chip and nothing else that I could use easily.
The C18 compiler suite was very helpful with all the built in library. Setting up the UART was a little hellish though. Had to learn a lot about PIC clocks. I was new to PIC architecture at that time. Learned a lot about PICs.
The basic circuit is simple. A button is hooked up with the microcontroller and also an LED for indication of button press. Whenever the button is pressed, character ‘C’ is sent through UART. Initially I planned to make multiple control schemes, e.g. mouse movement and scrolling, so I decided to put ‘C’ as a click action.
In the PC, the paired devices has a fixed COM port. So I simply accessed the COM port in Visual Basic and wrote a ‘data received’ event handler to CLICK.
Then I had to emulate the click in Windows. I had to do that with a Win32 API call. I had to Google it a bit to figure how to do that. I really didn’t understand that part of the code, but I simply pasted the code and tweaked it to work with my program.
My next plan is to make mouse navigation and scrolling with it too, which doesn’t really involve much of a work. I did learn that it’s pretty easy to make Wireless custom built HIDs, for various needs.
PIC code is here. It’s for Microchip C18 compiler.
Visual Basic project files for Visual Studio Express Edition 2008 is here.
P.S. I will be posting a photo too maybe. It is also possible to figure out the circuit schematic from the PIC code as the operation is pretty simple and we don’t have to mingle with any of the Bluetooth protocol.