Nov 182010
 

arduino

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

Author: John Smitty

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 RS232, 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 400/900 MHz transceivers that use 4-6 pins for simple communications to more powerful XBee, ZigBee and even 802.11 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 3.3v instead of 5v. Interfacing is done with 3 simple wires, and a resistor is required on one line for the 3.3v 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.n1van.com

Article Source: http://www.articlesbase.com/electronics-articles/adding-ethernet-wifi-and-other-communications-to-your-arduino-or-other-pic-including-the-nslu2-3601649.html

About the Author

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

Popular Posts:

flattr this!

  2 Responses to “Extend your Arduino”

  1. There’s a compromise approach between a straightforward RS232 connection of the Arduino to the host that wants its info, and loading an entire tcp/ip stack into the Arduino to support ethernet or wireless communications. If you’ve got another box that’s placed nearby the Arduino, you can connect the Arduino to a serial port on that box and install a serial-to-ethernet adapter program in that box. Effectively, that box becomes a server for device access via that serial port, a worthy semiretirement job for ancient hardware if you happen to have it (especially since the ancient hardware is more likely to possess a serial port than anything current).

    I went looking for such adapter programs on Freshmeat some years back, and came up with these candidate programs for you to Google: conserver, logserial, ser2net, serproxy, sjinn and sredird, all of which are old enough to have LSM records :) I didn’t have a chance to play with them then, so I’ll watch to see what you make of them instead.

  2. Use the USB connector! Load Simple Message System on your Arduino and communicate via shell scripts. The package is on my website, user.cavenet.com/rolandl. Full IO & PWM control. AD is scaled to mV and CSV formatted. It’s proof-of-concept: easy to modify for your project. If you need more range than a 16′ USB cable, use an old laptop or Sheeva and ssh into it.

 Leave a Reply

(required)

(required)


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>