To get the most out of this tutorial - it is best to start at tutorial Part 1, and then progress to Part 2 then Part 3 and then do Part 4 last.
Doing the RF tutorials in this order will help you to understand the process better.

If you are looking for a way to communicate between Arduinos, but don't have much cash at your disposal, then look no further.
These RF modules are not only affordable, but easy to use. They are much easier to set up than an XBee,
plus you can use them without the need of a special shield.
Before you rush out and buy a ton of these modules, make sure that you are not breaking any radio transmission laws in your country.
Do your research, and buy them only if you are allowed to use them in your area.
There are a few [OPTIONAL] libraries that can be used to help you and your particular project.

I will mention at this point however, that I did NOT use any libraries in this particular tutorial. That's right. I will show how easy it is to transmit data from one arduino to another using these RF modules WITHOUT libraries.

Also if you are looking for an easy way to record the signals and play them back without a computer - then jump to this tutorial.

Video

Project 1- RF Blink

Firstly we need to test if the RF modules are working. So we will design a very simple transmit and receive sketch to test
their functionality. We will use the Arduino's onboard LED to show when the transmitter is transmitting,
and when the other Arduino is receiving. There will be a slight delay between the two Arduinos. You can solder an antenna onto these modules, however I did not do this, I just kept the modules close together (1-2cm apart). I also found that I was getting better accuracy when I used 3V instead of 5V to power the receiver. While using 5V for VCC on the receiver, I would get a lot of interference, however with 3V, I hardly got any noise. If you find you are getting unpredictable results, I would suggest you switch to 3V on the receiver and move the transmitter and receiver modules right next to each other. Remember this is just a check... you can experiment with an antenna or a greater distance afterwards.

Parts Required

The Transmitter and Receiver Fritzing Sketch

The Transmitter

The transmitter has 3 pins,

Notice the pin called "ATAD". It took me a while to figure out what ATAD stood for, when I suddenly realised that this was just a word reversed.
It should be DATA (not ATAD). Nevertheless, this is the pin responsible for transmitting the signal.
We will make the Arduino's onboard LED illuminate when the transmitter pin is HIGH, and go off when LOW as described in the following table.

The Receiver

If all goes to plan, the onboard LED on this Arduino should light up (and go off) at the same time as the onboard LED on
the transmitting Arduino. There is a chance that the receiver may pick up stray signals from other transmitting devices using
that specific frequency. So you may need to play around with the threshold value to eliminate the "noise".
But don't make it too big, or you will eliminate the signal in this experiment.
You will also notice a small delay between the two Arduinos.

When a HIGH signal is transmitted to the other Arduino. It will produce an AnalogRead = 0.
When a LOW signal is transmitted, it will produce an AnalogRead = 400.
This may vary depending on on your module, and voltage used.
The signals received can be viewed using the Serial Monitor, and can be copied into a spreadsheet to create a chart like this:

You will notice that the HIGH signal (H) is constant, whereas the LOW signal (L) is getting smaller with each cycle. I am not sure why the HIGH signal produces a Analog reading of "0". I would have thought it would have been the other way around. But you can see from the results that a HIGH signal produces a 0 result and a LOW signal produces a value of 400 (roughly).

In tutorial 4 - we use the information gathered in the first 3 tutorials and do away with the need for a computer. We will listen for a signal, store the signal, and then play it back by pressing a button. Similar to a universal remote ! No libraries, no sound cards, no computer. Just record signal and play it back. Awesome !!

If you like this page, please do me a favour and show your appreciation :

188 comments:

Nice!!!One question.... Say I wanted to boost the power on the Transmitter so the wave can penetrate a wall or some soil (like a planter box) how would I do it?Is it possible?Alright, I suppose that's two questions.One more....Is the frequency of 433Mhz too high of a frequency for Soil penetration? Should it be lower?Thanks for the help, and your time Scott.

Hi Rob,Your questions are way above my level of expertise.... I am by no means an expert in this field... However, I was able to transmit to the fan/light from another room. And from my quick search on google, I would say that the frequency is too high. You would have better success with lower frequencies. As for transmitter power, you would see what voltage you could apply. I found that a greater voltage gave me greater distance, however, you would have to look at the data sheet to see just how high you can go. Not sure why you need to penetrate the soil, would it be possible to bring the RF module up/out into open air?

Hi Scott,Thanks for the reply! I managed to connect a Home Made Yagi to the Receiver Module and received good results. The Yagi is built for a 433MHz Band, and is a Directional Antenna opposed to an Omnidirectional, so the energy transmitted/ received is directed.The Gain is 7.1DB, so the Band is still wide but still focused, this way more distance can be gained with lower Transmit Power.So far I've learned lots from this project, I have more notes on my website if interested.Thanks for the help Scott.let me know if you want the link.

