Instructables

Head Mouse - Game controller or disability aid

FeaturedContest Winner
Picture of Head Mouse - Game controller or disability aid
IMAG0196.jpg

My kids wanted to have a head controlled mouse for playing Minecraft - they wanted to move their heads and have the field of view move. I decided that was a challenge I couldn't resist, so I decided to build a movement controlled mouse using an arduino and a gyroscope chip.

Components

A-Star 32U4 Micro - a tiny Arduino Leonardo clone

LSM9DS0 Breakout board - a combined gyroscope, accelerometer and magnetometer

A 3.3V to 5V logic level converter

10k resistor

push button switch

strip board

I started off prototyping with an Arduino Uno, and but it doesn't have the ability to be a HID controller at the same time as being able to load the firmware via USB. I tried reading the sensors via the serial port, but that's just not the same as a genuine mouse because you always need a client piece of software running, which isn't elegant, nor is it always convenient. However, the Arduino Leonardo does have the ability to act as a mouse or a keyboard, so I decided to use one of those. In fact, what i decided to use was a clone of that. There is a fantastic clone board called the A-Star 32U4 Micro, which is tiny - just 1" x 0.6", and it's half the price, so it's a winner all round for this project,

For the gyroscope, I chose the LSM9DS0 chip which is a combined gyroscope, accelerometer and magnetometer, giving me the choice of being a bit more sophisticated about detecting movement. I don't have the facility to make my own circuit boards or to surface mount chips, so I bought it on a breakout board.

The LSM9DS0 runs with 3.3V outputs, but the processor needs 5V inputs, so a logic level converter for the SCL and SDA lines is required too.

Finally, it's a good idea to be able to turn the mouse operation of the device on and off without unplugging it - that way if you make a mistake, you can re-program it without the mouse feature running wild.

 
Remove these adsRemove these ads by Signing Up
1-40 of 101Next »

Hi! Great project!

I'm trying to make this project with an added feature, making it wireless. Any suggestions and recommendations?
Also A-Star is not available in our country. Can I use Fio v3 or Pro Micro?

millmore (author)  EddieLearner22 days ago

You could turn it in to a bluetooth mouse using a BlueSMiRF. I found a good tutorial for that here;

http://www.kobakant.at/DIY/?p=3310

Yes, you can undoubtedly use a different arduino compatible board. I chose the A-Star because it is small and could act as a HID, but if you are using the BlueSMiRF, it will be the HID, not the arduino, so you have more options.

Thanks for your great suggestion!

If I were to use the BlueSmirf HID, I can use any Arduino(w/ or w/o HID support). Is that right?
Also, if I were to use this item, will the code be very different? Or just some minor tweaks?

millmore (author)  EddieLearner19 days ago

I've not tried it myself, but yes, I suspect you could use any arduino.

The code that calls Mouse.move would need to be changed to make the bluetooth HID calls.

millmore (author) 1 month ago
It's certainly not the only multi-sensor out there that is arduino compatible, but I haven't found any others that work well. I did try a GY-521 Module MPU-6050, and didn't have a lot of luck - it wasn't very stable. But others might work better.

pls sir help me do this project with MPU-6050(combined gyro and accel).. im new to the aurduino world and i don't know how to write code's for aurduino..pls help me....

if any code available(it may not work better).. pls send me sir...

millmore (author)  chassisdeepak28 days ago

There's a good article on that here;

http://playground.arduino.cc/Main/MPU-6050

pls sir help me do this project with MPU-6050(combined gyro and accel).. im new to the aurduino world and i don't know how to write code's for aurduino..pls help me....

tmalau1 month ago

great,

I have a problem with LSM9DS0, can i change with my

GY-88 Motion Sensor 10-DOF (Accellerator+Gyroscope+Barometer+Magnometer)

millmore (author)  tmalau1 month ago
I haven't tried it myself, but I imagine you could.

Just out of interest, what problem did you have?
tmalau millmore1 month ago

i cant find LSM9DS0 on my country (Indonesia). But i'm still trying to find it. Do you have an opinion what i can use to change LSM9DS0. It could be nice. Thanks for ur replay

SiddheshA1 month ago

Instead of the A-Star 32U4 clone I'd like to use the original Arduino leonardo. What changes will i need to make now?

I successfully made it with a Leonardo, and needed no changes. The pin numbers are even the same as the clone board!

Could you if possible send me the pin diagrams of your circuit? As somebody with no previous experience of Arduino or breakout boards I'm having a lot of problem making this device. Email ID: siddhu994@gmail.com

Hi SiddheshA, here's a diagram of the circuit with the Leonardo. One thing that my son and I tripped up on was forgetting to connect the 3.3v output from the Arduino to the connection running between LU on the logic board and VDD (3.3v) on the breakout board. I also has a problem initially with my solder joints on the breakout board -- I had cold solder joints (Dull, not shiny, didn't flow nicely down to the pin collar) and the board wouldn't respond to any of the test scripts. Check those solder points! Good luck!

Screen Shot 2014-09-06 at 18.44.07.jpg
millmore (author)  SiddheshA1 month ago
I don't believe you'd need to make any programming changes to make it work. The board is much bigger, so you'll need a bigger case, and you'll need to build a shield for the sensor and logic level converter to plug in to it rather than PCB mounting everything.

The reason I didn't do this is that the end result will be significantly bigger (twice as long, three times wider, twice as thick), and more expensive. Obviously if you have one lying around it makes sense, but otherwise it's not the best plan.

I'm a third year Engineering student in Mumbai and I have chosen this as my project topic. As interesting as i find this, the problem is i have absolutely zero experience with Arduino programming and using any kind of breakout board. Will it all still work if i simply follow your instructions? Or can you please provide me further details about the things i need to take care of as a newbie on using these boards? Any kind of help will be hugely appreciated :)

fox492 months ago

Excellent project!!!

For
the clicks, I don't know if it has been said before but an idea: you can
use the sound propagated through the skull of a chock between the teeth.

millmore (author)  fox492 months ago
That's a really interesting idea, You could probably distinguish between single clicks and double clicks pretty easily too if you are listening for sound.
fox49 millmore2 months ago
Any idear for the sensor?

This is for sound to ear :
http://www.noliac.com/Conduct_sound_through_bones_of_skull-8078.aspx
but i think a simillar system can be used. (in France soldiers are using a skull bones comunication device that detect vibration of the skull by the speaking soldier and make skull vibrate for the listening soldier. I think it's the same device that do both functions)
DanielH12 months ago

excellent project, has helped me a lot, do you possible this mouse communicates with a board whose system is android think?

millmore (author)  DanielH12 months ago

Yes, this works as a standard mouse, and can be connected to an Android system. I've plugged it in to my phone using a USB to go cable, and it worked great.

DanielH1 millmore2 months ago

Thank you very much

djimenez92 months ago

Thank you so much for this project, Im trying to edit a little bit the code, but I dont know where the methods for Mouse are, I would apreciate your help.

Nevermind, I found them in the web of arduino leonardo.

millmore (author)  djimenez92 months ago
Good. It's the Mouse.move line in mouseMoveGyro that moves the mouse.

:D

soapdude3 months ago

Awesome and simple project for the electronics beginner!
Do you have any tips or suggestions as how to reduce drag of the mouse? I often find myself having to move the mouse to the side or the top of the screen to readjust the location of the mouse with respect to my head! Thanks in advance!

millmore (author)  soapdude3 months ago
Yea, I know what you mean - it's the same as moving your mouse too far left or right - you need to pick the mouse up and move it back again. Not so easy to do with your head. One thing I did experiment with earlier on was having the direction of the mouse output as a serial stream from the arduino, and have a simple PC app to listen to that and turn it in to a mouse location on screen. It worked well and is immune to over pointing, but it needs the client side app to work, which I didn't like so much.
srcompany7773 months ago

I think it's a good project, but I have a challenge for you to do it with a wirlis

photoace125 months ago
By the way, how much did this all cost?
millmore (author)  photoace125 months ago

I'm in the UK and bought everything from coolcomponents.co.uk. The gyroscope chip is the most expensive part of this - that cost £22. The arduino was £10, the logic level converter was £2. Everything else was scraps I had lying around, so that cost me about £35 in total. In the US you can get the same for about $50 from sparkfun. The gyroscope means it's not a cheap mouse, but it's fun.

you are paying a lot over the average price for your chips, on ebay you can get the 3 axis gyroscope / Accelerometer chip @ £2.50

item number 221428586941

or if you have time to wait from the Philippines @ £0.99

item number 121190957975

millmore (author)  Poppy Ann5 months ago

The first one is £3.85 now, but even so, that's a lot better value! It's not the same chip, but I've ordered one to see how it behaves in practice. If it works as well it would cut the cost to about £18. Thanks very much for the info.

Would you kindly update your instructable if that gyro-chip works?

Also, great job on the ible!

you are right they have gone up in less than 24 hours, i am thinking of building one to use on a quad copter i am building to operate the camera as the only other way of doing it is to use 2 more potentiometers on the transmitter and it is hard enough using the two sticks to operate it without letting go of one of them to try and operate the camera, i am lucky as i bought a few of the sensors when i first tried playing with a arduino and some of them were only $0.99 from china at the time i just bought a couple of everything so i would not have to wait if i wanted to build something as i hate waiting for things to arrive once i have decided to try building an item.

AlanMarrec4 months ago

I try to make the same things but with GY-521, I'm a beginner in Arduino World, so someone has any advices for me ?

Regards.

imzsan4 months ago

I want use GY-85 9DOF IMU sensor as it is quite cheaper than LSM9DS0

, but I do not know if the code can run on it .

Grateful if you can reply me

millmore (author)  imzsan4 months ago

I imagine the code would be different. You should google for an arduino library for it.

imzsan millmore4 months ago
Thx
1-40 of 101Next »