38khz IR receiver help
Whelzorn
Posts: 256
I have some 38khz Infrared receiver modules I got from jameco. They work great with the bs2, but I'm trying to figure out why. They have 3 pins, as you probably know, +5V, gnd, and Vout.
The confusing part is that when power is supplied to it (and no signal is being detected), the Vout pin is just "off" (it *might* give off about .1v) but when it detects the 38khz IR signal, the Vout pin acts like ground (I don't know the correct term to describe that). But for example, if you put an LED between +5v and Vout, it will turn on when something is detected. I managed to use an example program to make it work with the bs2:
but I have no idea how to get this to work with other microcontrollers (specifically PIC) because I don't know how to get them to detect a difference between no input and ground.
Any help would be appreciated.
Thanks, Justin W
The confusing part is that when power is supplied to it (and no signal is being detected), the Vout pin is just "off" (it *might* give off about .1v) but when it detects the 38khz IR signal, the Vout pin acts like ground (I don't know the correct term to describe that). But for example, if you put an LED between +5v and Vout, it will turn on when something is detected. I managed to use an example program to make it work with the bs2:
' {$STAMP BS2} ' {$PBASIC 2.5} ' Program Listing 1.1 - Testing the IR Beam.bs2 IR_detect VAR Bit LOW 7 place: PAUSE 50 FREQOUT 7, 1, 38500 IR_detect = IN8 IF IR_detect = 0 THEN unbroken ' Make sure to add six spaces to the debug statement ' below. That way both debug statements will have the ' same number of spaces for a better display. DEBUG HOME, "Beam is broken; object detected. " GOTO place unbroken: DEBUG HOME, "Beam is unbroken; object not detected." GOTO place
but I have no idea how to get this to work with other microcontrollers (specifically PIC) because I don't know how to get them to detect a difference between no input and ground.
Any help would be appreciated.
Thanks, Justin W
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
I tried putting a pull-up between Vdd and Vout, and then put an LED between Gnd and Vout and another between Vdd and Vout, and all this does is maked both LED's illuminate to full intensity (they are both getting +5v)
edit: well, this happens with or without the pull-up resistor, and even so, I think it has an internal pull-up because the LED between Gnd and Vout is very dim without the pull-up, but it's still getting some power. All a pull up does is makes that one brighter.
Post Edited (Whelzorn) : 11/25/2005 10:23:33 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sid Weaver
Do you have a Stamp Tester yet?
http://hometown.aol.com/newzed/index.html
·
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module" Now available from Parallax for only $28.95
http://www.parallax.com/detail.asp?product_id=30012
"SX-Video OSD module" Now available from Parallax for only·$49.95
http://www.parallax.com/detail.asp?product_id=30015
Product web site: www.sxvm.com
Those that would give up freedom for security will have neither.
·
In your proposed schematic, the forward base-to-emitter junction will clamp the "to stamp" voltage to 0.6 volts; surely not enough to be detected by it. You will need to isolate the transistor with a series resistor in order to permit simultaneous detection by a stamp.
Cheers from Hawaii,
Peter (pjv)
I mean, I didn't know what Whelzorn's plan really is.· I should've made it an either/or proposition: keep the transistor and everything past it to experiment with the IRED Det. visually or omit all that and run the pulled-up output to the STAMP.
Well, actually it is easy to detect small voltage excursions with an SX, even without using the comparator or an (external) A/D.
But first, will you do some homework and post the specs of the IR product you are using.......it will help us guide you better than "some 38 KHz IR product from Jameco".
We're happy to help, but for you to learn you need to be part of the discovery process; its no good for me to give you the schematic and code, that way you won't learn much.
I expect the final solution will be for you to write some simple "pulse density modulated" D/A code to generate a voltage to bias one CMOS SX input near its threshold, and then adding (or subtracting) the IR analog signal to push it over (or under) the threshold.
We can get you there, but you need to be in a frame of mind to be guided, so please start with "discovering" the specs of the detector, then we'll take the next step. In the meantime also search for PWM D/A converters among the SX or SXlist sites, you'll need to understand that to write the code.
Cheers form Maui, Hawaii,
Peter (pjv)
BTW pjv, I am not using an SX, it's a PIC. The reason I did not have the specs before is because jameco does not carry anything under that product # anymore.
So, as I see it, if you want a HI when you are detecting, then add an inverter to the output.
What are you using as a IR-sender?· An IRED going at 38 kHz?
[noparse][[/noparse] Maybe what you want really is a IR photo-transistor? ]
PIC pin> ----(led)---- V+
wired like this, the LED lights up. I tried the same with a BS2, and it does not light the LED up.
Why would this happen? I do not think it is the detector module that I am having a problem with anymore, because it works on the BS2 without any sort of anything. I can wire Vout from the module right into pin 0-15 of the bs2 and it detects it and everything. This makes absolutely no sense.
BTW, I continue to ask the basic stamp community because I notice that the stamps all use PIC's and don't have this problem
edit: my IR sender ATM is a TV remote.
Post Edited (Whelzorn) : 11/27/2005 5:36:13 PM GMT
If PIC processors are your target, then I'm not your guy.......I really dont like them.
Cheers form Maui, Hawaii,
Peter (pjv)
W,
What are you doing?
Can you U/L a drawing?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When you get 1st Place in the "Darwin Awards", you're a Winner & a Loser.
Thank you all for the help!