Emitter and Detector?how to?
bobsmith
Posts: 36
I want to make a beam break eye and I have a emitter and detector
basically all I want to say is:
emitter······ pin······ 5
detector···· pin······ 6
high 5
if in6 = 0 then
goto mode2········· 'i have it like this so when the detector is broken it
························· ' lets the stamp knows it is okay to run mode2
basically all I want to say is:
emitter······ pin······ 5
detector···· pin······ 6
high 5
if in6 = 0 then
goto mode2········· 'i have it like this so when the detector is broken it
························· ' lets the stamp knows it is okay to run mode2
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
IR_detect var btye
low 6
loop:
pause 50
freqout 7,1,38500
ir_detect = in5
if ir_detect = 1 then broken
goto loop
broken:
A better description of what you are trying to do might bring forth more suggestions.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Many are cold...
· but few are frozen...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
I believe we are both using emitters from radio shack
http://www.radioshack.com/product.asp?catalog_name=CTLG&category_name=CTLG_011_002_017_000&product_id=276-142&hp=search
Catalog #: 276-142
Since we are both wet still maybe you could help us out?
For starters we need to wire it into the board. I dont see a resistance so how do you know what resistor to use? (an explination would go alot farther then an answer)
Second, basically what we need for code, and I am sure its very simple this.
Immagine a button that operates a hammer that hits a nail.
We do not want the button to work untill the nail is in place (break beam)
however if the button is pressed 5 times while there is no nail, it works anyway.
Once again, your help is greatly appricated! These tech forums are the #1 reason I went with Parallax over the competators.
=X
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sid Weaver
Try the Stamp Tester
http://hometown.aol.com/newzed/index.html
·
The emitter and detector will be about an inch apart, and the thing breaking them is roughly .7" Round.
THanks
Chris
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sid Weaver
Try the Stamp Tester
http://hometown.aol.com/newzed/index.html
·
-X
Good Luck,
John
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
I should be using a 185ohm resister? Brown - Grey - Green......???
Thanks
T-1¾. 20mA, 1.3VDC, 940nm. wavelength. For optoelectronic projects
ohms = (5-1.3)/.020 = 185
FWIW, I keep a little five-compartment container of resistors with these values:
220
470
1k
4.7k
10k
... and I rarely use anything that is NOT from this container.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
Chris
PAUSE 50
FREQOUT 15, 1, 38500
IR_detect = IN14
IF IR_detect = 0 THEN unbroken
how do you know what freq to use?
Thanks
Chris
http://www.parallax.com/detail.asp?product_id=350-00014
This detector holds its output on long enough for the BASIC Stamp to move from the FREQOUT instruction to the bit sampling on the input pin. The code you have above will work with this detector.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
-X
Check_Interrupter:
HIGH LedPin
active = INS.LOWBIT(IrPin)
LOW LedPin
RETURN
Now, be aware that using IR without modulation means it could be triggered by IR in the environment -- that's why we use modulation (to get rid of evironmental IR noise).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
I have the same thing from radioshack and it works well with the code in this text.· Chapter 6
http://www.parallax.com/dl/docs/books/edu/toddler.pdf
resistors are not your problem.
║ 1 ║
╠══╝
║ If you put an array of IR emitters on the other side of the beam facing a single detector you get much more accuracy but
║ takes power.
║ Code:
║
║ UNBROKE:
║ FREQOUT 3,38500
║ INS = ~IN5
║
║ IF INS = 0 THEN BROKEN
║ GOTO UNBROKE
╙────────────────────────────╜