Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: blackbeard on April 14, 2011, 08:35:28 AM

Title: $1 ball mouse ir sensor help
Post by: blackbeard on April 14, 2011, 08:35:28 AM
ok so here is my problem. i've never used 3 pin phototransistors and each of these $1 mice i bought has 3 of them, all not numbered. is there any way i can rig these for obsticle detection or at least line following?
Title: Re: $1 ball mouse ir sensor help
Post by: ballbreaker on April 14, 2011, 11:20:06 AM
there is a great tutorial here on how to make this here http://www.societyofrobots.com/schematics_infraredemitdet.shtml (http://www.societyofrobots.com/schematics_infraredemitdet.shtml)
follow the steps and them program it accordingly.
Title: Re: $1 ball mouse ir sensor help
Post by: blackbeard on April 14, 2011, 11:49:19 AM
i found that but i'm using some sort of 3 prong photo transistor which i can't find much info on
Title: Re: $1 ball mouse ir sensor help
Post by: MikeK on April 14, 2011, 12:38:38 PM
Is it the U-shaped package that contains both the emitter and detector?  If so, the pins are probably 5V, 0V, and signal.  Use current limiting resistors.  You can find out which is the emitter by viewing it through a digital camera...With 3 pins there are only 6 combinations to try.
Title: Re: $1 ball mouse ir sensor help
Post by: blackbeard on April 14, 2011, 12:53:36 PM
Is it the U-shaped package that contains both the emitter and detector?  If so, the pins are probably 5V, 0V, and signal.  Use current limiting resistors.  You can find out which is the emitter by viewing it through a digital camera...With 3 pins there are only 6 combinations to try.

it's not inherently a U shaped package but the components are set up in that configuration. ok so one (which i assume is an IR led) has 2 prongs, is clear and apears to me like i diode. the other which i assume is a phototransistor has three prongs, is black and shiny on one side, the side that interacts with the other component
Title: Re: $1 ball mouse ir sensor help
Post by: vinniewryan on April 14, 2011, 05:35:35 PM
As stated above, in many cases the phototransistors with 3 pins are (1) V+, (2) GND, (3) output. Search google images for 'phototransistor' or 'IR sensor' and chances are you'll find many that look like yours complete with wiring descriptions. Definetely use resistors to protect the sensor, they burn up easily if you feed them too much current, especially when connected incorrectly.

To answer your question, yes, if the IR sensors are calibrated correctly you should be able to detect reflected light to discriminate between white and black lines based on the output voltage. If you can't figure the sensor out, you can pick one up from the shack to play around with for a couple bucks, or order them online for literally 5 cents each. They're cheap and easy to work with, I use 2-pin phototransistors on a weekly basis. There's so much they can be used for!

Also be aware that not all phototransistors will output a varying voltage, some are meant only to receive IR pulses and will output a very brief burst of output when the internal electronics have detected a certain condition of light. This is also common in mouse encoders, but they can be used in a different way to also detect black and white lines using more complex circuitry or code. Update us when you figure out what you have.
Title: Re: $1 ball mouse ir sensor help
Post by: blackbeard on April 15, 2011, 09:38:18 AM
alright i've reverse engineered the circuit in the mice to find the polarity and the basic circuit. IC that is supposedly logitec but the data sheet is nowhere to be found and the chips look cheep. in any case i'm going to try them for obstacle detection but they should at least work for line following. the irleds seem to be very dim even at 5v with a 100ohm though so i may have to add more
Title: Re: $1 ball mouse ir sensor help
Post by: Soeren on April 15, 2011, 09:08:24 PM
Hi,

ok so here is my problem. i've never used 3 pin phototransistors and each of these $1 mice i bought has 3 of them, all not numbered. is there any way i can rig these for obsticle detection or at least line following?
Well, thats a definity... Maybe.

Some 3 pin devices are regular photo transistors (i.e. emitter, collector and base), while others, particular in ball mice, is in fact two transistors in one housing (with one pin common). This will usually be the case if you see only one device on each side of the interrupter, as two are needed to give quadrature sensing.

