Arduino Wireless Serial Communication

169,388

133

59

Published

Introduction: Arduino Wireless Serial Communication

About: IT-professional by day, DIY hobbyist (among other things) on my free time. I always have one or more projects going on. Usually something to do with home improvement or a tech project or a combination of the...

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 1: What You Need

  1. USB serial adapter
  2. Two or more Wireless RS232 modules (e. g. EWRF 3022)
  3. Arduino. It's a Nano in the picture but any model should due.
  4. A gadget box
  5. Soldering equipment
  6. Basic Arduino skills

Step 2: Attach the USB Module to the Transciever

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

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

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!

Share

    Recommendations

    • Make it Move Contest

      Make it Move Contest
    • Planter Challenge

      Planter Challenge
    • Oil Contest

      Oil Contest
    user

    We have a be nice policy.
    Please be positive and constructive.

    Tips

    1 Questions

    Hi, I might be few years late but its worth asking...will the XBee modules do the same Serial communication to and from computer and Arduino?

    0

    Hi, I don't know much about the xbee module but I would assume there would be modifications needed. A lot of things have happened after this article was published. I currently don't use this anymore myself. I mainly use different versions of esp8266 instead of arduion. The esp8266 microcontrollers have integrated wifi.

    59 Comments

    Using 2 pairs of Tx/Rx's, can you do two way communication?

    Say I want to:

    "as for data from a pin"

    then have the arduino serial print the result back to the computer

    Thanks

    7 replies

    If I interpret you question correctly - you want to use the command interpreter without the wireless stuff? Yes, that works. See point-to point mode here: https://bitbucket.org/ehsmaes/cmdcallback/wiki/Home

    I may have asked my question in a confusing way.

    Basically I want to be able to run simple 2 way serial communication wirelessly.

    (Example: http://arduinobasics.blogspot.com/2012/07/arduino-...)

    That would require 1 Tx and 1 Rx on the arduino, and 1Tx and 1Rx on the USB/Computer.

    How would I wire them up to have one pair of transmitters send instructions to the arduino, and the other pair send serial data from the arduino to the computer.

    To give some background, I want to make an RC vehicle with lots of sensors. Rather than using a traditional R/C Tx & Rx (like these http://ep.yimg.com/ay/yhst-17210252890263/exceed-r...) which are limited by the number of channels (Move forward/back, Turn left/right, etc), I was wondering if I could communicate with the arduino-bot via data, so I am not limited by number of channels. So I could send commands to it to turn left/right as well as receive data from the sensors in real time.

    Maybe there is a better way of going about this.

    Nevermind, I think I figured it out.

    How did you do it ?
    I want to apply for similar application where I can control my home appliances and monitor their state as well.

    Bought TWO of these: http://www.aliexpress.com/item/Lowest-Price-433Mhz...

    and one of these: http://www.aliexpress.com/item/5PCS-Free-Shipping-..

    Hooking one pair:

    USB TTL Tx pin --> 1st transmitter --> ***air*** --> 1st reciever --> arduino reciever pin

    Other pair:

    arduino transmitter pin -->2nd transmitter --> ***air*** --> 2nd reciever -->Rx pin on USB TTL

    Basically in the image, one Rx/Tx pair is replacing the yellow wire, the other is replacing the blue wire. Then each side will need it's own power and gnd.

    schematics.jpg

    Hey i am trying to do a similar kind of project for my final year of engineering.... And i want to do a project related to home automation where my devices will send data to my pc and the and in return my pc will send instructions to the arduino.... Please help friend

    after uploading my sketch if i disconnect mt arduino from PC and give an external power source to it, will it work? And how can i use received data in an application?

    4 replies

    Your arduino doesn't have to be attached to a PC but for most applications you need to have one arduino+rf connected to a computer in order to control and/or read data from the other arduino+rf units. But I suppose there could be rare situations where it would make sense to have an autonomous system where arduinos only communicate with eachother. If you have such a use case - yes, it is possible. As for how to use received data in an application - that is really hard to answer. It is up to you. It is just data. Use it like you would any other data.

    Hi, i've an arduino nano like yours and the transreceiver module wifi esp8266.What i want to do is to use an Amazon Dash Button to turn on/off a light using a relay attached to the arduino.Is possible?Can you give me some suggestions?!

    Thanks

    you could use a relay or a NPN transitor (should work) to turn of lights but with a dash button seems a little iffy. You could probably make something a little larger with a smaller antena than this but arduino to arduino communication.

    My one arduino with receiver is going to be attached to PC.

    Thanks a lot!

    I plan on using this trick of reasonably long distance serial communication (arduino to arduino) [drone project if you guessed it], so I need to look into if these are very good over distance but overall a big thanks. I can just wire the two arduinos the same as the one arduino in the guide correct?

    can it work in multiple transmitter to one receiver friend?

    1 reply

    I have not had that use case myself but yes, I can't see why not. It should work.

    What wireless module did you use for this? What would you suggest? I would like to be able to turn my Arduino sketch on and off by sending text over serial.

    1 reply

    To be honest. Things have happened since I wrote this. I would now recommend a different solution. Currently I use esp8266 wifi modules with mqtt. Sometimes I use the esp as a communication module to Arduino but mostly as a standalone unit.

    Nice @ sticking component on lcd @video :P