Ir sensor + bs2


i was wondering if i could get some help. i followed the circuit of the IR detector on this site : http://www.societyofrobots.com/schematics_infraredemitdet.shtml but i aint sure on how to program it with a bs2. does anyone know how to?

The device appears to be an

The device appears to be an analogue device so you need a way to convert it. The bs2 doesn’t have an adc converter built in so you need to connect one, so something like an adc831. You should do a search on the parallax forums for information on this as they have tons in their bs2 specific forum. There is documentation on using the adc83X (x= 1,2,4,8)with the bs2. You should just be able to google it.

adc chip.
i heard of it but is there a way to get it working without and adc chip? getting electronics in my area is quite hard

Not from my knowledge there

Not from my knowledge there isn’t. An ADC is used quite extensivly so it would be best to see if you could get your hands on one or a uProc that has it built on, like a picaxe.Other than that, I’m not sure what to tell you.

 

pna4602m

nevermind about that. i’ve been working on the pna4602m 38khz ir detector and interfaced it with my bs2. together with it, i also added an ir led so the it will be able to detect something infront of it. the problem is that i can only detect about 4-6 cm in range. any ideas?may be its my program. take a look :

’ {$STAMP BS2}

’ {$PBASIC 2.5}

'pin 10 = ir led

'pin 9 = vout of ir detector

'pin 8 = normal led

main:

time VAR BIT

FREQOUT 10,10,38000

RCTIME 9, 1, time

DEBUG ? time

IF time = 1 THEN ledon

IF time = 0 THEN main

ledon:

LOW 8

PAUSE 100

HIGH 8

GOTO main

I’m not sure why you’re

I’m not sure why you’re using rctime as that is for another purpose.

I would go to the parallax site and download the boebot manual as it goes through how to do what you’re trying to do in detail.

It actually shows some pretty clever tricks as well.

I’m not versed enough in the bs2 to really be able to help much and would be doing a diservice by not pointing that out.

rctime
i stumble upon rctime while messing around with the commands. i noticed that when i use a remote and press a button (ir) it lights up. rctime read the time for the pna4602m to discharge. so if there is infra red, then there would be some time for it to discharge. anyway, thats what i think it is. i used the program to run my qrd1114 that i just got working 30 min ago. :smiley:

pjnai, i don’t exactly

pjnai, i don’t exactly remember how that place is called, but it’s something that has to do with the airport, airport road maybe…not sure. Anyway, near that place there is a Farnell selling point, they’ve got lots of electronics. Just visit their site before going there so you know what to get : http://farnell.com/

EDIT: Address: 15 Tai Seng Drive, Level 3, Singapore 535220

The PNA4602M neither charges
The PNA4602M neither charges or discharges. It has a high output when not detecting a 38 kHz IR light, and the output drops to 0 volts when IR is detected. A simple INx command after make the x pin an INPUT would read whether the PNA4602M detected anything.

to robologist hmmmm, not

to robologist

hmmmm, not sure what yur talking about, maybe you could show me a sample program???

’ INPUT-IR.bs2 ’ This

’ INPUT-IR.bs2
’ This program demonstrates how the IN works to
’ read a BS2 pin which has a PNA4602M IR sensor output attached.
’ For this demo the output of the sensors is attached to pin 7 of the BS2,
’ any BS2 pin can be used.

’ {$STAMP BS2}
’ {$PBASIC 2.5}

tests VAR Word

Setup:
tests = 0
INPUT 7 ’ Make P7 an input

Main:
DO
IF IN7 = 0 THEN DEBUG "The sensor sees a signal! ",
BIN1 IN7, CR
ELSE DEBUG "No signal seen: ",
BIN1 IN7, CR
tests = tests + 1
LOOP UNTIL (tests = 100)

END

Again, I recommend getting
Again, I recommend getting the boebot manual as it shows you this and explains why you’re doing what you’re doing. All of this code is in there…