Pages Menu
TwitterRssFacebook
Categories Menu

Posted by on Sep 6, 2011 in Electronics | 180 comments

RF Module Interfacing without Microcontrollers

RF Module Interfacing without Microcontrollers

wave

Going wireless always starts with a basic RF communication, using serial encoders and decoders. This process and methodology is described here very aptly, doesn’t matter whether you are a newbie or not!

If you want to make an RF controlled robot, you would prefer to read this post first!

Going Wireless

These days, the term wireless is very much hyped! Whenever we hear the term wireless, stuffs like Mobile telecommunication (GSM), Wi-Fi, Bluetooth, RF Communication, Wireless networks, Zigbee, I2C, SPI, DTMF, 802.11b, SimpliciTI etc etc etc. Well, fortunately or unfortunately, all of these protocols can be interfaced with a microcontroller in one way or the other. But what matters is the level of complexity.

To start off, for beginners, RF (Radio Frequency) Communication is the most preferred and low cost solution. All you need is a RF Module (Transmitter-Receiver Pair). Now, that’s not all. RF Communication works on the principle of Serial Communication. Thus, you need something which converts the conventional n-bit (4-bit, 8-bit, 16-bit, etc) data into serial data. For this, we have two choices:

  • Use a microcontroller to convert the n-bit data into serial data and vice-versa
  • Use serial encoders/decoders to do the same
Since the title of the post says that we shouldn’t use microcontrollers, the only option left for us is to use the encoder/decoder.

RF Communication Block Diagram

RF Communication Block Diagram

RF Communication Block Diagram (Click to Enlarge)

A general RF communication block diagram is shown above. Since most of the encoders/decoders/microcontrollers are TTL compatible, most of the inputs by the user will be given in TTL logic level. Thus, this TTL input is to be converted into serial data input using an encoder or a microcontroller. This serial data can be directly read using the RF Transmitter, which then performs ASK (in some cases FSK) modulation on it and transmit the data through the antenna.

In the receiver side, the RF Receiver receives the modulated signal through the antenna, performs all kinds of processing, filtering, demodulation, etc and gives out a serial data. This serial data is then converted to a TTL level logic data, which is the same data that the user has input.

So now, let’s look into the hardware that are required.

RF Module

RF Modules are used wireless transfer data. This makes them most suitable for remote control applications, as in where you need to control some machines or robots without getting in touch with them (may be due to various reasons like safety, etc). Now depending upon the type of application, the RF module is chosen. For short range wireless control applications, an ASK RF Transmitter-Receiver Module of frequency 315 MHz or 433 MHz is most suitable. They are quite compact and cheap! You can buy them from the following stores:

A typical 315MHz (or) 433MHz ASK RF Module looks like this (courtesy EngineersGarage)

RF Module

RF Module

Now, let’s have a look at it’s pinout (courtesy EngineersGarage)

RF Module Pins

RF Module Pins

Pin Description:

RF Transmitter Pin Description

RF Receiver Pin Description

Features:

  • Range in open space(Standard Conditions) : 100 Meters
  • RX Receiver Frequency : 433 MHz
  • RX Typical Sensitivity : 105 Dbm
  • RX Supply Current : 3.5 mA
  • RX IF Frequency : 1MHz
  • Low Power Consumption
  • Easy For Application
  • RX Operating Voltage : 5V
  • TX Frequency Range : 433.92 MHz
  • TX Supply Voltage : 3V ~ 6V
  • TX Out Put Power : 4 ~ 12 Dbm

This has single channel for data transfer, thus serial data communication is used.

Serial Encoder/Decoder

The most popular serial encoder/decoder used is the HT12D-HT12E pair. Their description is given below. It’s okay if you don’t understand what is written there. Just make sure you go through the pin configurations and the circuit implementation.

The HT12E Encoder ICs are series of CMOS LSIs for Remote Control system applications. They are capable of Encoding 12 bit of information which consists of N address bits and 12-N data bits. Each address/data input is externally trinary programmable if bonded out.

HT12E Pin

HT12E Pin

The HT12D Decoder ICs are series of CMOS LSIs for remote control system applications. This ICs are paired with each other. For proper operation a pair of encoder/decoder with the same number of address and data format should be selected. The Decoder receive the serial address and data from its corresponding encoder, transmitted by a carrier using an RF transmission medium and gives output to the output pins after processing the data.

Features - Encoder

  • 18 PIN DIP
  • Operating Voltage : 2.4V ~ 12V
  • Low Power and High Noise Immunity
  • CMOS Technology
  • Low Standby Current and Minimum Transmission Word
  • Built-in Oscillator needs only 5% Resistor
  • Easy Interface with and RF or an Infrared transmission medium
  • Minimal External Components