That is cool. I could not tell if you managed to get it to find gold or silver ?I could not tell from the results at the end? Did it work ?Anyway - I thought the project concept and idea was brilliant.If I get time one day - I might try to replicate your project myself.

A 2 second google search suggests that the maximum voltage for the transmitter is 12V, and the receiver is 5V. But it would be best if you check the datasheet or ask your supplier for that information, because you cannot always trust google.

I think the author has misunderstood and the "Data" pin they are using is actually a RSSI (signal strength) pin. The real "Data" pins on these devices always put out digital signals and you don't need the ADC to read them.

Thanks Anonymous. When I made this tutorial a while back, I had no idea how this module worked, so I used a bit of trial and error to help me understand. You can tell from the signal pattern that the output is digital, the analog pins help to confirm this.

But I would like to know a bit more about your statement that the "data" pin is actually a RSSI pin.How is the signal strength determined from this pin, and how is it that I can transmit "Data" through this pin? Please elaborate, as I would like to know more about how this thing works.

Hei, thanks for your nice tutorial. I was initially thinking about bluetooth communication between two Arduinos. How is it different when you use 433mhz rf module? (I know that you don't kneed a shield...)

433mHz modules can have a longer range if you choose to use a wire antenna.I would say that using RF is easier than Bluetooth, however it depends on what you are trying to do. If you are trying to communicate between one Arduino and another, then I would personally choose the RF option. If you want to control an Arduino with your phone, then I would choose Bluetooth. It really depends on what you are trying to do and the maximum distance required between devices.

On my receiver the LED is constantly on and only goes off for a very short period of time (20-21 values in the serial monitor) when the transmitter starts to send.

I tried different RF modules and arduino boards but it is always the same behaviour. The transmitter and the receiver are very close to each other (about 1 cm).

My frequency counter (from gooit) shows a frequency of about 433.9MHz during the hole sending time of the transmitter and the LED is constantly on while the transmitter sends and constantly off when the transmitter does not send. So the transmitter should work well.

Check to make sure you are not near an interfering source. Keep the receiver away from other electronic items. You may want to try a transmitter and receiver of a different frequency (e.g. 315 MHz) - depending on where you are in the world, I think the 315Mhz frequency is more common in the USA...

Hi Scott,i have a 17 dof robot controlled by a torobot usc32 servo controller, running the torobot software through a usb cable. i have two arduino megas and the FS1000A tran/rec. i have fitted one mega to the robot servo controller,arduino tx to controller rx, a common gnd plus power to each, could you show me a mod to your sketch to run the servos through the FS1000A tran/rec. cutting the usb cable out of the picture.thanks Scott,regards Peter.

Hi Peter,Thank you for your question, but these requests are best served on an Arduino forum.I get many requests for help, and either don't have the required experience or the time.You will find the forums much more useful.

Hi Scott, a very clear tutorial. I understand you are tight for time, but I wondered if you thought it was possible for the LED connected to the receiver to get brighter after each signal from the transmitter?

Not sure what you mean... but if you are asking if the RF modules will still work without the Arduino boards, then the answer is no.

If you are asking if the sketch will still work if you disconnect the Arduino boards from the computer, the answer is yes and no. Yes, the code will execute, but there are Serial commands which will be useless. But you could write the signals to an SD card instead, or use some other method to capture the signals ??

I have no experience with the virtual library. However, my advice would be to start with the basics. Start small, and get the basic functionality working. Then start adding complexity step by step.Right now, you have so many places where your sketch could be failing, so go back and start with a simple sketch and then go from there.

I am working on a project-sign language translator.So I am using flex sensors to gesture various alphabets.Thus I need to transmit these alphabets wirelessly and display them in another ARDUINO UNO.Could you help me with the coding part for transmission and reception ?RF module:WX-TX-01 and WS-RX-02.

Thank you Scott for the nice and helpful tutorial.Can we use this device for two way communication? So the reciever will send back the data to the transmitter after reiceving it.I need to measure time interval for the data transferring between them, to see how fast and how much packet size can be send.to know about the maximum data and speed.

Hi Nabeel.You would need two transmitters and two receivers to have two-way communication between two arduinos. The receiver module only receives - it does not transmit.If you want a module that transmits and receives - you will need to search for a "433Mhz transceiver".

As for the speed and packet sizes that can be sent on the modules that I have - I am afraid that is beyond my knowledge level, and you would have to research the datasheet for that one.However, I have read that the success rate of data transmission between Arduino's can be hit and miss (especially as the distance increases). Some people get really frustrated, and spend quite some time trying to sort this out. As you can see from my 4 tutorials on these modules, my end goal was to copy the RF signal from my RF remote. And it worked very well for this project.

Hi Wesley,I am not sure how sending a code will eliminate noise. My guess is that the noise will still be there.

Have you looked at the VirtualWire or RadioHead library ?http://www.instructables.com/id/RF-315433-MHz-Transmitter-receiver-Module-and-Ardu/?ALLSTEPS

http://www.airspayce.com/mikem/arduino/RadioHead/

If these do not help and you want to start from scratch, then you could look to send a code to the receiver, but I would send it multiple times and maybe with some sort of checksum method to ensure that you have received all the data. The trick is how do you let the transmitter know whether you have been successful or not in receiving it's message.

Hard to know the best way to tackle your issue without knowing your setup/layout/requirements/equipment etc etc. These problems are always best served in a forum.If you need further help - then either post in the ArduinoBasics forum - in the section called "Help me with my project" - and I will try my best to help you when I can. But if you really want some good help, then look to the Arduino forum

Hi Colin,Post your query in the ArduinoBasics forum in the section "help me with my project".I get a lot of requests for help, and will try my best to help you in some form or fashion.But please do not expect me to write out your code for you. You will have to do most of the work/research/coding yourself. I will give advice or guidance where I can.If this is not suitable, then I recommend the Arduino Forum.

Hello Scott,Thanks you for this nice tutorial and the help that you provide in comments.I have a Raspberry Pi, 2 ATtiny85 and the same 433 Mhz reciever/emitter as you.I can programs my 8Mhz ATtiny throught the Raspberry with arduino libs (it works fine for blink led or Serial.println("Hello") with the raspberry at 2400bps) but when I use your program or other "Virtual wire" program found on the web it not work at all...The reciever analog value is extremely noisy (0, 100, 600, 32, 200, ...) where ever I am. And whatever I send with the emiter 1 or 0, it dosent seem to affect the reciever.Technicaly, both reciever and emiter VCC are plug on the 5V GPIO of Raspberry. GND on Raspberry GND and data each on a pin of one of the two Attiny85.Do you have any idea of the potential mistake ?

And could you please tell me if it works for you if you do this scheme without microcontroller or Arduino :Emitter VCC (5V) GND (GND) DATA (5V)Reciever VCC (5V) GND (GND) DATA (resistor -->LED --> GND)Led must be ON 100% of the time, right ? (in my case led blink randomly)

And Emitter VCC (5V) GND (GND) DATA (GND)Reciever VCC (5V) GND (GND) DATA (resistor -->LED --> GND)Led must be OFF major part of the time (noise) , right ? (in my case led blink randomly)

Hi Damien,I am not sure what you mean that when you use my sketch, that it does not work at all?What doesn't work ? Are you getting high and low signals ? How is it that you can get a blink sketch to work and not this sketch (which alternates the high and low signals like a blink sketch).Also, when using these modules, I too experienced some interference and noise. So I reduced the voltage of the receiver to 3.3V. I think the noise issue is a common one with these modules - plus it also depends on where you live. You may need to opt for a different frequency depending on your country. From what I have read, and from what I have noticed, is that people are trying to use them in a way that is different from what they were designed to do.When I transmitted signals from my remote control to my receiver, I had no issues. When I transmitted that recorded signal to my fan's receiver, I had no issues. But sending a high value or low value for an extended amount of time, seems to cause issues. So rather than try to see if it is working by sending a continuous high or continuous low signal... try sending a sequence of highs and lows in quick succession, and repeat this signal a number of times.I might try and write a tutorial to explain this better, but it won't be for a couple of months, because I am in the middle of some other projects.

Thanks for your quick answer, I'm from France.When I talk about "blink" it's just to say that I succed to program my ATtiny with the "hello world" program for a microcontroller : flash a LED on a pin...So when I use your program my LED flash very quickly without any reason... (Same effect if I disconnect the emiter, and same effect if I connect the LED directly to the data of the receiver). So I get high and low signals but randomly.So I will try to turn ON and OFF the emiter quickly, witch delay do you advise me, 200ms ?I will try also to reduced the voltage of the receiver to 3.3V.Can I do something on these modules to change frequency ?One more important thinks... I am not using antenna because module are 5 cm far away and I am not very good with soldering iron. Do you think it could be the problem ?

Ok - I understand.Instead of modifying the frequency of the module, I meant for you to get a different frequency module to try out (eg 315Mhz or something else)... but not sure if that will help you or not.You will get interference on the receiver due to the variable gain. You might benefit from reading this site.However, I overlooked that you were using an ATtiny. I don't have one of them and have never used one of them. Do you have an Arduino UNO that you could use to test the RF modules ? This may eliminate some of the guess work you are doing at the moment???And I just read this blog post from a person who might be having the same problems you are - and my guess is that you might want to reconsider your choice of microcontroller.

If you want to communicate between the two modules at a distance greater than 5cm, then yes - I would highly recommend for you to use an antenna on the receiver. My transmitter was able to transmit a signal to my fan at quite a distance without an antenna, however if I were to add an antenna, I am sure the distance would be greater.

As for the the amount of delay to choose... I would say, start low (20ms) and then increase it. If you have a potentiometer or button that you can use to modify the time in your program, it will save you the hassle of uploading and re-uploading for every change in time.The serial monitor is also very useful for this type of troubleshooting.

All works fine !Problems was :My first ebay receiver was broken (maybe my mistake :-) )Second, the antenna is mandatory... without, even few centimeters, it not work at all.I have bought it here : http://r.ebay.com/zyjuge 10 for 1.5 € delivery fee included.

Good to hear that you got it to work. I have heard a few people mention that their receivers did not perform, however when purchased elsewhere it worked fine (like you have just experienced)... I think there must be a quality issue in manufacturing these cheap devices.

Hi scott c , I highly appreciate your video , i have used the same code but including the virtual wire library to it and i have use one arduino uno and an arduino mega the code did compile everything but at the it didn't work . well i need a bit of help , can you guide me how i can use RFID to trigger an servo onto another arduino , your guidance would highly be appreciated.

here is it possible to catch a signal if the distance is 10m?we are going to transmit different data signals from several transmitters? These data signals should be caught by one transmitter. one proper data signal is enough to be caught from one transmitterHow should i do that?Please Help..!!Thank you

Hi Niranga,I assume you mean to catch the signal using a receiver ?Is it possible to catch a signal if the distance is 10m? The answer is: it depends.

It depends on: 1) Frequency being used. 2) Objects/walls/obstructions or clear path 3) Antenna being used or not (on transmitter and/or receiver) 4) Signals being sent at different times or at the same time 5) Strength of the signal being transmitted (ie. power of the transmitter) 6) Length of the signal being transmitted 7) Interfering signals from undesired sourcesI am sure there are other factors, but I think you get the point.

How should you do that? First try with one transmitter. If that works, then try more.Please help: well I'm not sure if that helped, but my tutorials might. Try them and see how you go.

Hi,Quick question, what's the point of the rolling LOW signal value, are you experimenting with some sort of analogue signal or just seeing how it reacts? (it seems overly complex for the simple on/off scheme I thought it required).

How do you handle the clock speed of the signal? it seems like you would need to make sure that RX and TX devices both clock bits out at the same speed?

This was just an experiment to test the transmitter and receiver.Without really knowing how these modules worked, I thought that I would just send a signal using the transmitter and just listen with the receiver to see what would happen.By sending a typical blink pattern, I noticed that when I sent a high signal, the receiver would provide an analog reading of zero, and a low signal would produce an analog reading of around 400. This seemed very anti-intuitive to me. So then I thought, maybe there is a delay, and that the high signal is actually producing a value of 400 ?? So how could I test this ?? I decided to change one variable - and keep the rest constant. I changed the duration of the low value, and kept the high value duration the same... and you can see the results in the chart above.... My end goal was to receive a signal from my RF remote (store this signal), and then play it back. I managed to do it in the end, but you have to read the other tutorials to see how.

Hi Suli,You may get some noise with this sketch. The Receiver will increase it's gain automatically until it receives a signal. So to reduce noise, you should transmit at a faster rate or perhaps change your location and move away from interfering signals.

Hello! Thanks for your tutorial! I´m kind new with arduinos, but I was thinking of using just one arduino with the transmitter, and none with the receiver. The receiver would simply connect to a led, and depending on the information that arrived it would blink or just turn on and off, for example. Is that possible? Thanks in advance!

If I only had one arduino, I would do it the other way around. I would transmit without the Arduino and attach the receiver to the Arduino. I am not sure if the receiver would be able to drive an LED... it might be able to, but I haven't tried. I guess it depends on what you are trying to transmit, and why you would want to do this?

I´m trying to communicate wirelessly a pushbutton to an electric toy. But I wanted the pushbutton to work under different modes, for example working while pressed, or starting to work when pushed, stopping x minutes later.... But I´m not sure if the receiver would receive that information if i don´t use an arduino...

As you can see from my tutorial, when you apply voltage to the transmitter, the receiver will respond accordingly. If the electric toy has an RF receiver built in, then I would use the Arduino on the transmitter side. If you wanted to trigger a push button on the toy, you could possibly do all of this without an Arduino altogether, however, you may get false triggers through interference. While my tutorial makes it look like the receiver will only trigger when the transmitter sends information, this is not true. It will also trigger when it picks up stray signals from other devices or electrical equipment. I don't think these modules were designed to work in the way you imagine it to... as the receiver will increase the gain and become more sensitive to stray signals if it hasn't received anything for some time...So I personally think you would need two Arduino's for this to work properly, and you would have to send a sequence of commands which the receiving Arduino would have to interpet, decode and then act in the way you want it to.

Thanks for the tip, however, can you explain how your modification would change the outcome?For example, if data=0, both statements would triggerIf data=40, neither statement would trigger...

If I were looking to eliminate noise, I would modify the range of the upper and lower Threshold values, but I can't see how your modification changes anything?? Maybe I am missing something? But I am interested in what you have to say.

Hi Sergio, As per the manufacturer website, it appears that it needs at least 3.5V, but normal operating voltage is 5V.Having said that, I found that the receiver worked fine at 3.3V, the transmitter may be a different story.

Can you please tell me if we use multiple transmitters to transmit a signal to a single receiver can there be any interference or data loss? can you give me an idea about how many channels are in transmitters and how they work in an above mentioned scenario ?

The receivers are indiscriminate. Meaning -> If you send a signal at that frequency, it will receive it. It will receive stray signals from other sources also... So if you you are using multiple transmitters, you will need to ensure that they are not transmitting at the same time or are using different frequencies..... similar to a walkie-talkie.If you are transmitting at 2 different frequencies, you will need 2 matching receivers.

Can there be data loss - yes - of course... there can be data loss even with one transmitter.Will it get worse with two ? Depends on whether the signals over-lap or not.

