Project Description

Description:

In this Project we will use Arduino  and Ethernet shield W5100 to create a simple Web server.Using the Ethernet library, the device will be able to answer a HTTP request with the Ethernet shield. After opening a browser and navigating to the Ethernet shield’s IP address, the Arduino will respond with just enough HTML for a browser to display the data.

Hardware:

Arduino board

Ethernet Shield (W5100)

PIR Sensor

LDR

LED

Resistor 220 ohm.

135

Arduino board and Ethernet shield, we will find 4 rows of header pins (female on main board, while male on shield). They’re designed to be stackable. Plug the Ethernet shield on top of the Arduino main board.  Make sure all the pins are aligned and inserted properly to prevent wrong connection. After that connect the sensors and LED as shown in the schematic below. The connection is very straight forward.

First, a 220 ohm resistor is connected in series with the LED and Digital Pin 4 will drive this LED. PIR sensor output digital signal of 5 and 0V. So any digital I/O pin can be used to read the signal. I’m using Digital Pin 3. For LDR sensor, we will read the analog value produced by the voltage divider formed by the LDR and 10k ohm resistor at Analog In A5. The completed hardware will look like the figure below. The hardware setup is really simple, isn’t it? No soldering at all!

You can see that I insert the iron pins of the components into the female header of the Ethernet shield. Sometimes the connections are loose because the iron pins may be too thin for the header. So you may want to extent the pins and plug the components on a breadboard.

136

Sketch:

https://github.com/CytronTechnologies/Arduino_Ethernet-Shield

The LDR reads the light level of the room and show the value as the Light Reading. If there’s no movement detected, the web page shows “No Movement” in green colour. The data will refresh every 5 seconds. By clicking on the LED On and LED Off buttons, you can control the white colour super bright LED connected to the Arduino board. When the LED is turned on, the light reading increases dramatically (from the initial value of 195 to 939). This is because I put the LDR facing the white LED. When the PIR sensor detects movement, the web page will show “Motion Detected!” in red colour.

137

138

Motion detection:

139

 

 

 

More information:

https://tutorial.cytron.io/2011/07/27/an-arduino-room-monitoring-web-server/