HT12D Pin

HT12D Pin

Features - Decoder

  • 18 PIN DIP
  • Operating Voltage : 2.4V ~ 12.0V
  • Low Power and High Noise Immunity
  • CMOS Technology
  • Low Stand by Current
  • Ternary address setting
  • Capable of Decoding 12 bits of Information
  • 8 ~ 12 Address Pins and 0 ~ 4 Data Pins
  • Received Data are checked 2 times, Built in Oscillator needs only 5% resistor
  • VT goes high during a valid transmission
  • Easy Interface with an RF of IR transmission medium
  • Minimal External Components

Applications

  • Burglar Alarm, Smoke Alarm, Fire Alarm, Car Alarm, Security System
  • Garage Door and Car Door Controllers
  • Cordless telephone
  • Other Remote Control System

Compatibility

  • Compatible with RF Modules 433 MHz Link RF Modules (Tx + Rx Pair) 433 Mhz ASK
Now let’s move on to the circuit implementation part.

Circuit Implementation

There isn’t much in circuit implementation. You just need to take a solderless breadboard and make the connections… and snap! You are done! :)

Transmitter Section

Make the following circuit on a breadboard. You are requested to implement the following circuit at your own risk! We will NOT be responsible for any damages caused due to implementation of the circuit, physically, mentally or financially.

RF Transmitter Section

RF Transmitter Section (Click to Enlarge)

Here, we have used four switches S1, S2, S3 and S4 to give 4-bit parallel data (D0-D3). Since the switches are in active low state (i.e. low signal is sent when the switch is pressed), we need to add external pull-up resistors as shown, so as to provide a high signal by default. A resistance as high as 1Mohm is required in between OSC1 and OSC2 pins. The Transmitter Enable (TE, pin 14) pin is an active low pin. Thus, it is permanently grounded, so as to enable the transistor always. The output serial data DOUT is fed to the RF Transmitter Module directly.

The most important thing lies in the address pins (A0-A7, pin1-8). Suppose you have two wireless devices (A and B) in your house, both have different remote controls (AA and BB) and both implement the same type of RF module (say 433 MHz). AA is the remote control of A and BB is of B. Now, you obviously wouldn’t want AA to control B (which is the most probable case since both the devices use same kind of RF module, having same frequency!). This is where address pins come into play. There are 8 address pins, thus giving you an opportunity to have 8! (8 factorial) different and independent ways to connect to a device, so that there is no interference. The address pins MUST have the same address in both transmitter and receiver, or else the data won’t be transferred. Refer to the receiver circuit for more details.

Receiver Section

Now make the following circuit on a different breadboard. As mentioned earlier, you are requested to implement the following circuit at your own risk! We will NOT be responsible for any damages caused due to implementation of the circuit, physically, mentally or financially.

RF Receiver Section

RF Receiver Section (Click to Enlarge)

The circuit of the receiver is also quite simple. Capacitor C1 is used between Vcc and GND for noise filtering. Apart from that, all the address pins (A0-A7, pin 1-8) are grounded, just as in transmitter. This is to ensure that the transmitted data is being received. Both the transmitter and the receiver MUST have the same address pins configuration. Pin 17 (VT) is enabled whenever the receiver receives any data. The serial data received by the RF Receiver module is directly fed to pin 14 (DIN), which is then converted into 4-bit parallel data (D0-D3). A 33 kohm resistor is connected in between OSC1 and OSC2.

Antenna

Okay, so now that all the connections are made, you must choose an antenna for signal transmission. Usually, a 20-30 cm wire serves best. It is sufficient to give a range of 80 meters in open region. To improve the efficiency, you can also use a coiled wire (take a wire and make it into a coil). It increases the signal strength.

Result – What you will get?

Once the circuit is made and powered up, the four LEDs on the receiver end will glow by default. The LED corresponding to VT glows only when some data is received. Now whenever you press any switch (on the transmitter end), that particular LED (on the receiver end) goes off! Interesting, eh?! ;)

Troubleshooting

It’s obvious that you won’t get the result in the first go itself! It’s completely normal, even in my case! :D There will be times when you will say to yourself that it’s not gonna happen. In that case, just try out the simple wired communication. Connect the DOUT of the encoder directly to the DIN of the decoder using a wire. Then check and recheck your connections, check whether the address is the same, whether you have missed any Vcc or GND connection, etc. If still then a successful link is not established, change your encoder/decoder ICs. Once your link is established, connect the RF module and do the same. Try adjusting the antenna position, touch the antenna (touching the antenna will make yourself an antenna!), etc. If still not successful, then all I suggest is to google out your problem and see if somebody else has sorted it out or not.

