Wireless Communications with Arduino
I’ve worked with several types of wireless communications associated with microcontrollers (namely PIC and Arduino), and I found it interesting to write down some of the things I’ve learned about each type I used to help those looking to implement wireless communication solutions with microcontrollers.
Before diving into technical details, I’d like to share a couple of thoughts on what led me to write this guide.
Firstly, even with little technical development on this subject, and without any lines of code to try turning an LED on and off remotely, I believe it is much more important to retain the information below before embarking on a concrete project. For example: What are the most common options for wireless communication with Arduino or PIC or others?
(assuming you already master basic techniques with microcontrollers)
Secondly, I realized the importance of this through a client who requested a project where the specifications are still vague but is very determined when he says, “I want the best xpto technology and price is not an issue.” How do I explain that sometimes the best solution is older and cheaper? It’s essential to analyze the pros and cons of each option and choose what best suits a specific situation.
IR (Infrared)
Infrared communication is quite common in our homes, in virtually all appliances that work with remote control.
It is a unidirectional communication (using a transmitter and a receiver) that must work in line of sight, meaning there cannot be objects blocking the view between the transmitter and receiver.
This type of communication is excellent if we want to make our own applications to control household appliances with microcontrollers.
Advantages
- Possibility of controlling appliances without any intervention or alteration in the equipment.
Restrictions
- Unidirectional communication
- Only works in line of sight
RF (Radio Frequency)
Several types of communication described on this page are radio frequency communications, but in this case, I intend to present some very economical and useful modules for unidirectional communications, just like infrared communication but with the advantage of not having to work in line of sight.
These modules are usually available in two different frequencies, 434MHz (EU) and 315MHz (USA).
These modules are particularly useful for using microcontrollers with home automation systems, as they typically work in this frequency range.
Pros
- Easy connection with most microcontrollers.
- Radio wave communication, no need for line of sight.
Cons
- Unidirectional communication
Bluetooth
Due to its price, availability, and ability to interface with various devices, this can be an excellent solution.
The most affordable and commonly available Bluetooth modules are usually constructed in a way that makes them very easy to connect to microcontrollers. Generally, four wires are enough for a serial port connection, with two wires for power supply. Additionally, you can communicate with mobile phones, tablets, or computers with this resource, allowing control over any device always at hand.
Some applications where Bluetooth can be used
- Remotely controlled car with a mobile phone
- Applications controlled by mobile phones
- Remote programming and debugging of the microcontrollers.
Applications where Bluetooth may not meet the requirements
- Internet interface (theoretically possible but difficult to implement).
- Long-distance communications
- Sensor networks
WiFi
Among wireless communication types, this is the chosen one when it comes to connecting the Arduino to the Internet or simply to networks based on the IP protocol.
Xbee Adapters
Recommended for use in:
- Control and/or sensor networks where good noise resistance is required.
- (IEEE 802.15.4) Standardized standard
- Various network topologies (tree, star, or mesh)
GSM/GPRS
Obviously, this solution is to be adopted when it comes to accessing mobile networks for communication with Arduino, useful for controlling equipment through mobile networks or performing telemetry controls via mobile phone.