loading

The video above explains the basic theory that relates to data transmission, namely how electromagnetic waves are generated by antennas and how they encode 1's and 0's. Non essential information for a hobbyist, but really interesting none the less.

Component list:

•1 X Arduino Uno

•1 X 433MHz RF link pair

•3 X LED

•1 X Piezo Buzzer

•1 X Push Button

•1 X Resistor 330Ω

•50cm Single Core Wire

Equipment needed:

Soldering Iron

Step 1: Build the Transmitter

Observe the schematic and the completed circuit (video tutorial also available)

Make sure you do ALL of the following:

1. Connect the module in the following manner Vcc pin connects to Arduino 5V GND to Arduino GND and DATA to Arduino Pin 12

2.The button connects to Arduino pin 2 and needs to be earthed

3. The antenna needs to be soldered onto the module. The antenna is 35cm long and soldered into an antenna slot in the transmitter module.

4. The antenna is to be straight if possible.

Watch the video from time: 00:40 to see the circuit built from scratch

Step 2: Building the Receiver

Observe the schematic and the completed circuit
Make sure you do ALL of the following:

1. Connect the module in the following manner Vcc pin connects to Arduino 5V GND to Arduino GND and DATA (Adjacent to to Arduino Pin 12

2. Connect a red LED to Arduino pin 5

3. Connect 1 or more Green LED's to Arduino pin 7

4. Connect a piezo buzzer to Arduino pin 8

Watch the video from time: 04:11 to see the circuit built from scratch

Step 3: Upload Transmitter Code

Upload this code onto the Arduino in the transmitter circuit

Watch the video from time: 07:58 for some extra information on the code

Step 4: Upload Receiver Code

Upload this code onto the Arduino in the receiver circuit

Watch the video from time:10:03 for some extra information on the code

THATS IT YOURE DONE!!!

<p>Hhope this helps someone. Updated these sketches to use RadioHead library.</p><p>Transmitter</p><p>*****************************</p><p>//This code was written using the functions of the Virtual Wire Library.</p><p>//Function list here: <a href="http://www.airspayce.com/mikem/arduino/VirtualWire/VirtualWire_8h.html" rel="nofollow"> http://www.airspayce.com/mikem/arduino/VirtualWir...</a></p><p><iframe allowfullscreen="" frameborder="0" height="281" src="//www.youtube.com/embed/gkc9xN9pZ4Y" width="500"></iframe></p><p>Please note the default values used in the RadioHead Library as follows</p><p>RH_ASK::RH_ASK(</p><p>uint16_t speed = 2000,</p><p>uint8_t,rxPin = 11,</p><p>uint8_t,txPin = 12,</p><p>uint8_t,pttPin = 10,</p><p>bool,pttInverted = false </p><p>)</p><p>***Updated for RadioHead Library</p><p>****************************************************************************</p><p>//This code was written using the functions of the Virtual Wire Library.</p><p>//Function list here: <a href="http://www.airspayce.com/mikem/arduino/VirtualWire/VirtualWire_8h.html" rel="nofollow"> http://www.airspayce.com/mikem/arduino/VirtualWir...</a></p><p><iframe allowfullscreen="" frameborder="0" height="281" src="//www.youtube.com/embed/gkc9xN9pZ4Y" width="500"></iframe></p><p>// Written by Sanjin Dedic as a part of Robotix Arduino Tutorial Course</p><p>// <a href="http://robotix.com.au/tutorials.html" rel="nofollow"> http://robotix.com.au/tutorials.html</a></p><p>//#include &lt;VirtualWire.h&gt;</p><p>//#include &lt;RadioHead.h&gt;</p><p>#include &lt;RH_ASK.h&gt;</p><p>#include &lt;SPI.h&gt; // Not actually used but needed to compile</p><p>const char *message = &quot;Merry Christmas&quot;;</p><p>int button = 2;</p><p>RH_ASK driver;</p><p>void setup() {</p><p>Serial.begin(9600); // Debugging only</p><p> if (!driver.init())</p><p> Serial.println(&quot;init of receiver failed&quot;);</p><p>pinMode(button,INPUT);</p><p>//vw_set_ptt_inverted(true); // On a communication line means that each </p><p>// party is either transmitting or receiving ( like a walkie talkie)</p><p>//vw_set_tx_pin(12); // set transmitter pin</p><p>//vw_setup(4000);// speed of data transfer Kbps</p><p>}</p><p>void loop(){</p><p>if (digitalRead(button) == HIGH){ </p><p>message=&quot;X&quot;;</p><p>driver.send((uint8_t *)message, strlen(message)); // send the message</p><p>driver.waitPacketSent(); // Wait until the whole message is gone</p><p>Serial.println(message);</p><p>Serial.println(strlen(message));</p><p>delay(2000);</p><p>}</p><p>}</p><p>**********************************************************</p><p>Receiver - Updated for RadioHead Library</p><p>********************************************************</p><p>//This code was written using the functions of the Virtual Wire Library.</p><p>//Function list here: <a href="http://www.airspayce.com/mikem/arduino/VirtualWire/VirtualWire_8h.html" rel="nofollow"> http://www.airspayce.com/mikem/arduino/VirtualWir...</a></p><p><iframe allowfullscreen="" frameborder="0" height="281" src="//www.youtube.com/embed/gkc9xN9pZ4Y" width="500"></iframe></p><p>// Written by Sanjin Dedic as a part of Robotix Arduino Tutorial Course</p><p>// <a href="http://robotix.com.au/tutorials.html" rel="nofollow"> http://robotix.com.au/tutorials.html</a></p><p>#include &lt;RH_ASK.h&gt;</p><p>#include &lt;SPI.h&gt; // Not actualy used but needed to compile</p><p>RH_ASK driver;</p><p>// RH_ASK driver(2000, 2, 4, 5); // ESP8266: do not use pin 11</p><p>int ledPassive = 5; //standby light</p><p>int ledActive = 7; //green LED's</p><p>int buzzer = 8; </p><p>void setup()</p><p>{</p><p> pinMode(ledPassive,OUTPUT);</p><p> pinMode(ledActive,OUTPUT);</p><p> pinMode(buzzer,OUTPUT);</p><p> // vw_set_ptt_inverted(true); // On a communication line means that each </p><p>// party is either transmitting or receiving ( like a walkie talkie)</p><p> // vw_set_rx_pin(12); // set receiver pin</p><p> // vw_setup(4000); // Bits per sec</p><p> // vw_rx_start(); // Start Phase Locked Loop (listening to the receiver)</p><p> Serial.begin(9600); // Debugging only</p><p> if (!driver.init())</p><p> Serial.println(&quot;init of receiver failed&quot;);</p><p>}</p><p> void loop()</p><p>{</p><p> digitalWrite(ledPassive,HIGH);</p><p> digitalWrite(buzzer,LOW);</p><p> digitalWrite(ledActive,LOW);</p><p> uint8_t buf[RH_ASK_MAX_MESSAGE_LEN];</p><p> uint8_t buflen = sizeof(buf);</p><p> if (driver.recv(buf, &amp;buflen)) { // if message received</p><p> for(int i=0;i&lt;sizeof(buf);i++)</p><p> Serial.print(char(buf[i])); //test display output</p><p> if(buf[0]=='X'){ // and if the first letter in message array is X </p><p> digitalWrite(ledPassive,LOW); </p><p> for(int i=0;i&lt;10;i++){ // loop alternates between LED and buzzer</p><p> digitalWrite(buzzer,LOW);</p><p> digitalWrite(ledActive,HIGH);</p><p> delay(200);</p><p> digitalWrite(buzzer,HIGH);</p><p> digitalWrite(ledActive,LOW);</p><p> delay(200);</p><p> }</p><p> } </p><p> else if(buf[0]!='X'){</p><p> digitalWrite(ledPassive,HIGH);</p><p> }</p><p>}</p><p>}</p>
<p>Is there an update for the new RadioHead Library? </p>
<p>hello sir i am doing same thing but getting nothing ,</p><p>what should i do plz reply</p>
how to find signal connectivity status
<p>Wow, using a 3.3VDC Arduino Pro-Mini and using 3.7 to 4.2 volts to the 433MHz TX is getting me 80 feet (24M). The RX is at 5VDC. That is with 17cm antennas on both.</p>
<p>I'm going to try using a ATtiny85 for the TX and RX on this project. If it works I will use it in my bicycle siren project I am working on. A button on the handlebars to activate lights/siren sitting in the trailer puller behind the bicycle. The idea is to scare away animals ahead of the bicycle's path on the roadway.</p>
<p>Great project and great instructions. Mine works. </p>
I am doing same project but I am facing some problem in transmitting data to rf receiver.So plz help me...how can I get data on receiver...<br>
<p>For anyone reading this and looking for good antenna advice, I've found that the tiny 'Helical antenna 433MHz' ones you find for 5 a dollar on ebay actually work reaally well, using one of those with one of the cheap green square transmitters has put me from a few meter on the same floor (with ~17cm wire) to all over the house, all three levels, and the shed outside :)</p>
<p>Wonderful</p>
<p>Is it need two pcs of Arduinos on the project for the future use? or just for the testing.</p>
<p>hello, i need help</p><p>I am designing a distance meter, but for that I will use (read) the signal strength value (the RSSI technique) sent by TX. I will can do with this RX and TX?</p>
<p>My code does not compile?</p><p>it says</p><p>Arduino: 1.0.6 (Mac OS X), Board: &quot;Arduino Leonardo&quot;</p><p>/Users/luigipizzolito/Desktop/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega32u4 -DF_CPU=16000000L -MMD -DUSB_VID=0x2341 -DUSB_PID=0x8036 -DARDUINO=106 -I/Users/luigipizzolito/Desktop/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino -I/Users/luigipizzolito/Desktop/Arduino.app/Contents/Resources/Java/hardware/arduino/variants/leonardo -I/Users/luigipizzolito/Documents/Arduino/libraries/VirtualWire /var/folders/gb/cl6mrjbs3vq4hz2wmlpvxprc0000gq/T/build7192067266878744403.tmp/sketch_jul03a.cpp -o /var/folders/gb/cl6mrjbs3vq4hz2wmlpvxprc0000gq/T/build7192067266878744403.tmp/sketch_jul03a.cpp.o </p><p>In file included from sketch_jul03a.ino:9:</p><p>/Users/luigipizzolito/Documents/Arduino/libraries/VirtualWire/VirtualWire.h:14:20: warning: wiring.h: No such file or directory</p><p>In file included from sketch_jul03a.ino:9:</p><p>/Users/luigipizzolito/Documents/Arduino/libraries/VirtualWire/VirtualWire.h:54: warning: 'vw_set_tx_pin' initialized and declared 'extern'</p><p>/Users/luigipizzolito/Documents/Arduino/libraries/VirtualWire/VirtualWire.h:54: error: variable or field 'vw_set_tx_pin' declared void</p><p>/Users/luigipizzolito/Documents/Arduino/libraries/VirtualWire/VirtualWire.h:54: error: 'uint8_t' was not declared in this scope</p><p>/Users/luigipizzolito/Documents/Arduino/libraries/VirtualWire/VirtualWire.h:58: warning: 'vw_set_rx_pin' initialized and declared 'extern'</p><p>/Users/luigipizzolito/Documents/Arduino/libraries/VirtualWire/VirtualWire.h:58: error: variable or field 'vw_set_rx_pin' declared void</p><p>/Users/luigipizzolito/Documents/Arduino/libraries/VirtualWire/VirtualWire.h:58: error: 'uint8_t' was not declared in this scope</p><p>/Users/luigipizzolito/Documents/Arduino/libraries/VirtualWire/VirtualWire.h:62: warning: 'vw_set_ptt_pin' initialized and declared 'extern'</p><p>/Users/luigipizzolito/Documents/Arduino/libraries/VirtualWire/VirtualWire.h:62: error: variable or field 'vw_set_ptt_pin' declared void</p><p>/Users/luigipizzolito/Documents/Arduino/libraries/VirtualWire/VirtualWire.h:62: error: 'uint8_t' was not declared in this scope</p><p>/Users/luigipizzolito/Documents/Arduino/libraries/VirtualWire/VirtualWire.h:66: warning: 'vw_set_ptt_inverted' initialized and declared 'extern'</p><p>/Users/luigipizzolito/Documents/Arduino/libraries/VirtualWire/VirtualWire.h:66: error: variable or field 'vw_set_ptt_inverted' declared void</p><p>/Users/luigipizzolito/Documents/Arduino/libraries/VirtualWire/VirtualWire.h:66: error: 'uint8_t' was not declared in this scope</p><p>/Users/luigipizzolito/Documents/Arduino/libraries/VirtualWire/VirtualWire.h:71: warning: 'vw_setup' initialized and declared 'extern'</p><p>/Users/luigipizzolito/Documents/Arduino/libraries/VirtualWire/VirtualWire.h:71: error: variable or field 'vw_setup' declared void</p><p>/Users/luigipizzolito/Documents/Arduino/libraries/VirtualWire/VirtualWire.h:71: error: 'uint16_t' was not declared in this scope</p><p>/Users/luigipizzolito/Documents/Arduino/libraries/VirtualWire/VirtualWire.h:90: error: 'uint8_t' does not name a type</p><p>/Users/luigipizzolito/Documents/Arduino/libraries/VirtualWire/VirtualWire.h:96: error: 'uint8_t' does not name a type</p><p>/Users/luigipizzolito/Documents/Arduino/libraries/VirtualWire/VirtualWire.h:99: error: 'uint8_t' does not name a type</p><p>/Users/luigipizzolito/Documents/Arduino/libraries/VirtualWire/VirtualWire.h:104: error: 'uint8_t' does not name a type</p><p>sketch_jul03a.ino: In function 'void setup()':</p><p>sketch_jul03a:18: error: 'vw_set_ptt_inverted' was not declared in this scope</p><p>sketch_jul03a:20: error: 'vw_set_tx_pin' was not declared in this scope</p><p>sketch_jul03a:21: error: 'vw_setup' was not declared in this scope</p><p>sketch_jul03a.ino: In function 'void loop()':</p><p>sketch_jul03a:28: error: 'vw_send' was not declared in this scope</p>
<p>That is in version 1.0.6 of Arduino</p>
<p>Hi Ploopy. I'd try using a different computer for another try at compiling. I have several different computers and often have errors on one attempt on computer 'A&quot; but no errors when compiling on computer 'B'. With both computers running 1.0.6 My best result are usually achieved when compiling on my Linux laptop. </p>
<p>I'll try it.</p>
<p>is there any possibilty to send back a message from receiver site like an acknowledge?</p>
<p>Well it appears 17.2cm antennas for both TX and RX work best. With clear line of sight I'm getting a reliable signal at 300FT (91.44meters) with the FS1000A/XY-MK-5V TX/RX modules. Since about 5mm is used in the coils on those 433MHz modules you can make antenna length about 16.7cm. Both antennas are straight (not coiled) 22ga wire. Will test tomorrow using a RXB6 433mhz receiver module with a standard FS1000A transmitter both with 17.2cm antenna.</p>
<p>Very good. the library interferes with the standard Servo.h library but it supposedly works with SoftewareServo and with the ServoTimer2 libraries.<br>As I tens to use this for an Attiny I'll try it with the attiny servo library as well<br></p>
<p>Very good tutorial (ible) and I thank you for taking the time to put it together for the Instructable community. I used an Arduino Nano for my transmitter and an Uno for the receiver and it worked just fine. Funny thing happened during the compiling though. When I tried to use the Arduino IDE on my Windows XP laptop I received 'out of scope errors' but then I tried using the Arduino IDE on my Linux laptop and had no problems at all. Weird? Yes! But following your instructions was super easy and it worked first try. So Thank You. Also I like your website @ http://robotix.com.au</p>
<p>You made it :) and you made my morning !!</p><p>In my experience Arduino can invent errors out of thin air especially when you are using large code and Serial.print. </p><p>The next stage is using this circuit to control a 4WD rover. This will take some research on antennas. Do let me know if you are aware of another tutorial that usese these circuits with 5m+ range</p>
<p>I am so happy I could start your day with good news! My plan is now to see if I can transmit data from my DHT11 temp/humidity sensor to my home-made Arduino LCD readout module. It's working fine now but I want to move the sensor outside. It is a coincidence a friend of my did drop off an RC monster truck here for me to work with, or tear down for servos. Here is a pick of the LCD display with the info from the DHT11 sensor connected to my home made Arduino Uno R3.</p>
<p>Also with the 35cm antenna on the Transmitter and the 9cm receiver antenna I got a max transmitting distance of 100 feet (30.48 meters). I will try dropping down the transmission rate as you suggested and see what effect that has on the distance. I'm looking at using this also in a driveway alert system that will buzz the house when a car pulls into the driveway. The sending of the X would be enough to make that happen so I should be able to go really low on the data transfer rate.</p>
<p>Mate this is amazing!!!... you got 30 meters where I got 3. Were your modules a little bit better than mine?</p><p>Do you have a link?</p><p>As for improving distance, the easiest thing would be to use 70cm on the super coiled receiver ( its still a smallish antenna) </p>
<p>I used the exact same modules as you. I just received another set and will try them and compare results. Who knows how well tuned they come from the factory? I may have just gotten lucky with my wire length being very compatible with the factory tuning of this particular module! I am going to give your suggestion about the 70cm receiver antenna a try and will let you know the results. I hope these comments provide helpful info to others following this project! Antenna tuning is a science unto itself right?</p>
<p>best tutorial in this series ! thank you !</p>
<p>Much appreciated mate!!</p>
<p>Very good tutorial, well done!</p>

About This Instructable

32,448views

163favorites

License:

Bio: I am robotics engineer and a teacher whose passion in life is breaking down the maths and academic jargon of programming and robotics into something ... More »
More by Robotix_au:Memory Trainer in Python LIGHT SABRE GAME in Sratch Button LED Input/Output Circuit 
Add instructable to: