View Full Version : IR problems
Snap
- 2nd August 2007, 06:13
I would like a clean crisp voltage drop to give my pic a definite 0 or 5 volt difference. the problem is that if I am using an IR transistor (which I need to use) I can dim the led (with a comparitor circuit) by slowly covering the ir reciever (collector). My question is this.. can I create a circuit that will not dim a led ( meaning not a definat on or off) when I need a digital high or low signal... and I have already tried the 741 op amp comparitor. It dims the led as much as the straight transistor does. Could it be the resistors involved?
all I want is a way of telling the pic that I have a high (5 v)or low (<1.5v)signal. I think it is called hysteria,, Would a shmit trigger work?
Thank You For The Great Work
Snap
keithdoxey
- 2nd August 2007, 10:19
I would like a clean crisp voltage drop to give my pic a definite 0 or 5 volt difference. the problem is that if I am using an IR transistor (which I need to use) I can dim the led (with a comparitor circuit) by slowly covering the ir reciever (collector). My question is this.. can I create a circuit that will not dim a led ( meaning not a definat on or off) when I need a digital high or low signal... and I have already tried the 741 op amp comparitor. It dims the led as much as the straight transistor does. Could it be the resistors involved?
all I want is a way of telling the pic that I have a high (5 v)or low (<1.5v)signal. I think it is called hysteria,, Would a shmit trigger work?
Thank You For The Great Work
Snap
It would be helpful if you could describe the application more clearly.
What are you trying to make ?
If it is an IR receiver then using a dedicated IR Receiver module is by ar the most reliable.
If it is some form of beam break device then again I would use a dedicated IR receiver module but you would need to modulate the IR source with a 38kHz carrier.
Bruce
- 2nd August 2007, 13:18
Most PICs have a few Schmitt Trigger inputs. Some have comparators. So
you can probably make it work without any additional hardware. Just use a
pin with a Schmitt Trigger input buffer, or the built-in comparator.
In the PIC data sheet, the port block diagrams show which pins have Schmitt
Trigger input buffers.
The Electrcal Specifications section of the data sheet shows what the min
and max input levels are for high/low signals on different input types.
As Keith mentioned, the simplest way would be to just use an IR module with
a built-in band-pass filter of 38 or 40kHz, and modulate your IR LED at the
band-pass frequency of the module.
These respond pretty fast with a low-going signal when the IR LED is on, and
high-going signal when it's off. They work pretty much the same on TTL or
Schmitt Trigger inputs.
They are also less sensitive to ambient light than most IR photo transistors,
and have built-in filters to block light outside the IR wavelength.
So you save a ton of board space, use fewer parts, and save yourself a little
hysteria..;}
Snap
- 2nd August 2007, 13:34
I am making a simple beam breaker. I have an infra red emitter and detector (photo transistor) but need to get the signal into the pic (16f84a). I was just wondering how to start with the cleanest signal I could (0 or 5 volts not 1.2 or 2.3 volts) I perfer not going with the pre-made units because I am trying to understand how it works. All of the circuits I find involve op amps and technically the out put should but just that (0 or 5volts) or pretty darn close. I set it up and if I break the beam very slowly you can see the led dimly start to light before it comes fully on. I played around with lots of resistor combinations but it does not seem to make a difference. I want a relay type of instantanious change.
Thanks again for your help and sorry for the Hysteria I am a big Def Lepard fan and I can't find the spell checker on this thing.
Bruce
- 2nd August 2007, 17:28
Here's one example using a comparator. http://home.cogeco.ca/~rpaisley4/ATDetIR.html
mackrackit
- 2nd August 2007, 19:06
Here is one I am using for a "Laser Fence". It will also work for IR.
http://www.picbasic.co.uk/forum/attachment.php?attachmentid=1901&d=1186075823
And the simple code to go with it.
DEFINE OSC 4
Asm
ERRORLEVEL -306
Endasm
include "modedefs.bas"
ANSEL=%00000000
CMCON=7
PAUSE 2000
TRAIN VAR BYTE
TRAIN=$55
CNT VAR BYTE
LP VAR BYTE
START:
COUNT PORTC.1,100,LP
IF LP <> 1 THEN CHECK
HIGH PORTC.5
PAUSE 50
LOW PORTC.5
PAUSE 50
GOTO START
CHECK:
COUNT PORTC.1,100,LP
IF LP <> 1 THEN BREACH
GOTO START
BREACH:
FOR CNT = 1 TO 5
SEROUT PORTC.4,T2400,[TRAIN,TRAIN,TRAIN,TRAIN,TRAIN,9,3]
HIGH PORTC.5
PAUSE 100
NEXT
GOTO START
END
R2 will adjust the sensitivity of the Photo Diode. Ambient light does need to be shielded. Have used the same with IR but R2 was a fixed 10meg. (Total darkness for a parts counter on a conveyor)
Using 3 volts because of the radio transmitter.
mackrackit
- 2nd August 2007, 19:24
Looks like I need a lesson on image tags!
<img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=1904&stc=1&d=1186087384">
Got it!!
Snap
- 2nd August 2007, 20:27
I am happy there are more people out there building things for their .....ahem..childrens amusment. Mine is a slot car track for my son. Bruce small internet I used the exact same schematic you sent me for the lay out and it is the one that is giving me the problems but Im sure I am being too sticky about the details and tonight I will try it out with the pic with the fence circuit and see how it works (in sure it will be great).
Thanks again for the help I will post if it works or not.
Snap
Pic_User
- 2nd August 2007, 21:03
Looks like I need a lesson on image tags!
Found this:
<img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=367">By: Darrel
Here:
http://www.picbasic.co.uk/forum/showpost.php?p=10898&postcount=2
mackrackit
- 2nd August 2007, 21:56
Found this:
<img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=367">By: Darrel
Here:
http://www.picbasic.co.uk/forum/showpost.php?p=10898&postcount=2
Thank you Pic_User! Learn something every day.
Snap
- 6th August 2007, 06:20
Ok, I got my ir detect to work on a pic 16f84a the secret is to ignore all of the internet info out there that suggest op amps comparators. The pic is smart enough to read a slightly variable input (you might have to pull up of down the port). and job is done. After all was working It still bugged me that I could not get the 741 op-amp working so I spent the night playing with diffent combinations of resistors and leds untill I thought I figured this little sucker out of course I will be wrong ...but I can tell you that the fence circut works.
Thank again for the speedy help
Snap
Powered by vBulletin® Version 4.1.7 Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.