Hi everyone, here is my new project, a mouse controlled with the movement of the head! I decided to make this project once I received my accelerometer/gyroscope MPU6050 from IC Station, and I wanted to do something useful with this.
Then I found out that a "Head Mouse" already exists, made by Martin Millmore with another accelerometer/gyroscope.
Well here is my version, made with an Arduino Micro and a MPU6050.
Thanks to IC Station http://www.icstation.com/ for the accelerometer/gyroscope they sent me, allowing me to create this project!Step 1: Materials and tools needed
- Arduino Micro
- accelerometer/gyroscope MPU6050
- a Compeed box (I found this comfortable as Martin Millmore said in his guide)
- an elastic band
- micro USB cable to USB type B (like those used for Android smartphones)
- a PCB board
- glue or better, Sugru
- a computer with the Arduino IDE installed
- soldering station
- mini drill
- Solder on the pcb board the pins like in the image: pin 2 of Arduino to pin SDA, pin 3 to SCL, pin 5V to PWR, pin GND to GND.
- Make a hole with the Dremel on the Compeed box so the micro USB cable can reach the Arduino Micro, and two straight holes for the elastic band.
- Glue the board to the box and add the elastic band.
Connect the board to your computer and load first the "Test" code to the Arduino to test if everything work fine. You'll probably need to change some values (everything is written in the code's comments) since I had to add a constant, because values from the gyroscope are not "zero" when I'm not moving.
Use the Serial Monitor to check if you need to fix the "zero" of the gyroscope. Once you found the right values you can load the program deleting the "
" part, that is equivalent to the standard code.
If you want the click function after a delay of time since the pointer has been in a 10x10 pixel zone load the code "
" to Arduino Micro.
Here there are the codes:
To use them you'll need the MPU6050 and I2C libraries: