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 88Next »
SiddheshA7 days 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!

millmore (author)  SiddheshA7 days 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 :)

fox4913 days 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)  fox4912 days 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 millmore12 days 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)
DanielH127 days ago

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

millmore (author)  DanielH126 days 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.

Thank you very much

djimenez91 month 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)  djimenez926 days ago
Good. It's the Mouse.move line in mouseMoveGyro that moves the mouse.

:D

soapdude1 month 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)  soapdude1 month 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.
srcompany7772 months ago

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

photoace123 months ago
By the way, how much did this all cost?
millmore (author)  photoace123 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 Ann3 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.

AlanMarrec3 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.

imzsan3 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)  imzsan3 months ago

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

imzsan millmore3 months ago
Thx
imzsan3 months ago

thank you for sharing that amazing mouse!

I live in China, Where can I get the

A-Star 32U4 Micro except Cool Components? Also, I can not find this on sparkfun

millmore (author)  imzsan3 months ago

Fortunatly the manufacturer has a list of distributors worldwide;

http://www.pololu.com/distributors

imzsan millmore3 months ago

A-Star 32U4 Micro is based on Atmel’s ATmega32U4 AVR microcontroller, then I find this board which is also based on it, and it is half price of

A-Star 32U4 Micro. Can it be the substitute for A-Star 32U4 Micro? How can I build the circuit by using it? There is no pin 11, 3.3V and 5v on the following pic .

2014-05-27T09-20-33.025Z.png
imzsan imzsan3 months ago

Finally I find this one, hope it will work

火狐截图_2014-05-27T16-57-07.689Z.png
imzsan millmore3 months ago

thanks a lot

imzsan imzsan3 months ago

I find it ! lol

area363 months ago

Warning I built one of these and they are amazing, but they do not work on ps3/wii/xbox GAMES. They do work on stertup screen but not on the actual games. For that you may need an Eagle Eye or to boot your computer in Ubuntu. Cheers!

millmore (author)  area363 months ago

There are limited PS3 games that support mouse, but there is an arduino library for it here;

https://code.google.com/p/unojoy/

You could use that to re-code it to be PS3 games controller.

area363 months ago

Warning I built one of these and they are amazing, but they do not work on ps3/wii/xbox GAMES. They do work on stertup screen but not on the actual games. For that you may need an Eagle Eye or to boot your computer in Ubuntu. Cheers!

richardlee3 months ago

cool, does it work with minecraft pe?

area363 months ago

When I try to upload I my text line..

LSM9DS0 dof(MODE_I2C, LSM9DS0_G, LSM9DS0_XM);

has en error surrounding it "'LSM9Ds0' does not name the type"

Any ideas of how I could fix this? I've tried placing the .cpp and .h files in the libraries folder in my arduino folder but still no luck. Any help? Thank you

millmore (author)  area363 months ago

Thanks for pointing that out. I have added the following to the instructions now which I think will solve the problem for you;

To use the code, create a folder called SFE_LSM9DS0 underneath {install directory}/Adruino/libraries, and put SFE_LSM9DS0.cpp and SFE_LSM9DS0.h in that folder. Then you can open headMouse2.ino and load it to your Arduino.
area36 millmore3 months ago

I still seam to be getting to same error message.

"LSM9DS0 dof(MODE_I2C, LSM9DS0_G, LSM9DS0_XM);"

'LSM9DS0' does not name a type

In function 'void setup()'

arror: 'dof' was not declared in this scope

in function 'void mouseMoveGyro()'

etc...

I tried copping your folder name and placing it in the Libraries under my arduino folder in the documents folder with the .cpp and .h files inside, but still not luck. Sorry about this mate! Appreciate the help.

1-40 of 88Next »