Step 6: Program Board/Write PHP

I've included source code for the Arduino and the Server.

first open the PHP file and make the following changes:
set $path to the location of Sender.exe
set $port to the COM port the arduino is using

save the PHP file to the htdocs folder in your XAMPP directory as index.php

load the Arduino IDE and open the Arduino file. Press the reset button on the Arduino. Then, quickly press the transfer button in the IDE. Once the file has transferred, you're done.
Hi - this is pretty great, but when I run the php on apache I see the web page with <br>&quot;Notice: Undefined variable: submitted in C:\xampp\htdocs\index.php on line 51 <br>Outlet State is Unknown &quot; <br>and if I click a button <br>&quot;Fatal error: Class 'COM' not found in C:\xampp\htdocs\index.php on line 27&quot; <br> <br>It *looks* like everything is defined? I'm unfamiliar with PHP but the arduino seems to be setup alright. <br>Thanks!
<p>Problem is that in new version of php COM class is not used.</p><p>You have to include php_com_dotnet.dll which you already have in</p><p> XAMPP\php\ext folder into apache php.ini file</p><p>Go to Xampp config screen, then hit config for Apache server and choose PHP(php.ini) file and edit it.</p><p>Scroll until you find ; Dynamic Extensions ; and add </p><p>extension=php_com_dotnet.dll</p><p>voila!</p>
can you tell me what part of the xampp server your using cause i can only get ftp and apache working
Apache+php (which is what xampp contains) is all you need.
I really wanna do this project but I got 2 questions...... What is the php code and what code do I have to upload to my arduino......thanx
the php code, along with the exe file and the ocx file, reside on the computer the arduino is connected to... they take care of turning web requests into serial communication to the arduino... the arduino code (the.pde file) is what goes on the arduino to read the serial transmissions from the computer and operate the relay accordingly... all the files are in the zip file attached to the first step (the arduino code is in the arduino subfolder)
Wow......thank u so much........you cleared up everything so fast, keep up the good work!!!!
can you post a method that give us to control more leds? or more outputs?<br /> <br /> please...I've tried but.... didn't work form me....<br /> <br /> <br /> works fine with 1 output..<br /> <br /> <br /> great instructable....<br /> <br /> please make the same idea with 8 or more outputs!!!!! T_T<br />
That's a great Instructable!!! I understand all the hardware construction parts but do you know if I could do it with a basic stamp 2 module? because I have one lying around....
you definitely could, but since I haven't used that board for several years, I'm not sure what the code would look like.
This is amazing and I really want to give this a try but I'm having trouble finding some of the supplies you used at a good price. Are there any alternatives?
Hi, Funny thing... I kinda made the same thing... But its a USB powered white PLexyglas cube, with LEDs inside. The cube is constantly fading colors Then the 2 ppl have a program running on their PC, when either one is thinking about the other the fading stops and the cube turns red (you can change the color in the settings) I use ICQ to send the message through the internet, that way I dont have to bother about a server or anything... I will eventually post an Instructable here, when I can find some time. Mike
This is really cool. I have been wanting to mess around with controlling electronics over the internet. is there anywhere i should look that can give me the basics? I sorta understand what is happening, but i cant find a site that explains it out.
If you want to save the price of the USB board, you could just use the LPT port to drive the reed relay. <br/><br/><a href="https://www.instructables.com/id/EE62QUOM31EUOJJVA4/">https://www.instructables.com/id/EE62QUOM31EUOJJVA4/</a><br/><br/>If your looking to make a portable ethernet connected setup, I would check around for Nano ITX boards. <br/><br/><a rel="nofollow" href="http://www.idotpc.com/TheStore/pc/viewCategories.asp?idCategory=2">http://www.idotpc.com/TheStore/pc/viewCategories.asp?idCategory=2</a><br/><br/>I have a few of the EPIA boards laying around. you can power them from a regular 12V wall supply, and they have built in Ethernet. Many still have pin headers for LPT connections.<br/>
I kinda like the idea of using parallel, but most newer computers don't include it and most usb adapters can't be easily fiddled with (as I learned making a snes multitap/usb adapter)... I went with the Arduino for several reasons: 1) uses TTL to communicate, so any stand alone Ethernet controller can talk to it. 2) my arduino is usb and can easily become serial (with a max2322 and some caps) so use with both older and newer pcs is facilitated 3) Cheapest dev board I know of that has its powers 4) ethernet arduino is forthcoming 5) I already had one :) if i was going for a stand-alone setup, I'd use a less pricy/overly complicated solution than a nano itx pc... come on, ~$400 for an outlet control? i can do better. using an old thinkpad 365 (i think), a max2322 chip, three 1microfarad caps, and this setup, I've got a stand alone unit for ~$150, and thats without trying to be efficient or dedicated (BTW: just make a serial to ttl-adapter, connect it to the arduino, and run everything normally). if I used a serial arduino to start with and bought a gutted laptop (no need for cd, harddrive(use a cf card with an adapter), internal display, ect), it'd be even cheaper. with a bit of eBay magic, it could be a cool $100. anywho, for my future plans an arduino fit nicely, and its a great piece of kit to have around (used for a usb morse key, universal computer controlled remote, winamp control, ect)
This is some awesome Valentine's Day technology. Now that you have a computer controlled power outlet you can make all kinds of remotely operated gifts and machines. Nice idea and instructable!
You could make sure your christmas lights were off, space heater wasn't running while your out, but most importantly... annoy/freak the bejeezes out of anybody!
the eventual goal is to rig it with an Ethernet or Bluetooth Arduino, if and when I get one, and use them for full home automation... btw, this cost apr. $40 to do this, and I can add outlets for ~$10 a piece. X10 wants 99 for just the usb controller

About This Instructable




Bio: I'm a self proclaimed renaissance man. My goal in life is to have a conversational/practical knowledge of every subject known to man. I ... More »
More by gschoppe:The AnonyBox - A cheap and easy network device to manage anonymity online Jack-o-lanterns from years past Heart-Shaped Paperclips 
Add instructable to: