Connecting Your Robot to the Internet (Hardware)
You’ll need additional hardware to connect your Arduino to the Internet. Following are some examples of add-on products that can help.
Arduino Ethernet Shield
Arduino’s Ethernet Shield (see Figure 3) is one of the earliest products aimed at bringing Internet connectivity to the Arduino world. It’s equipped with a standard RJ45 Ethernet jack as well as an SD card slot. The Internet functionality uses only four pins, so you can even stack another shield on top.
Figure 3 A lot of code has been written for the Arduino Ethernet Shield. (Credit: Adafruit Industries.)
As this is an established product, plenty of example sketches and tutorials are available, including information on how to make a web server, publish sensor data online, and host a chat via Telnet (a way of sending raw text over the Internet).
Adafruit CC3000 Breakout
The CC3000 is a relatively recent creation by Texas Instruments that drastically simplifies and economizes connecting to WiFi via an Arduino. It supports 802.11b/g WiFi protocols, as well as protected-access security protocols like WPA and WEP.
Adafruit sells the CC3000 in a variety of configurations—on a breakout board with an onboard ceramic antenna (pictured in Figure 4); on the breakout board with a uFL connector for an external antenna; and as a pair of shields, one with the ceramic antenna and one with the uFL lug. The shields have a bonus SD card slot as well as a prototyping area where other components can be soldered. In addition, Adafruit has a robust library with plenty of examples demonstrating the chip’s various functions.
Figure 4 The CC3000 breakout provides an easy way to connect your Arduino to the Internet.
We’ll use the CC3000 breakout from Adafruit for the project in this article: modifying the dart gun to give it the ability to send text messages when the gun fires.
Arduino WiFi Shield
The Arduino WiFi Shield (shown in Figure 5) is the inspiration for and competitor of Adafruit’s CC3000 shield. Like its newer cousin, the WiFi Shield can negotiate all standard WiFi networks and offers encryption, and like Adafruit’s shield it has an SD card slot.
Figure 5 Arduino’s WiFi Shield offers a lot of tempting features. (Credit: Arduino.)
One advantage of the WiFi Shield is that it monopolizes only four pins, so another shield can fit on top of it; the WiFi Shield includes female headers for that purpose. One other obvious difference is that the older WiFi Shield lacks the prototyping area of the CC3000 shield.
Roving Networks WiFly
The Roving Networks WiFly (shown in Figure 6) is a handy add-on board (SparkFun P/N 10822) that has the same footprint as the popular XBee wireless cards, making the WiFly easy to incorporate into electronics projects—many breakout boards and shields accommodate this footprint.
Figure 6 The Roving Networks WiFly allows microcontrollers to talk to each other.
Like the CC3000 boards by Adafruit, these WiFi boards offer onboard whip antennas or external antennas via uFL and RP-SMA connectors. They need only four Arduino pins to get you on the Internet.
Microcomputers: Non-Arduino Solutions
While robust, Arduinos are limited compared to a category called microcomputers, like the Raspberry Pi pictured in Figure 7. These devices are characterized by featuring the Linux operating system stored on a chip. They’re essentially low-end PCs in circuit board form, and frequently they can be plugged into a monitor and keyboard, working just like a computer—you can see a desktop with icons, and so on. They can be used to surf the Web, and they usually offer WiFi or Ethernet connectivity built in. Many web-interacting projects use a microcomputer instead of an Arduino.
Figure 7 The Raspberry Pi is basically a tiny PC.
The microcomputer category doesn’t really fall within the realm of this article, but I’ll briefly describe some of the most popular microcomputers, in case you’re interested in taking that direction for your projects.
- BeagleBone Black. This high-performance open source microcomputer features a 1 GHz processor, 512MB RAM, an A8 processor from Texas Instruments, and the ability to connect to a TV via HDMI and to the Internet via Ethernet.
- Raspberry Pi. Another open source microcomputer, the Pi is the most popular entry in that category. You load the Linux operating system on a flash drive, including variants designed to be media centers, serving up movies and music. Because of its popularity, the Raspberry Pi has countless projects designed for it, and an impressive knowledge base that can help you out with your own work.
- pcDuino. The pcDuino runs like a PC using Linux or Android ICS, the version of Android meant for tablets and other interactive devices. As a nice bonus, it has the same female header pins as an Arduino, so it can use the same shields.
- Arduino Yún. Arduino’s response to the Raspberry Pi and other microcomputers has an ATmega32u4 microcontroller running Arduino, but also packs an Atheros AR9331 processor that runs Linux. That plus a built-in WiFi chip make the Yún the latest and greatest in the Arduino world.