Needed to post images. See below.
Hey guys, new to the arduino and this forum. Picked it up a few days ago for working on some C programming and embedded systems.
I went to the electronic store, purchased an IR led and detector. I'm trying to replicate something like this: Arduino, IR sensor & LEDs - YouTube
Now, the led seems to work fine, I tried it out with pin 13 on the arduino and I can see it cleary flashing red and brighter in a camera.
I have no idea how to set up the detector to work though. For one, I've been looking up some tutorials and everyone seems to use something like this:
with three pins. I read up on phototransistors and this seems to be called a phototransistor with a 'base'
What I have is something like this:
Which is one without a 'base'.
I am totally dumbfounded on what I should be doing. I did some basic setup and was not able to get anything in the serial window that was meaningful. A bunch of 200-300 values that kept showing up even if the detector was disconnected from the circuit.
I'm really kinda tired here and wanna figure out how this works.
. Thanks for any help here.
Well, first realize that the video you reference is actually using an infrared distance measuring module, something like the Sharp GP2D12. This outputs an analog voltage you can measure with analogRead().
The components you got are a bit more "raw". Either you got a phototransistor or an IR logic detector (like a TSOP1838). If you got a phototransistor, it will conduct current when IR light shines on it and give you a digital "low" level in the circuit you show. With no IR light, the digital level will be "high".
Now, if you got an IR logic detector you will need to pulse your IR light at 38 kHz. The IR logic detector will only respond to IR energy pulsed at this frequency in order to be more immune to ambient IR sources (like sunlight).
Hopefully that's enough info to get you asking more questions ![]()
--
Check out our new shield: http://www.ruggedcircuits.com/html/gadget_shield.html
