All i want to do is send some very basic serial commands from point A to point B.
From one micro controller, to another!
The transmitter was wired such as
GND—R1—IRtx—P0
The detector
R1
GND----IRrx---1k-------P1
|
R2-> 10k
|
5v
I was using HSERIAL, at 300 baud.
Maybe you guys can figure out what i’m doing wrong.
I used a camera and watched the IR transmitter and i am seeing light from it with the camera.
I only need to send some very simple information, 1’s and 0’s.
6 digits long to trip relays, each relay gets a digit, 000000 = all off, 111111 = all on, 1000001 = first and last on.
Real simple.
I guess the question is are you seeing anything at the receiver side? If it were me, I would hook up my logic analyzer on to the pin that you are receiving on and see if I capture anything. If not, I would maybe try an Oscilloscope to see if there was a signal but not enough differences in voltage… I would also see if I could find the document ion on the old IRPD sensor that Lynxmotion once sold to see the schematic…
But if I did not have any test hardware, what I would probably do first is to see if I receive anything. Now assuming this a BAP like Bap28, I would hook up the receiver to a pin that receives interrupts like P8. I would then write some code to see if I receive anything. Something like:
ONINTERRUPT IRQ1INT, handle_irq1
enable IRQ1INT
enable
PMR1.bit5 = 1 ; make sure IRQ1 bit is set as an interrupt bit.
IEGR1.bit1 = 1 ; rising edge
loop:
goto loop
handle_irq1:
toggle P4 ; toggle one of the LEDS on and off
resume
Warning: I typed this in on the fly so I may have missed something or mistyped…
If this works and you are seeing the LED flash, than would go to the next step to receive the actual data…
The underlying problem with this sensor system is there is no modulation. If you look at the little 3 pin IR receivers like the Sharp one for TV remote controls, you will see they are setup to receive a modulated signal. There is AGC (automatic gain control) built in as well. The LED (sender) is easy to modulate, using a freqout type command, but all the guts of the IR receiver would be very difficult to recreate with discrete components.
The pages look very similar but that’s all the information i have to work with.
I just wanted a very simple IR transmitter/receiver pair. If i knew it would be at all complicated, i would have skipped on this.
I used the oscope before on the receiving end, but i don’t think i was using it right, i was seeing signals, but i’m not sure if i was seeing what i was supposed to be seeing.
Yep, look at the TV-Brat projects under bipeds. It uses a TV remote control and an IRPD(lynxmotion.com/p-56-ir-proxi … ensor.aspx). Unfortunately IRPDs are no longer sold, but you can look at the schematic to see what it used.
The receiver IR LED is the problem here. The transmitter is just an IR LED that is driven with a modulated signal that matches the frequency of the IR receiver. For the Panasonic PNA4602M it’s 38khz. The receiver is inexpensive though…
$1.28 each.
The range of this can be very good as you can usually drive the IR LED at a pretty high current. Note this would probably require a transistor switch on an Atom to go beyond the I/O pins current limitations. Even without it you should be able to achieve a 10 foot line of sight connection.
The control is easy. Rather than just turning on the LED, you modulate it with the freqout command, sending the modulated signal for a preset time. You just make the first transmission longer to define it as a start bit. I can’t remember exactly but I think the receiver gives a solid low when it sees the modulated light, and a solid high when it does not see the modulated light. So it’s a matter of just looking for a low that stays low for a preset time, then you count off the number of bits by reading the sensor at the proper intervals for the number of bits you are sending.
It’s really cheap and relatively easy. I mean even I was able to figure it out. lol
“Non-stock” means Digi-Key does not usually keep a stock on hand. However, for this particular part, they have 188 available. They ARE in stock, just with a limited quantity. That’s how it works.
Thanks for the explanation. I order from them all the time, but usually steer clear of the “non-stock” items. Maybe the don’t usually stock them but do have some on hand.