Internet Based Home Automation using PHP & Java

Hello friends!
With my semester end exams getting over, I was in process of cleaning my laboratory garage (P.S. That’s how I address my Computer) and suddenly came across a mini project wherein you can control your electrical devices in home over an internet connection. To control the equipments, only thing the user needs is an internet connection and an internet browser like Mozilla Firefox, Google Chrome or Internet Explorer.

In this project, I have used the following components:
  1. Arduino: Since its less time consuming to program for simple things, so I chose to use this in my demo video.
  2. Internet Connection: Obviously you need that since the project is all about that.
  3. An HTTP Web server inside you computer: This is to run a PHP script which the user can access from his computer over an internet connection.
  4. A Java based Program: This is to communicate with my Arduino to control the electrical devices.
You can download the full source code from link given below:

Download Link

The source code folder consists of the following:

  1. PHP Script titled “index.php”
  2. Java Program inside the folder “soft”
  3. Arduino Program inside the folder “internet_automation”

Do not change the order of files inside the folders.

Process Flow:

To run this project, follow these steps:
  1. Install apache HTTP Web server inside your computer wherein Arduino is attached.
  2. Put the project folder inside your “localhost”.
  3. If you are on intranet or private LAN connection you can easily find out your IP address by typing “ipconfig” in command prompt mode otherwise use Google’s services by typing “what is my ip” in search bar to find out your ip address if you are paying for a static ip address. Dynamic ip address keeps on changing after every reboot of router.
  4. Go to the “soft” folder and start the program titled “soft.exe”. This is a program based on Java platform. I wrote it using processing platform which is again based on Java.
  5. Now go to another computer which is connected to internet or your intranet/LAN and type your first computer’s IP address on its browser.
  6. Navigate to the project folder. For example, type
  7. Following webpage will be displayed. It consists of 2 buttons “ON” and “OFF” for controlling a single device say AC or Bulb. In this demo, I am just controlling an on board LED attached to pin13 of Arduino.
  8. If you see the project working, then the project is done. Keep experimenting.
Launch Screen at the Web browser for Home Automation

You can see the demo video of this project here.

If you have any suggestions or any query regarding this project, then comment below or just drop me a mail.

Hope you liked it. Thank you for visiting.

Content is copyrighted © www.123mylist.com