Pages: 1 [2]   Go Down
Author Topic: Arduino as USB mouse  (Read 2311 times)
0 Members and 1 Guest are viewing this topic.
Gergia
Offline Offline
Jr. Member
**
Karma: 0
Posts: 78
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I searched for info and got such an amazing video

but I can't understand , since don't know Japanese , has anyone got any idea
how this thing works and what I need ?     I want to do exactly same device ,
please help me .
Logged

Here was my old signature !!!

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 509
Posts: 31452
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I want to do exactly same device ,
please help me .
No you don't, I told you what to do and you totally rejected the suggestion.

It looks like he is using Linux so he could have any input driving the mouse, it is certainly not a USB device he has.
Logged

Pittsburgh, PA, USA
Offline Offline
Faraday Member
**
Karma: 58
Posts: 4019
I learn a bit every time I visit the forum.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Giorgi, are you having trouble navigating the V-USB site?

To make your own mouse I think will cost more than just buy a cheap mouse. The projects there are to make things you don't ordinarily find in stores, or find cheap, like the tilt-mouse.

You know that least-parts-cost means most-your-time-cost? What is your time worth? Will the lessons you learn make it worth it? You can learn a lot just making a $16 Teensy do HID.

Logged

Examples can be found in your IDE.

Offline Offline
Sr. Member
****
Karma: 1
Posts: 314
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Giorgi,
I tend to agree with you.  The video does appear to be an Atmel chip with usb interface.  I say that by looking at the resonator around pins 9 and 10 and the diodes that could be 3.3v zeners.
Also the file that is opened references the website "obdev.at/goto.php.  And of course the most telling is the video is titled "V-USB HID Mouse".

So yes, I think you want something exactly like this video.  And I do too.

Something that I read and I am thinking about trying is:
http://jethomson.wordpress.com/2011/08/18/project-ouroboros-reflashing-a-betemcu-usbasp-programmer/

