Pages: [1]   Go Down
Author Topic: Programming pulsed Ir sensor  (Read 1236 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok guys, so im making a robot to play soccer, the ball uses pulsed infrared lights so that robots can find it. unfortunatly im the first person in the league to use arduino to play the game.

ive gone out and bought 3 http://www.jaycar.com.au/productView.asp?ID=ZD1950&CATID=33&form=CAT&SUBCATID=245 which are 2 prong phototransistors.

after about an hour of going through google and trying different searches i havent come up with much that tells me how to program them or wire them up.

i was hoping that somebody on the forums would have the knowledge to explaine the programming and wiring up to me or be able to link me to a guide to do it.

Thanks for any help
Logged

0
Offline Offline
Shannon Member
****
Karma: 214
Posts: 12406
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Firstly you are going to have to do some experiments to find out the sensitivity relevant to your application.

The simplest way to connect the sensor is this:  collector to +5V, emitter to analog pin and to a resistor.  Other side of resistor to ground.

Start with a 1K resistor and experiment to see what analogRead() returns for various conditions - the output should be approximately proportional to light intensity.  You want to increase or decrease the resistance until the range of useful values spans a wide range - 0 upto 750 or so of the analog range.

Don't use a resistor less than 220 ohms or so - that risks overloading the transistor.  In fact one possibility is to wire a 220ohm resistor in series with a 50k logarithmic pot.  You can then tune the resistance between 220 and 50k ohms without rewiring.
Logged

[ I won't respond to messages, use the forum please ]

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

im tyring that now, is there a way to get it to read pulsed ir?
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 308
Posts: 26471
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
the ball uses pulsed infrared lights
Presumably, there is a specification for this.
Care to share?
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

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

ok so the ball has multiple transmitters tha pulse at a 300 hz frequency. my teacher beleivs that i have to tell the arduino ir sensor to read at an equivelent frequency for it to have any range on the sensor.
Logged

Georgina Ontario
Offline Offline
Sr. Member
****
Karma: 5
Posts: 437
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Try this...

Since it is supposed to be NPN.... The collector would get tied to +Vcc. (Right? Maybe you would think?)

So... Tie the collector to an 6K to 8K resistor (or close) Then the resistor gets tied to +5V...
The other lead (anode? emitter?) goes to Ground.

The junction of the resistor and collector -- tie it to an analog input....

Then see if you can measure a change or a pulsed change as you "illuminate" it with the ball "transmitters". When the diode is "illuminated" you should see the diode/transistor draw current -- or bring the voltage at the collector-resistor junction closer to ground.

See this for a similar diode used in a similar way....
http://www.marktechopto.com/Engineering-Services/photo-sensor-application-note.cfm

Best I can do. It's too late to think this hard.  smiley-roll-sweat

Logged

Just another Hacker

Pages: [1]   Go Up
Jump to: