Instructables
Picture of Arduino Wireless Serial Communication
There are many ways to communicate with remote Arduinos. I have found that many of them hit a slightly higher price point than what I would like. Also, ethernet shields (and wifi dito?) consume many valuable hardware pins. I will describe how to communicate host to Arduino using commercially available wireless serial ports. They are cheap(ish) and only use the rx/tx pins. The drawback is that the air-protocol isn't encrypted so I wouldn't use it for sensitive applications. I use it to control lighting. I would be more impressed than offended if a neighbour hacked my indoor lighting. Serial ports (even wireless) are designed for point to point communication. It is possible to use in one-to many or other constellations but certaing design consideration have to be taken. My Arduino library referenced in step 5 supports one-to many.

The described project is for one-way or two-way communication using (i. e. transciever). If you know you will only send commands "blindly" you can attach a transmitter to the PC end and a receiver to the Arduino. Those modules are really cheap.

Step 2: Attach the USB module to the transciever

Picture of Attach the USB module to the transciever
DSC_0128[1].jpg
The VBUS connector on the USB module provides +5v for the transciever. Cross rx/tx lines. See pictures.

Step 3: Fit the modules in the box

Picture of Fit the modules in the box
DSC_0124[1].jpg
DSC_0129[1].jpg
DSC_0132[1].jpg
For the PC-end I added a small enclosure. Drill a hole for the antenna and dremel an opening for the USB socket.

Step 4: Attach the second transciever to the Arduino

Picture of Attach the second transciever to the Arduino
DSC_0134[1].jpg
Attach vcc, gnd and rx/tx (crossed) of the transciever module to the Arduino

Step 5: Load the software

Flash the Arduino sketch of choice, which uses serial communication with a PC.

If you want to write your own interaction you may want to check my CmdCallBack library out. The library makes it easy to link commands with parameter with callback functions in the sketch. I might make a separate Instructable about that.

Step 6: Try it out!

 
Remove these adsRemove these ads by Signing Up
chinmayv1 month ago

Can anyone post some links about transcievers having a range of 1000-2000 metres and their interfacing with Arduino

And does the problem of frequency matching occur if many transcievers are sending their data to a single Arduino

And how can we increase the range of a normal Nordic transciever if the above range isnt available

ehsmaes (author)  chinmayv1 month ago

I haven't heard of any such long range trancievers. I think you would have to play around with directional antennas (maybe some version of a pringles can antenna or parabolic). If you need omni-directional range you would need high powered transcievers which would not be legal in most countries. Countries regulate output wattage. As a general rule, lower frequencies carry longer. There is a range/speed trade-off in wireless comms. In other words, 433MHz devices have better range but at lower throughput than 2.4GHz devices. If you want unlimited range go for a GSM module.

AbDuCt9 months ago
I would look into the Nordic wireless transceivers. they run on 2.4ghz and are pretty beastly chips with a robust feature set like idle/power down/standby modes/auto retransmission/etc. they are only 1.10$ each on eBay when you buy in bulk of 10 units. there is also many libraries which make using them a breeze. I personally program them in assembler most of the time.
ehsmaes (author)  AbDuCt9 months ago
I forgot to ask. Could you link to a couple of the libraries?
AbDuCt ehsmaes9 months ago

https://github.com/kehribar/nrf24L01_plus

http://maniacbug.github.io/RF24Network/

The first is one library and then there is another named Mirf. The second link is a library that allows you to link the transceivers in a binary tree like structure to create a zigbee like mesh network (good for automating a house for example). There are a bunch of tutorials on the internet what shows the usages of the libraries, the general usage is the same as standard file IO in C. There is a READ() function and a WRITE() function and the library does the rest. In assembler the transceivers are also easily controlled if you know how to communicate with them (specific sequence of pins that need to be toggled to tell the module what you're attempting to do, etc). As for range I haven't had a chance to play with them yet, but I know people who can easily cover a pretty standard sized house. One article on the internet said that the NRF24L01+ model does around 200 meters open air. There are more beefy versions, costing 6-7 dollars per transceiver) that include amplifiers and a RP-SMA connector for external antennas to boost wireless gain which boast 1000 meters of range but I haven't seen proof of that yet. I have 10 being shipped to me right now and I am in the process of revamping a colleagues assembler code to make wireless Nintendo 64 controllers powered by an attiny2313. Even if you only buy 2 transceivers to play around with, I highly suggest it.

chinmayv AbDuCt1 month ago

@AbDuct

Could you forward me the link of transcievers which give a range of around 1000-2000 m and if possible their interfacing with Arduino

ehsmaes (author)  AbDuCt9 months ago

I put an order in for 10 nrf24l01+. I may make a version of the command/response library for these if the range is decent. By decent I mean from one end of the house to the other. Maybe a good mesh topology will help.

AbDuCt ehsmaes9 months ago

Nice! Mine just came in yesterday along with my new universal USB programmer for avr/pic/bios/eeprom/etc. Going to go look for my breadboards so I can start playing with these chips. I have to finish reorganizing the macros and functions in my assembler project so I have a dedicated radio library instead of all my code in one file with my actual project code.

ehsmaes (author)  AbDuCt9 months ago
Thanks for the pointer. Are you referring to NRF24L01+ devices? I have been thinking of trying SPI devices. I am guessing the range will suffer though at 2.4 GHz. What is your experience on that?
AaronR21 month ago

Hello,

Great project! I was wondering how I could adapt this to fit my project. I have one mcu that is transmitting serially to another mcu which receives the data so the data flow is one way. The communication would be asynchronous at 115,000bps baud. Can your setup shown here be simplified at all in this case or is there another wireless unit you would consider for such a setup? Low cost is also a concern for me.

Thanks,

Aaron

ehsmaes (author)  AaronR21 month ago
Hi Aaron,

This setup is for two way comms. For the most part, one end would be a server of some sort but it could also be two ardu's where one is commanding the other. However, if you just stream one-way data from one mcu to the other, you could go cheap with something like this: http://www.ebay.com/itm/HSTY-New-1pc-433MHZ-RF-Transmitter-And-Receiver-Link-Kit-For-Arduino-Sca-1710-/221548991371?pt=LH_DefaultDomain_0&hash=item339559538b. You should look for a lib to fit the part. My lib is not built for your purposes. Another cheap alternative could be the NRF24L01+ units referenced in previous comments. Good luck with your project!
AaronR2 ehsmaes1 month ago

Thanks for your help. Can you tell me if I have this correct?

Option #1 (433MHz RF): I can basically cut the wire between uart1 tx and uart2 rx and insert these devices. Also, needs no antennae.

Option #2: (NRF24L01): Uses SPI protocol and cannot be used between two uarts (which is okay I need to learn SPI to use an SD card anyway). Also, needs an antennae.

Aaron

ehsmaes (author)  AaronR21 month ago

Option #1 - I think this will get you started: http://www.instructables.com/id/RF-315433-MHz-Tran...

Option #2: Yes, these use SPI. No you don't need an antenna unless you want to extend range. The ones I have seen have PCB-antennas.

hbagrecha6 months ago
I am working on my project which requires to have a communication between 7 arduino boards. can you guide me to achieve this. currently I am trying to achieve this using Bluetooth but so far I am not even able to communicate two microcontrollers. please Help me.
ehsmaes (author)  hbagrecha6 months ago

It depends. Is every arduino supposed to communicate with every other or is a server responsible for the communication with all? Is range important? I get great range with the wireless serial ports since they are on 434MHz. You could use wireless serial with my lib (https://bitbucket.org/ehsmaes/cmdcallback/wiki/Hom... It supports addressing so you can communicate from one point with many arduinos and potentially many to many (but I haven't tried it). If cost is more important than range, you may want to have a look at the RF24 circuits and lib's referenced in other comments below. I have 10 of them in a box but I haven't started experimenting. I would definitely only attempt to use bluetooth in one-to-one applications. If you will be passing sensitive information between you Arduinos, you should keep looking. Neither solution discussed here is encrypted (except for bluetooth which is bad for other reasons).

ehsmaes (author)  ehsmaes6 months ago

https://bitbucket.org/ehsmaes/cmdcallback/wiki/Home

hexalog9 months ago
Very nice
could you tell me what the wireless range is
and perhaps where you bought them?
thanks
ehsmaes (author)  hexalog9 months ago
The range is actually really good. I think it is rated around 200 meters in open spaces. Of course, I use it indoors. I have no problem from one end of the house to the other. It is considerably better than wifi. The modules I got are from a webshop in Sweden. http://swechtrading.se/zencart/index.php?main_page=product_info&cPath=52&products_id=614. You probably don't live in sweden. This should work too: http://www.ebay.com/itm/CC1101-RS232-RF-wireless-transmission-transceiver-module-433MHZ-/190941834424?pt=LH_DefaultDomain_0&hash=item2c75052cb8. You can probably find cheaper if you shop around.

I might look into SPI units instead of serial at some point. They seem to be cheaper.