The Internet Plug II
By Radu Constantinescu
Some time ago I use to create an "Internet Plug" - it was useful except one aspect - no password protection was available for the Site Player. In order to solve this problem I have attached a 16F877 processor to the Site Player. Now the Internet Plug is Password Protected and also the status of the exits is saved in EEPROM so is not lost in case of a power failure. The new project uses the same hardware as the old one-
The Internet Plug is a web-enabled appliance. The main goal is to show a simple and effective application for home use.
The concept is extremely simple: An interface between the cyber world and the real world. A box connected to both of these worlds accomplishes this.
The implementation is as simple as the concept, a plastic box with a 3 Power outlets and a computer network connection. The three outlets are for general use, any device can be connected, a lamp, a radio, a TV or any other electrical appliance. On the network connection a simple computer or the Internet can be attached. The Box does the rest, actually the box contain a web server and the power command elements necessary to turn on and off the power to the three sockets.
The Internet Plug tries to show a concept of the future: the web-enabled house.
One of the simplest applications will be to control the lights from the distance, meaning from any computer connected to the Internet.
First let me show a picture of the Internet Plug:
On the front side is easy to observe the three lights showing the status of the Sockets (if the light is on the power to the respective socket is on) and the network connection.
On the back of the box we can find the three sockets and the power cord (not shown).
All the commands are received by the web-sever inside the box. Once the Internet plug is connected to a computer network any ordinary web browser (Internet Explorer or any other) can be used to view the status of the sockets and turn them on and off. No special software is necessary.
The image shows the interface to the web. Extremely simple and intuitive buttons/status indicators are used. Each time a command button is pressed with the mouse the command is executed and the status indicators are updated. In this example the Power to the first plug is on and the Power for the plugs 2 and 3 is off.
Oanc one tryes to change the status of an exit by pressing one of the ON/OFF buttons a password check screen pops-up:
A 10 characters long password is expected. The password is then transmitted to the 16F877 using the serial interface of the SP. The 16F877 check the password and if it is a match send a positive result to the SP, changes the exit and save the result to the EEPROM. If the password is wrong a negative result is sent back to the SP and no action is taken.
The user can also change the password. The new password should be 10 characters long and will be permanently stored in EEPROM.
So everybody can see the status of the exits but only the authorized users can change them.
The network interface is standard 10Mbit/CAT 5 UTP and supports DHCP or fixed IP. Because the SP has some issues with the DHCP I prefer fixed IP address -192.168.1.250. Like this the unit was stable an no problems were spotted along a whole week beside a power failure.
The appliance has a basic capacity of 4 I/O lines - only 3 of them are used in this example. The content of the web server page can be modified/customized as necessary and uploaded in the appliance. The upload does not request opening the box or replacing any inside component and is made thru the network cable.
The hardware can be customized to and the number of plugs can be increased/decreased or new features like temperature reading for example or air conditioning/heat start/stop can be added as requested.
Those who are interested about more technical details can contact me at constantinescuradu @yahoo.com.
The software is written in ASM language for 16F877 - I will not go into details in here. Basically the SP send a string to 16f877 caontaining the request and the password. The 16F877 validates the password and in case of success send back a string to the SP - 2 string variables inside SP are changed to "Password OK" and "Output Set" in order to be displayed by the SP. Meantime the user Web Browser wait a little bit and the display the result page containing this string. I have tested the Internet Plug with IE5.5, IE6.0 and Netscape 4.7 with no problems. At the end the 16F877 set the new output status and store it in the EEPROM. If the password is wrong an error string is sent to the SP to be displayed and no output is changed. The code was tested to different malformed/incomplete requests in order to avoid any possibility to change the output status without knowing the password.
The password change option first check the old pass then set the pass to the new value and store it in the EEPROM. In order to avoid any mistakes the new pass must be introduced twice and one should take a note of the new pass and store it in a secure place.
BUILD YOUR OWN
1. Download the schematic and build the hardware
2. Download the ASM code (3 files) and program the 16F877
3. Download the SP web page file and program the SP using the SiteLinker
4 Enjoy. The default password is "1234567890" and the IP address for the SP is 192.168.1.250 .
PLUGII ASM CODE
SERIAL ROUTINES ASM CODE
MACRO HEADER ASM CODE
SITE PLAYER WEB CONTENT
SCHEMATIC DIAGRAM COLOR
SCHEMATIC DIAGRAM B/W