Pages: [1]   Go Down
Author Topic: Slot Sensor with Arduino  (Read 961 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 1
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi I am trying to use an optical slot sensor with the Arduino to sense a coin drop and I can't find any schematics for the part. It is this part from digikey http://www.digikey.com/scripts/DkSearch/dksus.dll?KeywordSearch, from the opb800series. Has anyone used this part before? Does anyone have any idea how to set it up. Thanks!

Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 203
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You have an LED and a phototransistor. When the LED is powered and nothing is blocking the light the phototransistor will conduct in one direction. If the LED is not powered or something is blocking the light then it will not conduct.

Take a look at the wikipedia article on Opto-isolators, that is basically what you have except something can block it.

I little Ohm's Law work will tell you to use a 220 ohm resistor for R1 to keep the LED current to about 20mA, safely inside the pin capacity of the Arduino and the capacity of the LED. R2 is a little trickier. I think I'd size that for a 1mA current flow, no need to get crazy with the power use, maybe a 4.7k ohm resistor. You might need to play with that a bit to balance out the sensitivity with varying ambient light levels.

So to continue, if you connect an input pin between R2 and the phototransistor then it will be low until a coin slides by when it will blip high.

You must poll very fast to catch it or use an interrupt pin.
Logged

Austin, TX
Offline Offline
Jr. Member
**
Karma: 0
Posts: 93
Shh! I am hunting wabbit. Killlll the wabbit!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Another possibility (instead of an interrupt or fast polling) is to use something like a 555 in one shot mode to trigger a fixed duration pulse.  This pulse could be 100-200 milliseconds long.  Depending on your preference you could trade software complexity for hardware complexity.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 2
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I would suggest a simple mechanical device such as a really weak leaver that would just break connection while the coin goes through.
Logged

0
Offline Offline
Faraday Member
**
Karma: 7
Posts: 2526
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I hada couple of mice (old ball mice, not new optical style) apart yesterday, and they both use slotted a encoder wheel, LED, and phototransistor for each axis.  Maybe you could get some ideas (or even some parts) from an old mouse.

As far as the interface goes, I'd use an interrupt; the arduino handles interrupts easily, and you won't have to worry about missing events if you poll.

-j
Logged

Pages: [1]   Go Up
Jump to: