Like Bruce, I'm unfamiliar with the modules you chose. From your description it seems like they are superregenerative receivers. Seefor an explanation of the noisy output. It can be caused by environmental factors or come from internal noise sources (e.g. resistors).
Using SerIn with this type of receiver creates two problems. One is that SerIn samples the data at the mid-point of the bit period. If the output is high at that time, you get a 1 bit and, if low, you get a 0 bit. Random noise can give you either state. The other problem is that you need to set the receiver AGC and ATC (Automatic Gain Control & Automatic Threshold Control) and you need to signal the receiver that some data is on the way. The sync bytes recommended by several people who post here are intended to serve those purposes. EDIT: If you look at the bottom picture at the above referenced link, you can see how a signal very much like the sync bytes only gradually emerges from the noise. There is a better way but it depends on the type of data that you wish to transmit.
I would only use SerOut/SerIn if I wanted to send text or lengthy data packets. And these receivers are not the best choice for either. FSK gets away from noise and the receiver has a CD (Carrier Detect) output that tells you when data is coming. FSK modules cost more than ASK but not as much as the ones you've chosen.
For short data packets, I prefer ASK and the NEC protocol illustrated in this threadThe long lead-in pulse sets AGC & ATC and signals that a data packet follows. Since the output is only monitored after seeing the long lead-in, random noise is much less of an issue. Instead of sampling at mid-bit, the receive routine measures the length of the spaces between pulses so it's less likely to be fooled by noise or its absence at mid-bit. (It's even better to measure between rising edges but that requires interrupts.) And each byte is sent twice in bitwise complementary form so error detection is built-in.
What is the nature of the data that you want to transmit?
Bookmarks