Thank you very much for the information. This means a lot to me i also want to know that is there a specific number of channels in the transmitter. I saw somewhere that there are 4 channels. if there are channels. so transmitters can use different channels to transmit. Am i right ? (I'm not sure)So if i transmit the signal with different delays in different transmitters. Will it solve the problem ?

I don't know anything about the number of channels. You would have to ask the site where you read that... I am guessing there would some additional hardware required, but that is just a guess. With regard to the delays, I am not sure what you are doing or how you are hooking these transmitters up? But as long as each transmitter transmits their complete signal un-interrupted by any other transmitter/signal you should be fine. The way that you choose to do this will depend on your particular set-up and personal preference.

hi scott i want to a project on arduino which sends the alert message when the sensor senses the object via rf module to another arduino which sends the alert message to java front end application on computer

Hi Vishal -This particular tutorial is not geared towards that kind of communication.If you would like help with your project - please post your question in the ArduinoBasics forumI don't have time to write code for you, but I am happy to point you in the right direction.Just post your circuit connections and your code to the forum - include pictures (<2MB) if you like... and I will guide you...

it didn't work for me , i had tried changing the value of the upper and lowerThreshold value. while the transmitter led lights up , the receiver will receive messy data and start to blink crazily , sometimes it will start blinking even though the transmitter if OFF. what should i do :(

These Receivers are very sensitive to noise. They will increase their gain until they receive a signal. You could try to connect it to a digital pin instead of an analog pin... also you want to transmit data as soon as possible, to limit the amount of noise.

Try powering the receiver using 3V instead of 5V. This also helps to prevent noise.Also reduce the delay value to a number that is smaller. These receivers were not really designed to undergo this blink sketch that I designed... they are better with a much faster rate of data transmission.

I have a problem in testing my Rf Trans. and Rec. I followed your connections and used your code. On my transmitter Arduino the LED blinks as programmed. But in my receiver the LED just keeps on blinking randomly, the Serial monitor shows 0000703301700000704701470000

And goes on. I tried turning off my transmitter Arduino and no changes were found in Transmitter side, Then i tried removing the data pin(A0) of transmitter the LED was stable, connecting if back i removed the power wire(vcc) of transmitter and LED went off. What is the problem?

-> I checked the connections, no wiring mistake was observed -> Codes are same as yours-> The trans. and rec. module is brand new from ebay.-> The distance between trans.and rec. is less than 1cm

Hi B.Aswinth Raj,You may get some noise with this sketch. The Receiver will increase it's gain automatically until it receives a signal. So if it blinks as expected while using the transmission sketch, that is all you need at this point. It just checks to make sure that you are able to transmit and receive. Continue onto tutorial # 2.

I've found that using a 9V battery pack opposed to using the USB cord show different observations. When the USB cord is plug into the receiver, the LED blinks at a constant rate different to when the 9V battery pack is plugged into the receiver.

Any thoughts on this?

I've tested the code and found, at least to my speculation that everything in the code is ok.

Hi.I have a Mindwave headset from Neurosky.It comes with a USB RF dongle and by using a software you can check some brain activity on the computer.I don't have the dongle anymore so i want to use an RF module.I would like to know which RF module can work with this Mindwave headset so that i can directly connect it to an Arduino without using a computer.

I wont to connect two Rf transmitter to one Rf resever !! Every transmitter is connected to button.. and the recever connected to the arduino .. and the arduino connected to the lef...One button is On a d the other is off...How can i do that ??? Help please

I don't think I understand what you are trying to do ??Do you want the Receiver to turn an LED off when it receives a HIGH signal ? Or do you want it to blink when it receives a high signal ? What happens when it receives a low signal? What do you want it to do then ? Or will the signal always be HIGH? If you could explain a bit more, maybe I might understand.

I would send a combination of highs and lows very quickly. Or I would actually transmit a number or letter repeatedly.If you do not receive the expected signal or letter or number within a specified time-frame, make the LED go high.

It's weird how your analogRead function works. I'd think you should get a value between 0-1023 since the arduino ADC has a 10-bit resolution. Of course, maybe for the HIGH state you're not gonna get 1023 but at least anything north of 600. I don't know why you get a 0 reading. Interesting!

Is the output of the data pin on the receiver side (in terms of power) proportional to the power received? I ask because you are using analogRead, and if the receiver had some type of symbol detection I'd think you should get a clean 0 (0V) or 1 (3.3V) and there shouldn't be a need to read that with analogRead. Also, since the arduino UNO by default uses a 5V reference for its ADC, the max value using analogRead should be 676 since your receiver runs off a 3.3V supply. And it is weird how HIGH is read as a 0 instead of something more like 500.

Hi Sixto,When I get some more time, I will be revisiting this project. I don't know why I get inverted values for highs and lows when transmitting really slowly. I think when transmitting a signal in the correct manner, the readings should be as you would expect them to be... And I used analog readings out of curiosity. You could use a digital read if you wanted to. This was all just an experiment / proof of concept - and it seems to work :)

Hi ! thank you for the tuto ! here is my probleme, I'm trying, by using your first two programs to transmitt not an analog signal but int, I'm working on a project that transmit the values of a ECG and I'm wondering what is supposed to change in the programs. Thank you for this help (and sorry for the bad english ^^).

Hi Anonymous,One day I will get around to using this module to transmit values to and from an Arduino... but that is a whole other tutorial. There is no way I am going to try and do that in these comments. My advice is to treat the module like you would if you were using a piece of wire to communicate between arduinos, and use serial communication to transmit between the two. I am sorry - but that is about as much detail that I have time to give you... I am sure others on the internet have done what you are trying to do... but the method used in this tutorial is not the one I would use for your project.

What a great tutorial for such a useful set of tools! Well done! I'm doing this in C but I find most of the C tutorials are generally written by people who are full of themselves..haha. What a breath of fresh air!

Scott C's tutorial, this tutorial and the gold scanner tutorial linked above are some of the most level headed no nonsense nicest cleanest MCU tutorials I have come by!!! This topic is so crucial to MCU projects but never properly addressed. I couldn't find the datasheet for these rf links online and luckily landed here. Having gone the C route I often find only salty high horse C programmers who shoot down questions that are asked because of lazily written tuts. You all are what makes this stuff great! Bravo guys!

You could set it up so that the one Arduino transmits and also receives. However, you would need to have a system whereby the Arduino would need to know when it was expecting to receive information. But it could be done. Just take it in turns transmitting and receiving. e.g Send message, await for acknowledgement. If timeout - send message again. etc etc.If you are asking this question to see if you could transmit a message to itself - then I would say there is no point in doing this. Can it work for different frequencies - well - in the parts section, I did mention that this should work for both the 433Mhz and 315Mhz frequency. I have not tried it with the 13.56MHz frequency - but perhaps if you do, then you could let me know. But the transmitter and receiver pair need to be at the same frequency.

I m having trouble with blinking that is by the noise I cannot get what I want to have... I m transmitting something and I m getting it but these noise are making my output rich of errors.. I have tried alot of codes but still I m bot satisfied... Plzz help me out ..

Hi Chris - when you say you get readings less that 10 - is that with or without the LED connected to the data pin?

If you have it set up in the same way that I have - then there are 2 possibilities:a) The type of module you are using is different from mine.b) Possibility of faulty module.c) Double-check ALL of your connections

How are you powering the Arduino?Are you using an antenna?Distance between transmitter and receiver?Frequency of the module? Does transmitter frequency match that of receiver?

Not sure if hooking up an LED directly to module would work. Depends on the LED and your specific module - any reason why you need to do it this way - as opposed to the way I describe in this tutorial ?

