- Published: Saturday, 04 April 2009
- Written by Digital DIY
- Hits: 15388
RF modules make communication in isolated areas/long distances easy, and contrary to popular belief, the whole process is quite simple. There are many different 'passive' RF modules that simply interface with a micro-controller via USART. I call them passive RF modules as much of the process is 'taken care of' .. modulating data (converting 1s and 0s into an RF signal), reception and then demodulating into digital form. You generally need not worry how these RF modules operate under the hood.
That said, there are some very important considerations, particularly buad and operating voltage.
Most data protocols have a buad specification and USART is particularly dependant upon buad. With Proton and the RSOUT or RSIN commands, you must specify a baud rate in the settings (declarations). If the RF module can not operate at the desired buad, then the data will become scrambled and undecipherable.
In this example I have used the TLP434A and RLP434A modules. They are by no means the best, I just chose them as they were cheap (and available). They can handle up to 3K baud efficiently, and in my serial programming, I always use computer equivalent (standard) bauds such as 2400/4800/9600.
Wiring Diagram for the receiver (PSU/Osc not shown):
Wiring Diagram for the transmitter (PSU/Osc not shown):
Now for the easy part, programming them. Just a quick 101 on serial transfer, the header "Z" is sent before the value as a marker. This is so that the receiver knows that the data its receiving is legit, well as good as it can be. The post marker "A" allows the RSIN command to recognized that the whole number has been sent. It must be an alphabetical value, and if there was no post marker, it wouldn't know if the last number it received is actually the last number, and will wait until it times out for the next value (see the Proton User Guide for more information about how RSIN and RSOUT work under the hood).
An example of a transmitter program;