Step 1: Setup
Note that the Ethernet Shield sold at Radioshack is online compatible with Arduino Uno Rev. 3 boards (or later). It has too many pins to plug into earlier version Arduino boards.
Step 2: Shield Features
It relies on the Arduino Ethernet library, which comes bundled with the development environment.
There is also an on-board micro SD slot which enables you to store a heck-of-a-lot of data, and serve up entire websites using just your Arduino. This requires the use of an external SD library, which does not come bundled with the software. Using the SD card is not covered in this Instructable. However, it is covered in the Step 8 of the Wireless SD card instructable.
The board also has space for the addition of a Power over Ethernet (PoE) module, which allows you to power your Arduino over an Ethernet connection.
For a full technical overview, see the official Ethernet Shield page.
Step 3: Get started
Next, open the Arduino development environment. I highly recommend upgrading to Arduino 1.0 or later (if you have not done so already). This version of the software has built in DHCP support, and does not require manually configuring an IP address.
To figure out what IP address has been assigned to your board, open the DhcpAddressPrinter sketch. This can be found at:
File --> Examples --> Ethernet --> DhcpAddressPrinter
Once open, you may need to change the Mac address. On newer versions of the Ethernet shield, you should see this address on a sticker attached to the board. If you are missing a sticker, simply making up a unique mac address should work. If you are using multiple shields, make sure each has a unique mac address.
Once the mac address is properly configured, upload the sketch to your Arduino, and open the serial monitor. It should print out the IP address in use.
Step 4: Server
One important thing to keep in mind is that you will have to enter your Arduino's IP address in both of the examples below in order for them to work.
The following code changes the web page served based on a button press:
To make this example code work, simply attach a button between pin D2 and 5V, a 10K resistor between pin D2 and ground, and then load the IP address of your Arduino into your web browser. The page should load with a black background. Press and hold the button, and then refresh the browser page. The site should now load with a white background.
The following code lights up an LED depending on the URL that is sent to the Arduino:
To make this work connect the positive lead an LED to pin D2, and the negative lead in series with a 220 ohm resistor to ground.
To turn on the LED enter this into your browser:
http://[YOUR IP ADDRESS HERE]/$1
To turn off the LED enter this into your browser:
http://[YOUR IP ADDRESS HERE]/$2
Note: You should obviously replace [YOUR IP ADDRESS HERE] with your IP address.
Step 5: Client
Websites have a lot of text both visible and hidden, which makes programming on the client side very tricky. Reading information from websites typically involves parsing a lot of strings. This is maddening, but worth it, if that is what you intend to do.
I was going to write some code to read Twitter messages, but such a code already exists as an example within the Arduino programmer. Instead, I simply modified it slightly to turn on an LED if a special message is read.
To make this work connect the positive lead an LED to pin D2, and the negative lead in series with a 220 ohm resistor to ground.
Don't forget to enter your own IP address into the code below, or it will not work.
Here is the code:
Presumably you are going to want to read something other than the recent post on the RandyMcTester Twitter feed.
To read other Twitter feeds, change the following bit of text:
client.println("GET /1/statuses/user_timeline.xml?screen_name=[NEW TWITTER NAME HERE]&count=1 HTTP/1.1");














































Visit Our Store »
Go Pro Today »




am using arduino leonardo board
pls help me
regards
pyt
sorry i had the wrong resistors in the circuit, was using those baby blue ones, I find them hard to read. make sure its the right resistor!
Any advice: i have confirmed ip address with addressprinter.
byte mac[] = { 0x90, 0xA2, 0xDA, 0x0D, 0x56, 0xC6 };
IPAddress ip(10,0,0,10); //<<< ENTER YOUR IP ADDRESS HERE!!!
The light goes on when i uplaod the script but wont respond to the ip $1 or $2, the page just sits and doesnt load. i even tried the script below to return a black screen and nothing loads on that ip.
Thanks!
1) i hooked the SHIELD with uno
2) I changed the mac address in chcp address printer
3) program uploaded,
4) rj45 hooked with shield
after that my system showed local area network connected ,
when i click the serial monitor its showing only failed to confogure mac address"
what shall i do
It should still turn the light on, but the reason it's not displaying a web page is because the code doesn't return a web page.
change the "
if(c == '\n')
{
currentLineIsBlank = true;
} " to "
if (c == '\n' && currentLineIsBlank)
{
// send a standard http response header
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
client.println("Connnection: close");
client.println();
client.println("");
client.println("");
client.println("");
client.println("");
currentLineIsBlank = true;
break;
}
"
This code will return a web page with the background set to black (#000000) after light turns on.
I seem to have a problem. pin2 seems to default to on. How can I get ti to default to off?
Thanks,
Can this shield be used to send an email without connecting the arduino to a pc?
Please let me know if you come across anything..
basically Im planning on using a keypad attached to my device to get values inputted from the user and then the calculations from the user inputted values are then displayed on a lcd.
Now my lecturer has allowed me to use a Xigbee shield for wireless data transfer. And also I've seen tutorials on this that claim to send tweets without using any Ethernet shield, however the arduino for those projects are connected to a pc. I've done the tutorials those and my program does compile but none of them have displayed anything on twitter yet.
My question is do you think it might be possible to send an email/twitter via processing if I can send all the data from my device via the Xigbee shield?
ONCE AGAIN THANK YOU FOR SUCH QUICK REPLIES. I REALLY APPRECIATE YOUR ADVISE.
Example:
Tweet sent from phone> Tweet read by Arduino> Turn Motor on for 10 seconds> Tweet sent from Arduino> Tweet read by phone> I'm happy that the motor turned on for ten seconds.
Ideally if this could respond when it is tweeted directly from certain accounts it would work better.
Thanks and Nice Tutorial
http://community.thingspeak.com/tutorials/arduino/update-twitter-with-thingtweet-and-arduino-ethernet-shield/
There are probably 101 other ways to do the same thing.