This system allow remot control of a lamp by means of an Arduino/Linino board and... our project.
An important requirement is to know the Linino's world. Visit the website to find all the necessary information for a correct set up of your Arduino Yun / Linino One. See http://www.linino.org/ and the wiki page.
Now follow these instructions and discover how to build your personal control system.
Step 1: Functioning
After the set up you will be able to activate or deactivate a connected device (lamp in this project) by means of a web page simply by clicking a button on the page.
Sit comfortably and control your system from the browser of a connected device (computer, smartphone, tablet).
Step 2: What You Need
- Arduino Yún or Linino one ;
-Tinkerkit Relay Module ;
-Shield Tinkerkit 2.0;
Step 3: Connect
Connect all the components as described in the schema of the project.
We used tinkerKit shield 2.0 for our convenience. The connector "OUTPUT 02" on the shield refers to pin board "D9".
You can also use a breadboard and set the appropriate connections.
Step 4: Coding
Download archive WiFiOutlet.zip and import all directory in your ideino-workspace. Access the Ideino IDE and open WiFiOutlet project. See the file tree and directory.
server.js : code to start server listening on port 1337.
Remeber to modify window.onload = connect('dhlyun.local');
replace 'dhlyun.local' with the IP number of your Arduino/Linino board, local or pubblic address.
package.json : It's used to specify dependencies. In our case the module “node-static” is included.
style.css : style sheet for component of index.html
The libraries js/socket.io.js and ideino-linino-lib-client.js are included in the js directory.
Feel free to modify code and adapt it to your personal project. You can simply add devices making the right connections, copying and replicating the existing code.
Step 5: Start
In Ideino IDE select server.js and click "run" button. Console shows information about connection and client.
To see the results of our application open a browser from your prefer device (pc, tablet, smartphone) to the address set by specifying the port number. In this example it's 10.0.0.35:1337.
Click on/off button and program will modify value on pin D9:
1 --> ON close the phisical circuit and light the lamp.
0 --> OFF open the phisical circuit and off the lamp.
Now... control is in your hand, wherever you are.
Step 6: Conclusion
Finally, this system is great to be taken as a starting point and basis for developing and improving other similar and much more complex project such as automation of doors, windows and shutters or anything with an outlet.
Pays attention now you are able to develope your domotic home.