Pages: [1]   Go Down
Author Topic: control pc mouse using arudino + photoresistors?  (Read 420 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 16
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hey i'm new to the microprocessor programming and everything and i just got the arduino and i'm pretty hyped. i was wondering if it was possible to control the mouse of a pc mouse using an arduino and photoresistors without buying any extra products since i don't have money. for example, if i move my hands around the photoresistors, the mouse should move depending the the analog read of the photoresistor.? what kind of library do i need to do this or what function do i use?

please help
Logged

London, GB
Offline Offline
Sr. Member
****
Karma: 7
Posts: 332
Nothing works.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

How many photoresistors, how are they placed, and what will they detect?
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 549
Posts: 46113
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

A mouse is a physical device. Moving it with a photoresistor is not going to be possible. Unless the Arduino is controlling a robot arm, which is holding the photoresistor, and using it as a push stick.

If you mean that you want to control the PC's cursor like a mouse, then that is possible. All you need to do is program the Arduino to act like a USB master instead of a USB slave. You do have a Uno, right? If not, that isn't possible.

Making the Uno act as a USB master is most definitely not a beginner project.
Logged

North Yorkshire, UK
Offline Offline
Faraday Member
**
Karma: 104
Posts: 5531
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

PaulS, anyone would think you are trying to be difficult smiley-wink

Yes, this is possible, you can have your arduino take data from the photoresistors (connected in a voltage divider to the analog inputs - you only need an extra resistor for each photoresistor) then you can send serial data to your computer (I will assume you are using Windows as you have not said) and use software such as Serial Keys or AAC Keys to emulate mouse movements.

Now you need to go do research based on that info smiley

This idea will however, not be very accurate and will not work if the ambient lighting changes.

Mowcius

PS, just for your info, it's arduino...
« Last Edit: December 14, 2010, 05:36:01 am by mowcius » Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 549
Posts: 46113
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
PaulS, anyone would think you are trying to be difficult
Didn't even have to try on this one. It was too easy.
Logged

London, GB
Offline Offline
Sr. Member
****
Karma: 7
Posts: 332
Nothing works.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I sometimes wonder whether there's a generation of tinkerers that are somehow under the impression that photoresistors detect hands, or movement, as opposed to light levels.
Logged

North Yorkshire, UK
Offline Offline
Faraday Member
**
Karma: 104
Posts: 5531
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I sometimes wonder whether there's a generation of tinkerers that are somehow under the impression that photoresistors detect hands, or movement, as opposed to light levels.
Well if you're in the dark and add some LEDs then they can, kinda  smiley-wink
Logged

0
Offline Offline
Newbie
*
Karma: 1
Posts: 38
Turn it off!!!!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I think it is also possible to do this with processing.  It was too late at night for me to understand the program that I saw, but it was supposed to control the mouse cursor.  You would just setup a serial link between the Arduino (Uno or 2009,) and processing.

It would be terribly efficient, and could even have noticeable lag, but it would work.
Logged

Pages: [1]   Go Up
Jump to: