Introduction: Arduino Web Server With Sensors

Picture of Arduino Web Server With Sensors

I made it for learn how to use the sensors.
And i want to turns on/off my ventillator if im not at home.
So if im not at home than i can watch my room status.

Later i want to make E-mail notification.
If you access your Arduino's ip in router forwarding (port:80) then you can connect to your Website everywhere are u.

If you want to made it you need:

  • Arduino Microcontroller
  • Ethernet Shield
  • DHT11 sensor
  • 4x4 matrix keypad
  • Raindrop sensor
  • Relay
  • Gas sensor
  • IR Flame sensor

The web server example: http://startingelectronics.com/tutorials/arduino/e...

Step 1: Relay. How to Work?

Picture of Relay. How to Work?

How to connect my lamp to Relay?
You can see the picture, its easy.

Relay connect to Arduino?
Relay -> Arduino
VCC -> 5V
GND -> GND
IN1 -> Choose a Digital Input

Arduino Program code:

#define RELAY1  6                       // Relay in Digital input 6
void setup()
{
pinMode(RELAY1, OUTPUT);
}
void loop()
{
digitalWrite(RELAY1,LOW); // Relay turns on
delay(2000); // Wait 2 seconds
digitalWrite(RELAY1,HIGH); // Relay turns off
delay(2000); // Wait 2 seconds
}

Step 2: 4x4 Matrix Keypad. How to Work?

Picture of 4x4 Matrix Keypad. How to Work?

How to connect 4x4 Matrix KeyPad to Arduino?
First 4 pin: ( Connect to Digital inputs )
Its return back with the column number when you press a button.
The last 4 pin: ( Connect to Digital inputs )

Returns back with the row number.

byte colPin[4]={22,24,26,28};   // Column Pins
byte rowPin[4]={23,25,27,29};  // Rows Pins

Example:
You have a 4x4 matrix keypad.

char keys[4][4]=
{'1','2','3','A'},
{'4','5','6','B'},
{'7','8','9','C'},
{'*','0','#','D'}};

If you press the 2nd column and 2nd row button.
The program is write out the '5' in the serial port.


For Example:

#include 
char keys[4][4]={ {'1','2','3','A'},
{'4','5','6','B'}, {'7','8','9','C'}, {'*','0','#','D'}}; byte colPin[4]={22,24,26,28}; byte rowPin[4]={23,25,27,29}; Keypad keypad=Keypad(makeKeymap(keys),rowPin,colPin,4,4); void setup() {
Serial.begin(9600);
pinMode(8, OUTPUT);
}
void loop() {
char pressed=keypad.getKey();
if(pressed) {
Serial.println(pressed); }
}

Step 3: DHT11 Sensor. How to Use?

Picture of DHT11 Sensor. How to Use?



How to read templature and humidity?

For Example:

#include 

dht11 DHT11; #define DHT11PIN 3

void setup() { Serial.begin(9600); }

void loop() { DHT11.read(DHT11PIN); // This method is reading new humidity and temperature. Serial.print(DHT11.humidity, 1); Serial.println(DHT11.temperature, 1); delay(1000); }

Step 4: Raindrop Sensor. How to Work?

Picture of Raindrop Sensor. How to Work?

How to connect the sensor with your Arduino?

OV -> Analog input
GND -> GND
VCC -> 5V

The Sensor Value:
The sensor is returns back with a value.
More than 1000: Its Dry
If less than 1000: its Wet

For Example:

void setup()
{
Serial.begin(9600);   
}
void loop() {
int sensorValue = analogRead(A0); // Its read a value. 
Serial.println(sensorValue);
delay(100);
}

Step 5: IR Flame Sensor. How to Work?

Picture of IR Flame Sensor. How to Work?

How to connect the sensor with your Arduino?
OV -> Analog input
GND -> GND
VCC -> 5V

The Sensor Value:
The sensor is returns back with a value.
About 900: Normal
If less: Detected Fire

For Example:

void setup()
{
Serial.begin(9600); }
void loop() {
int sensorValue = analogRead(A0); // Its read a value.
Serial.println(sensorValue); delay(100);
}

Step 6: MQ-2 Gas Sensor. How to Work?

Picture of MQ-2 Gas Sensor. How to Work?

How to connect the sensor with your Arduino?
OV -> Analog input
GND -> GND
VCC -> 5V

The Sensor Value:
The sensor is returns back with a value.
About 100: Normal
If more: Detected Gas

For Example:

void setup()
{
Serial.begin(9600);   
}
void loop() {
int sensorValue = analogRead(A0); // Its read a value. 
Serial.println(sensorValue);
delay(100);
}

Thanks for Watching!

Comments

bingdo72 (author)2017-07-02

Hello!

Hope all is well.

This is Jim from WIZnet.

As you might already know, WIZnet is well known for its hardwired TCP/IP chip and its W5100 being used in Arduino’s official Ethernet shield.

We also partnered with ARM as mbed silicon partners, and plan to offer more platforms for makers.

To help makers grow the open source hardware community, we are having an IoT design contest, titled ‘Curation is Creation.’

Come up with any IoT project idea and take advantage of this contest since we’re offering our ARM mbed-enabled WIZwiki-W7500 platform & WizFi310 shield at sample pricing.

To start, register your account at www.CyberMakerSpace.com

This contest will be held from May to August, with 16 prizes totaling $15,000.

We expect and hope that many makers, including members of WIZnet Museum www.wiznetmuseum.com, will participate and share their knowledge.

As this is a contest for the open source community, WIZnet wants to give back the power of the vote to all participants.

Hence, you can vote and provide feedback of other projects from September to October.

More details of the contest are available at www.CyberMakerSpace.com and technical questions are answered at https://forum.wiznet.io/

Hopefully, you’ll find interest in this contest and we look forward to your next creative IoT project!

Sincerely,

Best Regards,

Jim

kriekit (author)2015-09-24

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
Arduino: 1.0.6 (Windows 7), Board: "Arduino Uno"
DHT11Test2.ino:1:10: error: #include expects "FILENAME" or <FILENAME>
DHT11Test2:3: error: 'dht11' does not name a type
DHT11Test2.ino: In function 'void loop()':
DHT11Test2:13: error: 'DHT11' was not declared in this scope

bingdo72 (author)2015-08-06

This is good.
I have been searching some application references in which WIZnet solution is applied, and found your project using Ethernet Shield.
In the Ethernet Shield WIZnet's W5100 chip is embedded.
If you are O.K. I'd like to post this article in WIZnet Museum (http://wiznetmuseum.com) for others.

vktomi (author)bingdo722015-08-07

Sure, thanks so much! do it :)

CesarM6 (author)vktomi2015-08-29

Hi, I am new to arduino, planning to make monitoring system for my home based on arduino, can you please post link of this project complete sketch including the webserver. Thanks

vktomi (author)CesarM62015-08-29

Hello, its so old project, i dont know where is my files :/ am sorry

vktomi (author)bingdo722015-08-07

Just link it to me :)