2
\$\begingroup\$

I want to use a "listen-before-talk" approach to transmit data from sensors connected to a transmitter and receiver pair to a MCU connected to a transmitter and receiver, which means that the sensor will only transmit data once it has been asked to do so by the MCU, but the problem I'm having is that my receivers will have no way of knowing if the information it's receiving is from one of my transmitters or from some other 433 transmitter in the area.The receiver I want to use has a product description here which seems to suggest there may be a method of pairing up my transmitters and receivers but how? If I transmit transmitter ID information e.g if the transmitter is transmitting 4 bits, I make the first two bits always "11" so the receiver knows that the information is from one of the transmitters it should listen to would I then be able to filter data I don't want on the AVR?

\$\endgroup\$
4
  • 1
    \$\begingroup\$ possible duplicate of Designing a good RF Transmission/Reception system for Embedded System \$\endgroup\$ – Dave Tweed Feb 26 '13 at 12:27
  • \$\begingroup\$ @DaveTweed it seems to be related, but not a duplicate. \$\endgroup\$ – Kortuk Feb 26 '13 at 16:32
  • \$\begingroup\$ @Kortuk: Look at the revision history of the other question (and note the timestamps). \$\endgroup\$ – Dave Tweed Feb 26 '13 at 16:56
  • \$\begingroup\$ @DaveTweed Ahh yes, the user thought that you just kept editing to add more to the question. This is much better, ask each question discretely. Thanks for explaining! \$\endgroup\$ – Kortuk Feb 26 '13 at 17:07
5
\$\begingroup\$

Those types of transmitters and receivers only work on a single channel. The receivers usually employ a form of active gain control (AGC), so will increase the gain until something (usually noise) is received. The gain is reduced to an appropriate level when a transmission starts.

Generally best practice is to:

  • Agree on a bit rate between the two systems (e.g. 4800bps). Generally receiver/transmitter pairs will give you some guidance on these.
  • Transmit a preamble of 10101010 (generally somewhere between 8 and 40 bits) before starting the main transmission. This has two purposes - it allows the AGC to settle at a good point, and can be detected by the microcontroller so it is aware that a transmission is starting.
  • Transmit a sync word e.g. 0xD5F7, and only listen to packets which have the correct sync word. The length of the sync word varies.
  • Use the rest of the data packet to detail the address, direction, and data.

I have found that the VirtualWire library for the Arduino is actually a nice, clear example of how to go about this. Maybe take a look, even if you are working with another microcontroller family.

One further thing worth considering is the encoding of bits. You can just send a 1 as a 1 and a 0 as a 0. There are more complex schemes though. Manchester encoding ensures that each bit of data transmitted has at least one signal transition. This has two significant effects:

  1. Regardless of the data sent, there will be an equal number of highs and lows sent. This means the AGC can work properly and there is no DC bias to the signal.
  2. As there is a transition for each bit, it is easy to recover the clock from the signal even if it is not known. This really means you transmitters no longer have a need to use an external crystal - the internal oscillator is accurate enough.
\$\endgroup\$
1
  • \$\begingroup\$ +1 for Preamble.. you can also add a SOM if you want. \$\endgroup\$ – hassan789 Feb 26 '13 at 15:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.