Thats less than 10 without an LED.Arduino is powered off my MacBookNo antennaTransmitter/Reciever distances are (furtherst at the other end of a breadboard, or on top of each other at the nearest)433MhzThey were bought as a pair so I'd assume they'd match.

Im not bothered about the LED, just the reading back in to the Arduino sits low.

Hi Chris,Sending very long LOW and HIGH values as I do in this tutorial is not exactly the best way to test the module. Try to perform a serial transmission (using SoftwareSerial) from transmitter to the receiver, and see if you are able to accurately receive what you sent.Make sure to consistently send values in an endless loop.I think this would be a better test.

The receiver module has an automatic gain... so if it is not receiving anything, the gain will increase and increase and increase, until it starts to get false positive readings. The best way to test the module is with rapid on/off cycles, with very short delays inbetween. One second delays between on and off, are way too long, despite what you see in the video. These modules were not designed to be used in the manner I have shown in this tutorial... but work well when the delays between HIGH and LOW are much faster (as you will see in tutorials 2-4 in this series)

Very nice tutorial! However, I tried using an ARM MBED board on the transmitting side, where the "high" voltage is only 3.3V. (Your code is easily translated into ARM code.) All I get on the receiving end is noise. Is it the case that the transmitter transmits only rough "high" and "low" signals and that an input of 3.3V for a high is not enough? Or does the transmitter transmit analog levels? Thanks!!

Hi Vitit,The transmitter is transmitting a digital signal, and there are a couple of reasons you may be getting noise.1. Make sure to use an RF module that is suitable for your country. 2. There may be many devices around you using that frequency.3. Electrical interference.4. An antenna should help5. Make sure that the delay between high and low signals is small. The longer you have the device in HIGH/LOW, the more likely that you will get interference creeping in. In this tutorial, I should not have started with a delay as large as that. It would be better if I used PWM (Analogwrite) instead. It is recommended to use 5V on the transmitter. An optoisolator breakout board may be useful here. You can some relatively cheaply from ebay.

The for-loop provides a constant high signal and a variable low signal. This helps to differentiate one signal from the other.I would probably set up this experiment differently now, but it seemed to work fine back then.

Thanks for your tutorials! They were very helpful for my project which interfaces my Byron SX doorbell to my Synology NAS and triggers an email/photo to be sent when the button is pressed.

Using this RF Module connected to an arduino Uno I 'listen' for the doorbell to be pressed. Once the Arduino recives a pressed signal I use an esp8266 running ESPEASY to send a message to my Synology NAS on which I am running Domoticz. I also have a security camera running on my Synology NAS and when Domoticz receives a message to say the doorbell has been pressed it captures an image from the camera and emails it to me.

The Byron SX doorbells work with a 42 state code (ie 21 high pulses with 21 low pulses separating them). This code is transmitted perhaps 12 or so times every bell push. During this time I am able to capture the code perhaps 6 or so times processing it on the fly. I also have a button on my Arduino that can be held down at power-up and the Arduino then enters a learning mode, looking for the doorbell pattern to be repeated. This makes it easy to learn new bell push codes(which are generated whenever a battery is changed of a different tune on the bell is chosen). The newly learnt code is than stored in the Arduino eeprom and is used as the key when listening for bell pushes in future.

I run the receiver from 5V as 3.3V only gave me a range of 1 to 2 metres. When running it on 5V I can receive a good bell press pretty much anywhere in the house or garden.

Interesting your decoding of byron doorbell, could you point me out the library that you used? Or is it a code from your work?I'm working on a gateway that integrated different wireless signals with mqtt (openmqttgateway) https://github.com/1technophile/OpenMQTTGateway and one user asked if Byron doorbell could be added to the gateway. I found your comment and was asking myself how you decoded it.

Hi FloI don't use any library functions.My code is a development of the code and technique used in these tutorials.Basically on power-up I look to see if the 'learn' button is pressed. If it is I read the RF module and look for repeating codes (the doorbell push sends the same code around 12 times every time you press the doorbell). Once a repeating code is found I store this in NVR. Then the arduino continuously scans the RF module for the pattern. If it receives a matching code the WiFi module sends a message to my Domoticz server. I have spent some time recently playing with the ESP8266. If and when I get time I plan to port everything over to the ESP module and have it do all the work, rather than use the Aduino.My code could really do with a good clean-up, but your quite welcome to have a copy of it.

Getting stray signals in the receiver is not uncommon. Stray signals come from everywhere. Try sending a PWM signal instead. And see how you go. You may want to have a look at my review of the EspoTek Labrador whereby I do a bit more investigating of these RF modules. It may help you understand what is going on.

