Movement tracking – First version

In the beginning I tried to generalize motion tracking system. Previously I tried to detect a colored object and rotate the camera accordingly. The fundamental concept of operation is to detect movement by detecting changes between two consecutive frames. The camera rotates according to the movement and tries to keep the moving object in frame.


It uses OpenCV with Python bindings to run the computer vision routines. The whole computer vision subsystem contains image processing followed by contour detection. The camera rotation platform uses a stepper motor that is controlled by a Atmel ATmega8L micro-controller which is connected to the computer with a Bluetooth Serial modem.

The custom PCB that contains the ATmega8L and the Motor driver that driver the motor…

Camera mounted on the rotor

There is a lot of room for improvement. I will continue to work on this.

This was my B. Tech Final Year Project.

All codes are on including the AVR Studio Project files required to compile and program the micro-controller that is responsible for interfacing the camera rotation with the computer. The complete report is also here.

Just a colour changing lamp

I made this for a friend of mine. I did experiment with LED diffusion. Cutting the LED head produced great diffusion, but pretty difficult to achieve without good cutting apparatus. These I diffused with hot glue deposit. Not as good has the head less LED diffusion, but will work out just fine.

Did it with software PWM and utilized the timer…

Here is the internal structure. I know, pretty untidy… 😛

Consists a MSP430G2221. Powered with a CR2032.

The jack hole acts as a switch…

This is the thing while it’s on (the stereo jack is plugged in)…

Here is the code

Bluetooth based clicking device

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.