Hi all,
i am setting up multiple infrared transmitters and multiple infra red
recivers, all connected to a pic micro controller (pic 16f877).
if i want to transmit unique id's from each transmitter to be recieved
and decoded by the pic, which method of signal or pulse modulation is
the best.
I saw a lot about ASK, PSK, FSK - how are these different to pulse
modulation techniques, cause they seem the same to me. For eg: PSK and
PPM (pulse position modulation).
Is PPM the best way for me to go about this?
knowledge level- basic.. so please bear with me
Hi. If you're doing an IR transmitter/receiver project with a PIC, you
might be overthinking this a bit.
The standard "gotcha" in infrared transmitting/receiving is the problem
of ambient light. If you've got a guaranteed dark room, and you know
for sure one transmitter and one receiver are pointed right at each
other and a fixed distance away, with no other sources of light, there
are a lot of cool things you can do.
But years of commercial development of that wondrous American
invention, the TV remote control, showed that in a wide variety of
transmission environments, most of the cool things you can do don't
work very reliably. Also, while IR LEDs are pretty fast,
phototransistors are pretty slow.
So, the current commonly accepted transmission method is simple. You
purchase an IR LED and hook it up to PIC 1. You then purchase an IR
receiver module which has an internal filter tuning it to a fairly
specific frequency (say, 38KHz), and hook it up to PIC2.
Now you're ready to send and receive data. To send a logic "1", PIC1
uses its internal clock to strobe the IR LED at a frequency matching
the IR receiver (say, 38KHz) for about 20-50ms. (50% duty cycle). To
send a logic "0", the PIC keeps the LED off. The strobes are picked up
by the IR receiver, which gives a steady 50 ms.demodulated logic signal
that can be read by PIC2.
Standard rules of serial communication apply here. I would suppose you
would want a start bit, followed by some bits for receiver ID, plus the
code you would want to transmit. Television remote controls typically
only send one data word of information at a time. If you're interested
in communicating a lot of data, or if you want to ensure the data is
valid, you may want to do a checksum. You could also give each
receiver the capability to transmit, where it could either send an ACK
or NACK, or retransmit the checksum to acknowledge the data. Up to you
-- many ways to skin the cat, depending on the specifics of your
project and how sure you want to be that the data was received
properly.
Now, if you're doing multiple transmitters, you'll have a problem here.
Obviously the IR pulses of two transmitters have the capability of
stepping all over each other, and garbling the transmission. You may
want to set up an environment where one PIC is the arbiter, and gives
permission for each transmitter to speak in turn. This is commonly
done in RS-485, where there are multiple transmitters sharing the same
line. But this is primarily a software problem, which you'll have to
work out.
This setup is brutally slow (20 to 50 bits per second?!?!), but fairly
reliable. You may also want to add some fault tolerance into this
setup, as stuff happens (but usually it's not called stuff).
Here's how simple the hardware end of your project can be (view in
fixed font or M$ Notepad):
|
| VCC
| +
| |
| .------o-------. VCC
| | | +
| | | IR LED |
| | | V~
| | | -~
| | | ___ |
| | o-----|___|----'
| | | 150 ohm
| | PIC |
| | | VCC
| | | +
| | | |
| | | .-o-.
| | | | |
| | | | |\
| | o--------o | )
| | | | |/
| | | | |
| | | '-o-'
| | | |
| | | ===
| | | GND
| '------o-------'
| |
| ===
| GND
(created by AACircuit v1.28.5 beta 02/06/05
www.tech-chat.de)
A couple of hardware notes: Good crystals on all the PICs. Be sure to
get IR LEDs which match the optimum wavelength of the detector you
choose. Be sure to use good grounding practice, and ground the case of
the detector -- it can make a big difference. When you're setting this
up, you'll also have to keep in mind that the LEDs and receivers are
somewhat directional -- unless you've only got 3 devices, you're going
to have issues with all the devices seeing each other. Mirrors may
help here.
Feel free to post again if you have more questions. I'd be interested
in knowing how many transmitters, how many receivers you have. How
much information of what kind are you sending? I'd also like to know
if this is for the Diploma program or the Bachelors degree program, and
if this is the senior project. Do you have a deadline here? And you
might want to mention a name.
make yourself MIghTy ;-)
Chris