Do I think it is possible that this was the reason for your issues or do I think it is possible to have one Arduino be responsible for transmitting and receiving ?

The Arduino does not multiprocess, so if you plan to receive messages while at the same time send messages, then probably not possible. But if they can occur one after the other, then I cannot see why not.

Problems associated with your particular project are best served in the ArduinoBasics forum. These comments are only really meant for questions about this specific tutorial.

I can't get his transmitter/receiver pair to work - bought 6 pairs and nothing. I have used the code exactly as above and when I directly wire the transmit pin of one arduino to the receive pin of the other - I get the correct behavior. However when I try to use the transmitter and receiver - the receiver either gets low values 0-5 or random noise (values of 500-800). It's not a matter of threshold (as I've now removed that bit of logic and am just inspecting raw receive values via serial monitor). The receiver behave does not change - regardless of what the transmitter is generating.

I tried as-is and then with antennas soldered on (~ 10 inches). Both the transmitter and receiver are within 2 inches of each other. I'm not an Arduino expert - but I've built quite a few projects without trouble... Any suggestions?

I have had it work really well connecting things to the tx and rx pins on the uart. It does not seem to work over 4800 bps though. You need to put the data into a frame of sorts (i used 16 bytes) and add a checksum, because they will constantly receive random data. I used 20cm pieces of wire for the antenna and got well over 30m range. If you are just interested in testing them, hook them directly to 2 usb-ttl adapters and open up a serial terminal on 2 laptops.cheers

I am trying to setup lesson 1 and have followed all your direction, and I'm fairly sure the receiver part isn't working.I have two UNO boards attached to a Paspberry PI 3 and am using the Arduino IDE.When I upload the two sketches, the transmitter seems to work, (TX flashing) but on the receiver board, just the on and blinking lights.Whe I upload the sketches, I get a stk500v2:ReceiveMessage (): timeout and getsync() timeout errors.In the lesson it was supposed to be lib free so I am not sure where the stk500v2 is coming from for starters and am not sure if anything needs to be done to ID separate UNO boards. Is there anything I have to configure to use two boards. How does the sketch know to load on on one board and not the other. I am fairly new to this but not programming or electrical engineering so any info would be helpful.Thanks

Amnot familiar with uploading code from a RPi3 to an Arduino. Not sure if there are any special considerations. Do you have both Arduinos connected to the RPi at the same time ?Can you upload to each Arduino independantly. ie. Only connecting one board at a time ?

I love your blog and how you present it. In this tutorial, I'd like to know more about RF, and how do RF receiver and transmitter work. I wonder if you know any source or book that relate to RF for beginner like me. Thank you so much.

I am trying to create an infant security system that will allow the mother to know the location of her child if he gets lost. So I wanted to ask if the radio frequency would allow the mother to track the child if he goes missing by transmitting gps coordinates using a gps module I have? Plus the maximum distance the radio frequencies could reach (I'm talking about 7-8 km)?Thank You

Using a library - you may be able to accurately transmit GPS coordinates, however 7-8km is unlikely with this particular module.If you had an antenna properly configured etc, you would probably not see ranges above 1-2km. I might be wrong about that, but that is my understanding of this module.

Yes - that is normal. The receiver has an automatic gain, that will cause it to pick up stray/random signals. Once you start transmitting with your transmitter, the receiver will "lock" on to the transmitting signal. There is still a chance that it will pick up stray signals, but a lot less likely than when there is actually a signal being transmitted from the transmitter.

Yes - that is normal. The receiver has an automatic gain, that will cause it to pick up stray/random signals. Once you start transmitting with your transmitter, the receiver will "lock" on to the transmitting signal. There is still a chance that it will pick up stray signals, but a lot less likely than when there is actually a signal being transmitted from the transmitter.

Thank you for the tutorial. I watched the same implementation in the arduino rfid, however, I tried to get this running with a different RF ID card without success. Do you know if there are many different types of cards and if the "newer" standards are more difficult to read or require different hardware?

Hi, I would like to use something more compact like only the microcontroller chip rather than an Arduino UNO with the receiver and transmitter. So, could you please tell me if it's possible to program an ATmega328 microcontroller with receiver and transmitter for the Project 1 instead of the Arduino (complete system) in order to make the project more compact, while having the same communication between receiver and transmitter in the end?Thank you

The ATMega328 is just the processor that is used on the Arduino and it can be used on its own with minimum auxiliary components. Search for ATMega328 on YouTube for examples. If you want a smaller system the code will run on an Arduino nano. I now have my doorbell repeater code working on a Wemos D1 Mini, and could run it directly on an any of the esp8266 modules that have access to the analogue pin.