Etherlux is an ongoing Internet Of Things (IOT) project initiated by Rounok Joardar of Plano, Texas. The goal of the project is to create a practical, feature-rich, low-cost, internet controlled power control system for residential use. The core design idea behind the project is to use a single board computer, such as Raspberry Pi or Onion Omega 2, hosting a web server to control a logic block that is connected to power electronics circuitry.
Etherlux is a Raspberry Pi based internet controllable power outlet system. Although similar products are commercially available, Etherlux has several distinguishing features such as low cost, ability to control electrical devices well beyond simple on/off operations, easy software upgrades, and robust peformance.
Concept At the core of Etherlux is a Raspberry Pi running a web server. When a user points his/her browser to the Pi's URL and clicks a link, a PHP request is sent to the server. The PHP script on the server then executes a local Python script which generates a digital signal (i.e. a series of 1's and 0's) on a specified GPIO port of the Pi. This signal is then decoded by an electronic circuit that activates or deactivates devices that are connected to the supply line (110V).
Implementation For purposes of illustration let us consider a simple implementation where each click on the browser toggles the ON/OFF state of one outlet. Fig.1 shows the circuit configuration used in this implementation. Clicking on a power button icon on the web page will result in a one second pulse being generated by a Python program on one of the Pi's GPIO pins. This pulse is fed to the clock input of a J-K flip flop configured in toggle mode (i.e. J and K inputs both tied to digital high). The output of the flip flop controls the ON/OFF state of a relay via a optoisolator.
State Sensing The ON/OFF state of each outlet is sensed by tapping the voltage at the midpoint of the 300 ohm resistor connected to the optoisolator associated with the outlet. This voltage is then fed to a port on the Pi's GPIO which is configured as an input in the code. Fig. 2 shows this circuit configuration.
Software Four separate files are used in the software implementation described here. The first file is a php file (lights_v03.php) that is the main landing page of the Etherlux control system. This is a mixed php and html file. When the user requests this page, the webserver first checks the status of each outlet by executing a python script (status.py).