Extending the circuit

This circuit can be easily extended to anything, depending upon your application. If you are using it control a robot, the output data can be directly given to a motor driver. View this article for details. If you are using it to control any external device, this data can be fed there. In other words, whatever data you wanted to send, the same is available at some other location, which can be manipulated very easily.

Making an RF Car

If you want to make a wireless robot and want to use RF technology to achieve that, then you can view this interesting post by Yash on maxEmbedded and learn how he made it.

So folks, this is all about RF module interfacing without using microcontrollers. We will discuss the same topic once again after learning Serial Communication. So till then, you can stay updated by grabbing RSS Feeds or subscribing to my blog! :)

Thank You

Mayank Prasad
VIT University

Max

Max is the founder and admin of maxEmbedded. He describes himself as an 'embedded electronics freak' and an Apple/Linux fan. He likes to experiment, learn and share new things in this field. Furthermore, he likes to write stuffs on his website for techie newbies and loves to teach others. In his spare time, you will find him with volunteering somewhere!

More Posts - Website

Follow Me:
TwitterFacebookLinkedInGoogle Plus

180 Comments

  1. hello.
    can any body send me a complete documentation about rf module..?
    my email id:sriakhileshp@gmail.com

    • Hello Akhilesh
      What documentation do you require? The Pin Descriptions?

      • concept of using encoder and decoder in rf module.

        • Encoder/Decoders are an alternate to Interfacing the RF Modules with an MCU with the help of UART. In other words, they make your work simpler by eliminating the coding part.
          Reply back if you need any more help!

  2. Hi to all, how is everything, I think every one is getting more from this site, and
    your views are nice for new viewers.

  3. hi, can we interface the above set -up with a micro-controller so that we can assign another hardware for usart/uart.. ?? i’m asking that instead of that switches can we directly connect encoder/decoder wires into port pins.. will it be working fine..?

    • Hi Rakesh,
      I can’t find any reason why it won’t.

      • hi,
        I was worried about the switching speed.even if I’m using some delay,that may affect the timing of receiver.
        any how, I’ve made this now and ready to interface..
        thank you

  4. Hello,
    i am using pc controlled application.
    I have made max232 circuit to get serial output from UART.
    I have connected ask transmitter data pin to max232 serial tx.
    and ask receiver is connected to my microcontroller P3.0(rx pin).
    But this is not working fine.
    I checked by directly connecting wire(without ask) then its working fine.
    What should i do?
    Thanks

    • Darpan, did you try playing around with the antenna?

      • Hello Mayank,
        I have checked the antennas on another application using encoder and decoder ic, antennas are working fine..
        The problem comjes when i interface with UART.

  5. Thanks for a lovely article. I have a ATTINY2313 connected to the 433 MHz TX module via the USART pin (TX pin). The 433 MHz receiver is connected to a UNO’s RX Pin. I used a Logic analyzer and can see that the TX unit is sending the data and the RF receiver is receiving the data. However when I connect to the RX Pin of the UNO (with common ground with the RF module) the logic levels of the data pin of the receiver module gets pulled up to a constant HI (All the data is lost). I measured the TTL signal level of the data pin on the receiver module and it reads about 1.8 volts. Request you to please check the Voltage at the data pin of the receiver module and let me know if 1,8 volts is the expected voltage at the DATA pin of the receiver module.

    I posted this problem at AVRFREAKS – has a lot more detail and could give a little more insight into the problem.

    http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=140348

    Thanks in advance
    Ravi Upadhyaya

  6. If you have a 433 MHz setup, request you to measure the voltage between the DATA pin of the RX module and the GND and let me know the voltage reading. I just want to be sure of the status of my RX module.

    Thanks again.

  7. Hello
    can anyone help me… i have constructed transmitter and reciever circuits on two different pcb. the transmitter side is working well as i have seen the waveforms on CRO.. but on reciever side the reciver is recieving is recieving the same waveform but decoder is not working(Vt not going high).
    i tried no. of combinations of resistance(b/w osc1 &osc2) but didnt work
    1- 1Mohm on tx side & 33k on rx
    2-1Mohm on Tx side & 1k on Rx
    3-820 K on Tx side & 1k in Rx..
    please help..

  8. i’ve grounded all the address pin in both HT12E & HT12D…
    ive also replaced the HT12D but it doesnt worked at all…

  9. Hello Mayank,
    I made a microcontroller based TX Rx set.
    I Wrote a code which sends an array [0,2,4,6,8,16,32,64,128] through TX pin. I connected a 16×2 lcd to the receiver microcontroller. First i tested with wired communication and it worked perfectly.
    But using the 433MHz Tx Rx pair, the lcd keeps on displaying random numbers from 000 to 255.

    Again i made the wired communication and checked the link signal in oscilloscope which i found a periodically high to low going signal (90% high and 10% low).

    I checked the same with Tx Rx pair, I got the same 90% high 10% low periodic signals at TX data pin. But at Rx data pin, an irregular period pulse train is observed.

    How can i resolve this. I cheked the experiment with two different Tx Rx pairs and even on breadboard with switch on Tx side and led on Rx side. But no result. In almost 30-40 attempts, i got the result once but two/ three values are missing from the array.

  10. great post brother… :)
    i think that the LED’s placed at the data lines of decoder should be connected in a way such that the negative of LED is connected to the data pin and positive of LED connected to VCC.

    Still it is a good tutorial for teaching the basics of rf module interfacing without microcontrollers… :))

    • It doesn’t matter. You’re describing active low configuration, whereas I used active high. Both are a complement of each other. Thanks.

  11. dear sir i ysed positivte control but its still not working what is the region

    • I’m sorry, what?

  12. can i get a software code to interface RF module with LPC2129 or similar specification microcontroller ? please help me out in this

    • Hello Nawaz,
      You’ll need to use the serial/UART feature of your microcontroller. We cannot help you with writing the code. I would suggest to go through the datasheet of the microcontroller and learn about the various registers used. Thanks.

  13. above ckt by default led glow can u suggest me ckt that led will normally off & when i transmit that time only glow

    • Which LED are you talking about? The one connected to VT or the ones connected to data pins? The LED corresponding to VT glows only when some data is received.

  14. Hello sir i am trying to make one transmitter to control multi receiver,i have doubt that if i have 4 receiver and 1 transmitter and i assign different address for each receiver then if i want to send the data to the 2 receiver should i change the address each time for each chanel? or is there is any way to change address in transmitter?
    Thank you i am waiting for your reply sir…

    • I possibly don’t understand your question when you ask whether to change address for each channel “or” any way to change address in transmitter. Please be a little more clear. Thanks!

  15. can i use single rx and at least 6 tx ,actually in my project i have to send signal from multiple transmitter and collect signal with single receiver .
    thanks in advance

    • Nikhilesh, it might not be a good idea. Try out some other way, like using WiFi.

  16. Hai, I made two circuits with two pairs of RF module. I have configured different addresses to my two transmitter & receiver Pairs. But both the circuits are not working at a same time. One pair of module is working fine when another is turned off… So my circuit is not wrong , its the problem with the module addressing only. How to solve this issue?? pls help…

  17. Hello sir, i have made circuit for single transmitter to control multiple receiver(ic HT12E and HT12D) and i have set different address for each receiver and i have connected dip switch in transmitter side to change the address. The problem is if i send a data to the 1st receiver means then i have to set the particular receiver address in transmitter ,if i send data to 2nd receiver again i need to change the address in the transmitter. Is there is any other way to change the address in transmitter.

    • You can connect the address pins of the encoder to a microcontroller, and let the microcontroller wiggle the bits for you.

  18. hello Max,

    Can you help me please.
    I would like to communicate via RF from my robot to my android tablet.
    How can I do this?

    rgds
    chan

    • Chan,
      Are you sure that you want to use RF? May be you could try using something which is natively supported by your tablet – like Bluetooth or WiFi.

  19. sir could you help me in generating the extended circuit for the load in the receiver part…
    i am new in this projects….
    i would like to have for loads attached…

    • Hi Nimo

      What exactly do you mean by loads? Do you intend to connect devices like LEDs or buzzers to the output of the RF Receiver?

      • sir i really appreciate this project…
        i adapted this for our requirement in one subject…
        im a newbie in this…
        i would like to have the complete circuit for the output where the load will be 4 light bulbs…

        thank you sir…
        could i have the circuit as soon as possible…
        thank you very uch…

        • Hi Nimo

          We would really appreciate if you give us more information about your project.It’ll enable us to help you better. What sorts of bulbs are you talking about, AC or DC? How much power do they draw or what is their operating voltage?

          • thank your sir for continuously answering our queries. sir i would like that it will be supplied by AC voltage source. the power rating of the light bulbs will be 25 watts. sir could it be possible that the bulbs will be powered by a single source, what i mean is a common connection of the bulbs from the source so that their will be a single connection to the source.

Trackbacks/Pingbacks

  1. Making an RF Car | maxEmbedded - [...] module, and the usual wires, resistors etc. Theoretical information related to this can be found in this post, where …

Post a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>