In this project we will see how it is possible to create an interactive web page with Arduino Yun, to control and monitor different devices at home.
The web page is updated with a delay of about 3 seconds, automatically, both when you perform some direct action (for example when you press the switches on the web page) and if something happens on the hardware side.
To access the web page you must type in a browser the IP address where the Arduino YUN board is connected on the router.
Example: http: // "arduino yùn address" / sd / casa /
in my case I set the fixed IP address for Arduino Yùn 192.168.1.89 then:
To enter the web page and check the devices, type the Username and Password. By default I left as Username "admin" and as Password "admin".
This system is not a good deterrent for those wishing to enter the web page of the commands because you can get around by simply writing the IP address of the page you want to open.This is a first step and that's what I managed to do in a few days .
I accept suggestions in the comments to make the login page more secure. ;-)
Through the navbar, at the top of the web page, we can choose to monitor and control the switches, the climate or the sensors in an isolated way.
The Web page allows us to set the temperature threshold values and automatically activate the climate (air conditioning and heating). At the same time we will receive notification of the changes occurred on the hardware side of the Arduino where the various sensors and actuators are connected. All the switches and sensors connected to Arduino Yùn are collected on the Home page of the web page.
The system is designed to operate in automatic and manual mode. In manual mode it is possible to control connected relays on the Arduino Yùn by operating the buttons on the web page. In automatic mode the system acts independently by activating the relays based on the status of the sensors and according to the parameters supplied by the user on the Web page.
On the web page dedicated to the switches are available the buttons related to the relays connected to Arduino Yùn.
Temperature and humidity are controlled by DHT-11 sensor. The system detects the temperature and compares the value read with two threshold values, set remotely via slider on the Web page. If the value falls below the minimum temperature threshold the relay connected to pin 9 of the Arduino Yùn will be activated, switching it off when this threshold. If the value rises above the threshold of the maximum temperature value the relay connected to pin 8 will turn on and vice versa will switch off.
The area of the web page shows both the temperature and humidity values for the room where the DHT-11 sensor is installed and the status of the heating and cooling system by means of two LED icons. The icons that simulate two LEDs change state and turn green if the actuators connected to Arduino Yùn are active, vice versa, they are red.
In the Other sensors page are collected the two sensors connected to Arduino Yùn. Specifically I inserted a hall sensor on pin 7 able to bring the digital output up when a magnet approaches, thus simulating a magnetic alarm sensor for doors and windows. A PIR sensor instead is inserted on pin 4 and is able to detect people or animals up to a maximum distance of 7 meters.
Also on the side of the web interface, they are also provided with two LED icons. Change color from green to red and vice versa based on sensor detection.
The sketch to be loaded on the Arduino Yùn reads and drives The pins on the card and transmits the data with the Web page. The Bridge library allows you to manage the communication between the two modules of Arduino Yùn, the microcontroller ATmega32u4 and the processor AR9331.
The YunServer library allows the activation of the server on the Arduino side on port 555 where the Linino web server re-routes the messages destined to the / arduino folder
The YunClient library allows to accept and process messages sent by the Linino server.
Note: enter the library dht-sensor-library-master.zip in the Arduino IDE. Through the appropriate command by clicking on Sketch >> #include library >> add library from file.ZIP.
File Size: 2 kbFile Type: zip
File Size: 11 kbFile Type: zip
File Size: 130 kbFile Type: zip
I hope this project will be useful.
If you want to help me support the site visit the page SUPPORT THE BLOG link: https://www.progettiarduino.com/sostieni-il-blog.html
If you like the page leaves a like, supports the blog!
© ProgettiArduino.com 2019 - Fancello Salvatore
Layouts, images and texts are the exclusive property of www.progettiarduino.com