Remember they're targeted for low current close range applications.

Unless you have several mice of the exact same build (sometimes the same model can have different parts), it probably isn't worth it, as buying the IR-LED's and -transistors you need won't be that expensive and then you get some with a full spec sheet, which will be easier to work with.
That said, yes, you can probably get them to work to some degree.
Title: Re: $1 ball mouse ir sensor help
Post by: blackbeard on April 16, 2011, 05:31:51 AM
Hi,

ok so here is my problem. i've never used 3 pin phototransistors and each of these $1 mice i bought has 3 of them, all not numbered. is there any way i can rig these for obsticle detection or at least line following?
Well, thats a definity... Maybe.

Some 3 pin devices are regular photo transistors (i.e. emitter, collector and base), while others, particular in ball mice, is in fact two transistors in one housing (with one pin common). This will usually be the case if you see only one device on each side of the interrupter, as two are needed to give quadrature sensing.

Remember they're targeted for low current close range applications.

Unless you have several mice of the exact same build (sometimes the same model can have different parts), it probably isn't worth it, as buying the IR-LED's and -transistors you need won't be that expensive and then you get some with a full spec sheet, which will be easier to work with.
That said, yes, you can probably get them to work to some degree.


that's a good point. it would need to see what direction it's going after all. my original plan was to use them for a home brew joystick like thing.
Title: Re: $1 ball mouse ir sensor help
Post by: Soeren on April 16, 2011, 12:20:49 PM
Hi,

my original plan was to use them for a home brew joystick like thing.
Ahh, somehow I imagined a line sensor.
In that case it may be worth it even if you only have a single mouse, if you just want two axis like the mouse.
It will probably be a bit of a challenge to make the mechanical bits for a stick with interrupters for a two axis system though.
Title: Re: $1 ball mouse ir sensor help
Post by: blackbeard on April 16, 2011, 04:48:58 PM
Hi,

my original plan was to use them for a home brew joystick like thing.
Ahh, somehow I imagined a line sensor.
In that case it may be worth it even if you only have a single mouse, if you just want two axis like the mouse.
It will probably be a bit of a challenge to make the mechanical bits for a stick with interrupters for a two axis system though.


Oh ya well i got like 4 of them. It was only after examining the insides that i thought they might be useful for robotics as a sensor.
Title: Re: $1 ball mouse ir sensor help
Post by: Soeren on April 16, 2011, 06:10:26 PM
Hi,

They are!
I strip any ball mouse coming my way, or at least toss them in the old_ball_mouse_box for later dismantling ;D
Title: Re: $1 ball mouse ir sensor help
Post by: blackbeard on April 18, 2011, 05:27:59 AM
Hi,

They are!
I strip any ball mouse coming my way, or at least toss them in the old_ball_mouse_box for later dismantling ;D


ya and after stripping all the rubber off the mouse balls i made an awesome newtons cradle!
Title: Re: $1 ball mouse ir sensor help
Post by: The arctic wolf on April 18, 2011, 12:40:49 PM
Hi everyone,
2 points I wanted to raise:
1. If someone wants help with a circuit that he visualy saw but we didn't, it will be helpful to upload a picture of the circuit, or the part.
2.  * Diodes(including leds) can be determined by a simple ohm meter because they allow current only in one direction.
* Bi polar transistors(NPN,PNP) can be determined by the ohm meter because their internal structure is basically like 2 diodes connected in opposite directions, 2 legged phototransistors(base don't have an output) will resemble a photoresistor in the category of changing their resistans based on lighting(can be cheked with an ohm meter also).

Hope it helps,
Andrei.
P.S. By the way always be careful and don't tuch the bear legs of sensetive transistors with fingers
because of static electricity of the human body.
Title: Re: $1 ball mouse ir sensor help
Post by: Soeren on April 18, 2011, 05:51:22 PM
Hi,

[...] and don't tuch the bear legs [...]
Sensible advice  ;D