Best way of accessing Arduino Circuit from Web?

Hi there.

What is the best way of accessing Arduino Circuit remotely from Web?

For example lets consider i have a Hello World Arduino circuit that has an LED and Arduino is connected to PC using USB. Now i want to turn that LED on/off remotely from web.

What is the best recommended way to do this?

BTW i am also planning to enhance this project in future to be accessed from my iPhone.

The Arduino-to-PC connection is through a serial port. You can send data to the serial port from Basic, C, C++, C#, etc. applications.

On the Arduino, you can read serial data.

What you send to the Arduino, and how you use that information on the Arduino is limited only by your imagination.

You could, for instance, mount a xbee shield and xbee radio on the Arduino, and forward the serial data to another xbee on an Arduino, and wirelessly control a device sending data from your phone to the web to the attached Arduino to a remote Arduino.

There are plenty of examples on the web to guide you.

The other way is to use an Ethernet shield so the Arduino has direct access to the Web without going through a computer.

thanks for the replies. i ll search the web according to this info.

Now want i really wanna know is that i have a computer to which arduino is connected through Serial port and i know how to read and send data to and from Arduino. My computer will always be ON and so i can access Arduino through computer anytime, but the thing is how to access the Arduino through Computer using Web? Sould is use VNC kinda software? Or should i build a Website (ASP.net) ?? Or should i make server using Apache? What should be the most efficient, secure and reliable way to achieve this?

If you want to access the computer that the Arduino is attached to from anywhere, using a web interface, you will need to be running a web server on that computer. Either IIS (yuck) or Apache (great) will do. The scripting language you choose to use, ASP.net (yuck) or PHP (great), will need to be able to send serial data to the Arduino, and, possibly, get data back.

Both ASP.net (using C# or C++) and PHP can do that. Apache and PHP are free, by the way. The Micro$oft stuff isn’t.

You can say what you want about Microsoft (and frequently they deserve it) , but they do actually have free editions of many of the development tools. You can donload vb.net express edition for free, SQL server also comes in a free edition.

You can also run a webserver from most of the Windows editions available, without added cost.

For personal “home” use these editions are almost always more than enough.

Now want i really wanna know is that i have a computer to which arduino is connected through Serial port and i know how to read and send data to and from Arduino.

Depends on what language you have at the computer end. See:-
http://www.arduino.cc/playground/Main/InterfacingWithSoftware

PaulS - Don’t let your Microsoft hate cloud your advice to new users. Microsoft has one of the best development platforms available.

I did the blink thrue php page there is a few days ago and you can find the code here :

http://www.ekoforce.com/ekoola/dev/diodon_pde.pde
http://www.ekoforce.com/ekoola/dev/index.php
http://www.ekoforce.com/ekoola/dev/diodone.php

I taked a lot so I give a few…!

thanks for the replies guys.

Ya i ll love to go with ASP.net or use VB.net (Sockets) to communicate with my computer connected to Arduino.

I built a client Server in vb.net using TCP classes and i think i can use that to communicate with that arduino connected computer and then talk to arduino. How about this?

BTW can ASP.net communicate to Serial Ports? But i think its not that secure right?

I don’t hate Microsoft. I use their products everyday. But, an Apache server is just as functional as an IIS server, but with a much smaller footprint.

A PHP script to generate an interactive web page will be 10 Kilobytes at most. A ASP.net application to do the same thing will be several Megabytes.

Unless one is familiar with building ASP.net pages, and configuring IIS, it can be a very steep learning curve.

Apache takes about 5 minutes to install and configure. There are plenty of sample PHP scripts on the net, and plenty of forums to get help.

ASP.net pages are not easily tailored to do something different, so they are not as easily shared.

I’ve done both ASP.net development and PHP development. PHP is easier, in my opinion. It is certainly easier for a beginner to pick up.

I’d love to see a n00b up to his neck in httpd.conf and .htaccess files ;D ;D

Quote:
Now want i really wanna know is that i have a computer to which arduino is connected through Serial port and i know how to read and send data to and from Arduino.

Depends on what language you have at the computer end. See:-
http://www.arduino.cc/playground/Main/InterfacingWithSoftware

I have used vb.net to turn LED on Arduino on/off , so i think i can read/write using Serial Port in other programming languages too as long as they support Serial Communication.

I’d love to see a n00b up to his neck in httpd.conf and .htaccess files

What does that mean in an Actual World :smiley:

I don’t hate Microsoft. I use their products everyday. But, an Apache server is just as functional as an IIS server, but with a much smaller footprint.

A PHP script to generate an interactive web page will be 10 Kilobytes at most. A ASP.net application to do the same thing will be several Megabytes.

Unless one is familiar with building ASP.net pages, and configuring IIS, it can be a very steep learning curve.

Apache takes about 5 minutes to install and configure. There are plenty of sample PHP scripts on the net, and plenty of forums to get help.

ASP.net pages are not easily tailored to do something different, so they are not as easily shared.

I’ve done both ASP.net development and PHP development. PHP is easier, in my opinion. It is certainly easier for a beginner to pick up.

I have never programmed in PHP , thats why i was thinking of developing in ASP.net :frowning:

The web server software is an HTTP deamon, httpd. The configuration file for the web server is httpd.conf. The Apache-supplied httpd.conf file is full of comments that explain what each section is for. It’s not all that difficult to configure as a local server. Connecting to the internet and actually serving up pages IS more difficult. Making is secure is not a trivial task, either.

The .htaccess file defines rules that grant or limit access to files and directories on the server.

The web server software is an HTTP deamon, httpd. The configuration file for the web server is httpd.conf. The Apache-supplied httpd.conf file is full of comments that explain what each section is for. It’s not all that difficult to configure as a local server. Connecting to the internet and actually serving up pages IS more difficult. Making is secure is not a trivial task, either.

The .htaccess file defines rules that grant or limit access to files and directories on the server

So you recommend PHP and will advice building a web page using PHP containing buttons which will communicate to my PC connected to arduino?

Honestly, I would say you’ll have a much easier time designing a simple user interface in VB.NET/C# than you will in PHP. If you aren’t familiar with HTML, you’ll be lost with PHP. At least in Visual Studio you can use the Visual Designer to create your page. I’ve been in software development for over 15 years, so I’m not talking out my a$$ :wink:

There are a billion VB.NET examples on the web and MSDN is probably the best programming resource out there (http://msdn.microsoft.com/en-ca/default.aspx).