Arduino Web Server With Sensors
by vktomi in Circuits > Arduino
9928 Views, 36 Favorites, 0 Comments
Arduino Web Server With Sensors
![Screenshot_2014-07-11-19-26-40.png](/proxy/?url=https://content.instructables.com/FSC/B0R9/HXHR6MCI/FSCB0R9HXHR6MCI.png&filename=Screenshot_2014-07-11-19-26-40.png)
![2014-07-11 19.18.44.jpg](/proxy/?url=https://content.instructables.com/FJK/1GUL/HXHQZIYK/FJK1GULHXHQZIYK.jpg&filename=2014-07-11 19.18.44.jpg)
![Arduino Web Server with Sensors](/proxy/?url=https://content.instructables.com/F3K/3DBP/HXIK9EOF/F3K3DBPHXIK9EOF.jpg&filename=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...
Relay. How to Work?
![dancinglights_step1b.png](/proxy/?url=https://content.instructables.com/FGB/8TTY/HX6ARV5R/FGB8TTYHX6ARV5R.png&filename=dancinglights_step1b.png)
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
}
4x4 Matrix Keypad. How to Work?
![4x4.jpg](/proxy/?url=https://content.instructables.com/F3J/WVXR/HX6ARUO6/F3JWVXRHX6ARUO6.jpg&filename=4x4.jpg)
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); }
}
DHT11 Sensor. How to Use?
![Arduino-and-DHT11_bb.png](/proxy/?url=https://content.instructables.com/FEO/3Z9G/HX6ARUQ8/FEO3Z9GHX6ARUQ8.png&filename=Arduino-and-DHT11_bb.png)
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); }
Raindrop Sensor. How to Work?
![raindrop.jpg](/proxy/?url=https://content.instructables.com/FK4/56WK/HX6ARUOB/FK456WKHX6ARUOB.jpg&filename=raindrop.jpg)
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); }
IR Flame Sensor. How to Work?
![2.JPG](/proxy/?url=https://content.instructables.com/FWM/FTCP/HXIK9DC9/FWMFTCPHXIK9DC9.jpg&filename=2.JPG)
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);
}
MQ-2 Gas Sensor. How to Work?
![$_1.JPG](/proxy/?url=https://content.instructables.com/FJ7/K6OT/HXIK9DC8/FJ7K6OTHXIK9DC8.jpg&filename=$_1.JPG)
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); }