Adding Ethernet, WiFi and Other Communications to Your Arduino (Or Other PIC) – Including the NSLU2

The Arduino is a small programmable device that can hold a small program and perform tasks such as reading temperature sensors, turning on or off switches, and can even serve as the ‘brain’ for a robot. I have used the Arduino (actually freeduino) for projects related to HVAC and hydroponics automation.

It is often useful to be able to communicate with the Arduino – for example, a common use of an Arduino is for data collection. You may have a temperature sensor wired in to the Arduino and interface with flash storage to log the temperature data. Later you have to go remove the flash storage and transfer it to your computer. But what if you could communicate with the Arduino? With Ethernet or wireless connectivity, you could simple connect to the Arduino with a computer and capture the data real time. This offers much more automation, and opens a world of possibilities – real time alerts, real-time adjustments (have the Arduino switch something on/off) and more.

There are already a number of choices available for communications.

Serial: The Arduino has TTL lines, not traditional RS22, but it is possible for reasonable cost to use a conversion/level adapter or circuit. You could then run a serial line to a computer. This is acceptable in many cases, but restricts you to using one computer, and in the case of my home, the wiring is not as convenient. I have Ethernet cat5 running all over the place, so if I am going to use a wired solution Ethernet makes the most sense.

WiFi: For some, this may be the best solution. If you can not or do not want to run wires of any kind, there are solutions ranging from 4/9 MHz transceivers that use 4-6 pins for simple communications to more powerful XBee, ZigBee and even 82. WiFi. The primary issue I have found with these solutions is cost or the technical expertise required. Also double check if the interface you are using requires any libraries or interface code that will use up space within the Arduino. The RFM units are promising as they are low cost, though I have not successfully interfaced them as of yet.

Ethernet: There are a number of good solutions for adding Ethernet capabilities such as shields and serial to Ethernet bridges/adapters. Some require a ‘tcp/ip stack’ to be written in to the Arduino – consider this as it uses a lot of storage space.

NSLU2 or Computer: For my application, I chose to use some NSLU2 units I had (these are often available via online auction). The NSLU2 is a network attached storage device (NAS) that is often modified (hacked) to run alternate operating systems and change it’s functionality at the hardware level. In my case I overclocked mine and installed Debian Linux using an 8GB flash drive. The NSLU2 also uses a TTL interface, though at .v instead of 5v. Interfacing is done with simple wires, and a resistor is required on one line for the .v to 5v conversion.

This article has presented several options for adding communications capabilities to the Arduio. In a future article I will cover actual specifics of adding a specific interface, including the NSLU2.

Find more technical articles at http://www.nvan.com

Leave a Reply

Your email address will not be published. Required fields are marked *

*