How can I connect to an Arduino using WiFi?

You have a few options for connecting your Arduino to the network/Internet.

Ethernet

Something like the Arduino Ethernet Shield allows you to plug in an Ethernet cable from the wall or router into your Arduino. Obviously, the main limitation is that your device is now tethered by the cable. For outdoor use, I wouldn't do this.

WiFi

The Arduino WiFi Shield allows you to connect to your home WiFi network. This is just like the Ethernet except its now wireless.

The ESP8266 is a cheaper alternative that, with the default firmware, has the same functionality as the WiFi Shield. Be careful that you power it with 3.3V and not 5V as the rest of the Arduino. It also uses 3.3V logic levels so don't connect the Arduino's TX pin directly to the ESP's RX pin; use a voltage divider.

RF

If you have a lot of sensors or other devices that need to communicate with each other, the best option is usually an RF module. You have many options here, XBee being one of them. Check out the Sparkfun XBee Buying Guide to look at all the options available. And that's just XBee. There are many other wireless options available, at all sorts of prices.

The thing with RF is that none of these will connect to the Internet. You will have all your devices communicate with each other or a base station, which will then be connected to the network by either a WiFi or Ethernet module.

Wireless Router Serial

Depending on what kind of wireless router you use, you can have the Arduino communicate directly with it and use that as your connection to a network.

  • Arduino - Cheap wifi connectivity
  • Converting your Ethernet Shield to a wireless shield

Marry OpenWrt and your Arduino

Get a small OpenWrt-capable router like "TP-Link TL-WR703N", flash it with the current stable version of OpenWrt and connect your Arduino to the router's USB port.

This solution ist half or less of the cost of WiFi-shields and has far more power.

...and cheaper as a YÙN.

Smart home automation webserver on OpenWRT router WR703N interfaced to Arduino, compared to Raspberry Pi and Ubuntu may be a starting point to read about this and your favorite search engine will find many more links about marrying WR703N and Arduinos...

(!) Please see https://arduino.stackexchange.com/a/1754/653 too....


ESP8266 is a cheap 5$ wifi module with UART, SPI connectivity. This can be integrated with Arduino seamlessly either through the stock firmware using AT commands, or by writing custom firmware using the SDK provided and GIPO available. For more reference http://www.esp8266.com/