Hardware Reference
In-Depth Information
Hello Internet!
To use any network module, you first need
to connect it to the network. That's the
goal here. In this project, you'll make a
very simple web server on your Arduino
that serves a web page whose background
color changes with the color of the light
where the Arduino is located.
LINK
- +
ETHERNET
SHIELD
L
RX
ON
100M
MADE IN ITALY
WWW.ARDUINO.CC
ICSP
MATERIALS
MADE
IN I TALY
» 1 Arduino Ethernet or
» 1 Arduino Ethernet shield and 1 Arduino
microcontroller module
» 1 Ethernet connection to the Internet
» 3 10-kilohm resistors
» 3 photocells (light-dependent resistors)
» 1 solderless breadboard
» 3 lighting filters
DIGITAL (PWM ~ )
- +
L
UNO
ON
TX
RX
ARDUINO
RESET
ICSP
POWER
ANALOG IN
Making the Connections
If you're using the Arduino Ethernet board, just plug it
into a USB-to-Serial adapter and it will show up in the list
of serial ports like a regular Arduino. The USB-to-Serial
adapter will supply it with power like a normal USB cable.
Programming it is the same as with any other Arduino, but
in the Tools Board menu, choose Arduino Uno or Arduino
Ethernet.
Figure 4-3
The connections between the Ethernet shield
and the Arduino controller when they're stacked
together.
To read the color of the ambient light, use three photocells
and cover each one with a different color of lighting filter:
red, green, and blue. You can get these at many lighting-
supply stores, photo supply-stores, or art stores, or you
can use any translucent colored plastic you have around
the house. You don't have to be scientific here. Figure
4-4 shows the connection between the Arduino Ethernet
module and the three photocells.
The Ethernet shield, like many shields for the Arduino, is
very easy to connect to your controller. Just plug it into
the board. Both the Ethernet module and the shield use
pins 10, 11, 12, and 13 for communication to the Ethernet
controller, and pins 4, 11, 12, and 13 for communication to
the SD card, so you can't use those pins for other inputs or
outputs. Connect the Ethernet module to your router using
an Ethernet cable. Figure 4-3 shows the Arduino Ethernet
shield's connections to the microcontroller.
How the Ethernet Library Works
To begin, you're going to try a couple simple programs
using the Ethernet library for Arduino. This library lets
you control the Ethernet module using methods similar
to those you use for printing to a serial port. There are
two types of software objects you'll make: servers and
You can use the Arduino Ethernet or Ethernet ahield with a
standard Arduino interchangeably, so from here on out, I'll
just use "Ethernet module" to refer to either.
 
Search WWH ::




Custom Search