It has limited utility in that you only have 4 data pins to work with but the USB interface is already on the board.  (and it's cheap)

I too am having trouble getting an Arduino to act as an HID device.  I'm trying a keyboard first but I would try a mouse if I thought I could get it to work.
Logged

Gergia
Offline Offline
Jr. Member
**
Karma: 0
Posts: 78
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

All right , I am sorry Grumpy_Mike that I rejected your suggestion but I don't want to buy arduino Leonardo .
the examples which are on V-USB have other basis or purposes , and they are very complicated .

I have got an brilliant idea , what happens if I buy simple USB mouse and interface it with arduino . e.g USB mouse would be as a
USB interface and use some pins to control cursor ?
is It possible. ?


Logged

Here was my old signature !!!

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 509
Posts: 31452
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
the examples which are on V-USB have other basis or purposes , and they are very complicated .
That is often the way, cheap involves you having to do a lot more thinking than easy.

Quote
what happens if I buy simple USB mouse and interface it with arduino
You might get away with that for an old school ball mouse but not with an optical one as there are no signals you can get at.
Logged

Offline Offline
Sr. Member
****
Karma: 1
Posts: 314
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The frustrating thing is, this should be easier than it is.

There are lots of example of people using an ATMega chip to talk to USB as HID.  I have found circuits which I have built.  I have found code and sketches which I have compiled.  And for me, nothing has worked.

There seems to be a secret bit of magic missing.

There also seems to be a shortage of people that understand this stuff.  Rather than having input like "the resistor value for your pull-up should be 1K larger" or "your zener should be closer to your connector".  I see comments like you should be using a "different processor" or "different Arduino" or just buy something off the shelf.  This is particularly frustrating when you then watch a YouTube video doing just what you want to do with a chip and a few discreet components on a breadboard.  It would be nice if those videos include a links to schematics and source code.
Logged

Pittsburgh, PA, USA
Offline Offline
Faraday Member
**
Karma: 58
Posts: 4019
I learn a bit every time I visit the forum.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Making V-USB work starts with programming stand-alone chips. The hardest part of doing that for me was getting my Arduino-as-ISP to breadboard wiring right. That took me a few attempts alone.

If you're not prepared to bang your head against a seeming wall a few times then get a Teensy of other cheap USB-based-chip compatible with HID library available and count yourself lucky they're available. There's still plenty to do even if all you want is to touch a wire to a pin to move the mouse pointer.

Logged

Examples can be found in your IDE.

Offline Offline
Sr. Member
****
Karma: 1
Posts: 314
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Making V-USB work starts with programming stand-alone chips.

That is a great piece of information.  Maybe that explains why I am having so much trouble trying to use the Arduino IDE.

The hardest part of doing that for me was getting my Arduino-as-ISP to breadboard wiring right. That took me a few attempts alone.

This is where I cheated and spent the big bucks ($3.50) on a programmer.

If you're not prepared to bang your head against a seeming wall a few times then get a Teensy of other cheap USB-based-chip compatible with HID library available and count yourself lucky they're available. There's still plenty to do even if all you want is to touch a wire to a pin to move the mouse pointer.

I don't mind banging against the wall, just not with my head.  When you make progress, you feel accomplishment.  Without any progress, it's just frustrating.  Like they say, "The best part about banging your head against the wall, it feels so good when you stop."  You don't learn anything from quitting but you don't learn from constant failure either.

I think it is something like wanting to learn to drive a car with a manual transmission.  If all you can do is stall out, your not learning anything.  If the people you ask for help, give you advice like "drive and automatic", this is not addressing what you are trying to do.  Useful hits like make sure you are starting if 1st gear.  Add a little gas as you slowly release the clutch.  This does not tell you everything you need to know to drive a manual, it will get you past the stalling out problem.
Logged

Pittsburgh, PA, USA
Offline Offline
Faraday Member
**
Karma: 58
Posts: 4019
I learn a bit every time I visit the forum.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I got a USBASP but still it doesn't have a chip socket, still needs some wires. I dunno, is there an entry to use it as an ISP in the Arduino IDE now? I've stayed with 0022 because I can program chips using Arduino-as-ISP with it and my rev. 0 UNO clone.. but maybe I should get 1.0 and go to optiboot.

I does get to be a problem finding directions to either what used to work or what works now, moving targets amongst many when it comes to search results.

This is where I got files and instructions to program ATtiny45 and 85 chips:
http://hlt.media.mit.edu/?p=1229
That link is for Arduino IDE 0022 and they have another for 1.0.
Note that there are projects at V-USB that use them, and how little flash and ram they have.

I've gotten success with 0022 and the 8 MHz minimal circuit ArduinoISP to 328P on a breadboard. Here is a link to the Arduino IDE 1.0 version:
http://arduino.cc/en/Tutorial/ArduinoToBreadboard

The ATMega 328P chips I bought are 328P-PU's. I had to hack boards.txt and change the chip ID to get it to work. My wall/hill-to-climb is going to be learning enough about AVRDUDE to dispense with going through the IDE. Hopefully I won't run down too many trails to things I don't need on the way. OTOH, maybe I won't have to at all since I haven't so far.
Logged

Examples can be found in your IDE.

Offline Offline
Newbie
*
Karma: 0
Posts: 22
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey Randal, I feel your pain man! I am still working on debugging my HID Keyboard.  Going on 7 weeks now!  I just don't have the right tools... namely an oscilloscope...

I'm about to post an update to my thread, and I will try and include a complete run down of my setup. 

giorgi, a good starting point might be this article.  http://www.practicalarduino.com/projects/virtual-usb-keyboard While it's not an HID Mouse, the concepts should be very similar.  I'd say if you can understand the concepts I would have to hesitate a guess that they would fall closely in line with those of a mouse.  Note, I couldn't get this to work until I ordered the exact same diodes 3.3v 0.5w zenner diode 1N2227B, but now I have a problem with intermittent crashing of the USB bus. 

As Mike mentioned, there are much easier ways to accomplish this but if your patient and have a desire to not only learn it, but fully understand it, you might just be able to accomplish your goal.  Much of what I have read has said that the ATMEGA Micro controller (which Arduino uses) isn't really the best chip as it doesn't have embedded USB support so it's hard to make it function as a USB device.  The easiest method is just to get something (or add) a chip with USB support to your project...

Of course I am still trying to bang that square peg into the round hole...

Hope this helps,
Dave
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 22
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

giorgi, this post http://arduino.cc/forum/index.php/topic,106970.msg809089.html#msg809089 has a photo of my setup as well as the libraries and and a simplified sketch that I am working on which might help you.
Logged

Pages: 1 [2]   Go Up
Jump to: