Go Down

Topic: Internet Control of Arduino (Read 5 times) previous topic - next topic

speemike

Mar 08, 2011, 09:44 pm Last Edit: Mar 08, 2011, 09:49 pm by speemike Reason: 1
Hi everyone,
This is my first post on the website so please be understanding. I have been playing with the Arduino for about a year and it is awesome. I can do the basics but looking to expand to the web. I have some basic questions that I was hoping you could answer.

1) Do I need the ethernet sheild, what are the advantages to the different sheilds?
2) Do I need my own webserver if I want to control the outputs on Arduino via the web?
3) I have the book called Making Things Talk, everything in this book uses a home webserver and PHP. Do I need to buy a seperate computer just to act as a server?
4) Do I need to talk to my ISP and buy a different service plan to set up a home server?

I have many applications but my first is the following:
I have a dog that keeps getting on the couch during the day and leaving her hair everywhere. So I would like to set something up that when she gets on the couch I get a text message or email notifying me she is on the couch. I could then sign into Skype and watch her. As I am watching her, I would like to be able to activate a solenoid to shoot water or compressed air at her. I know this is a very difficult solution to something that could be solved in a much simpler way, but that would not be as entertaining. Also, we love our dog very much and are not doing this to be mean to her, she has a very nice soft dog bed 5' from the couch.

johnwasser

> 1) Do I need the ethernet sheild, what are the advantages to the different shields?

You need an Internet connection of some kind.  The most common connection seems to be an Etherenet shield so you'll find the most examples there.  A WiFi shield would work if you have a WiFi network.  The serial protocol PPP (Point-to-Point Protocol) could be used if you have some way of routing it.  I don't have an opinion on which Ethernet shield to use.

> 2) Do I need my own webserver if I want to control the outputs on Arduino via the web?

No.  The Arduino will work as a web server.

> 3) I have the book called Making Things Talk, everything in this book uses a home webserver and PHP. Do I need to buy a seperate computer just to act as a server?

Whatever computer you already have can probably act as a web server.

> 4) Do I need to talk to my ISP and buy a different service plan to set up a home server?

Depends on your ISP.  In general I find that they don't care as long as you don't host anything so wildly popular that you use a lot of upload bandwidth.
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

speemike

So I can use my normal desktop as a webserver and then switch it back to a computer when I need it? How is this done, with software? Maybe I dont need to do this if I can use the Arduino as the server? Again I apoligize I have never programmed before and have no webdesign experience.

Ran Talbott

There are a couple of different approaches possible here.

One is to use the Arduino as a "smart peripheral" of a new/existing PC that acts as the webserver.  The PC doesn't have to be "switched" or dedicated: the webserver software is just another application that can be running on your PC while you're doing all the things you do normally.  Commercial websites use dedicated machines because they're very busy, but your system won't be doing much.  However, if you're running Windoze, I would recommend picking up an "obsolete" PC that you can get for (nearly) nothing, and putting Linux on it to run the webserver, because I don't trust MS software to protect the rest of your system from attacks via the webserver.

The other approach is, as John suggested, to put a network interface on the Arduino.  The Ethernet shields based on the ENC28J60 are the cheapest, but they require more CPU and memory from the Arduino, and their libraries are not compatible with the ones for the "official" shield.  So most of the examples you'll find online won't work with them.  The shields based on the Wiznet chip (like the "official" one) are more expensive, but the Wiznet chip takes a lot of the workload off the Arduino CPU, and you have many examples to learn/borrow from.

WiFi shields are more expensive still, but might be worth it to you to avoid stringing cables that your dog could chomp.  I have no experience with them, so I know nothing about how compatible their libraries are, or how many examples are available.

Personally, I wound up buying parts (I was lucky in that Wiznet was having a sale on modules at the time) and building my two Ethernet shields from scratch for about $30 apiece.  When I recently looked into doing another one, I decided against using the ENC28J60 because I decided the incompatibility wasn't worth the cost savings.  However, other folks have decided that the savings were worth the extra work: it's a matter of personal preference.  Since you seem to be a (relative) newbie,  you're probably better off going with a Wiznet-based solution for now, and maybe doing something with the ENC28J60 when you have more experience.

speemike

Is this a decent shield
http://www.robotshop.com/arduino-ethernet-shield-4.html

• Based on the Wiznet W5100 ethernet chip
• Provides standard RJ45 ethernet jack
• Contains a number of informational LEDs
• Includes micro-SD card slot and reset controller
• Compatible with Arduino Duemilanove and Mega


Targettio

As the guys above have mentioned, there are two methods of getting an arduino on the internet.

1.   An Ethernet or Wifi shield (imo wifi is too expensive to bother with unless it's an absolute necessity)
2.   Using a serial link to a PC (server)

Using an Ethernet shield is probably the cheapest method and certainly uses the least amount of power.  But if you already have a home server or want one (for more than just running an arduino) then that may be a more suitable solution.

As for ISP etc: you could ask your ISP for a static IP address and then buy a domain name (business grade broadband), but that will probably cost  a fortune. The far more sensible approach is to use site like no-ip.com or dyndns.com.

•   These sites will give you a free domain name and link that domain to your home IP (even if it dynamic).
•   Then you need to set your router up so it forwards port 80 requests to your server (arduino or PC)

Most ISPs will let you get away with this, some block port 80 (rare these days), but this can be overcome with a little bit of port forwarding. The only real concern is the 'fair use policy' that most ISPs have, but as long as you traffic isn't too high (ie just you and your family just checking up on your site) then you shouldn't have a problem.

kaiser

hi, this is my first time posting here even though i've been using arduino for quite some time in the past.
also i've been using the arduino ethernet shield for home automation, anyway, answering your questions..

1) yes, if you want to control something in your house over the internet, or locally you need the ethernet shield, it's quite simply to use, you just have to set up a configuration (ip address, mac address) then connect it to your router and you can access it by all the computers in your house, and with some port forwarding even the internet. I really recommend this shield before others, because of its simplicity.
2) No, the arduino ethernet shield will act as a server, for example, if you set up the ethernet shield by the ip address of http://192.168.1.100/, then you can access it by your computer typing the address in the browser bar. The shield will display a page with some data, as it is acting like a server.
3) Not quite, as i said before the shield will act as a server, the purpose of home webservers are generally for more complex tasks.
4) If you want to control the arduino over the internet, you should just check if your router has port forwarding.

About your application, yes you can do it with the ethernet shield, the one that you posted before it's fine, you just have to figure out how to detect if your dog lays on the couch, there are several ways to do this i can think of laser detection or pir, the output of that sensor should go to one of the arduino's input and it can be read as simple as:

Code: [Select]
client.print(analogRead(analogChannel));

with that data you can send a mail or something, ah, and it should be the same thing with the water gun lol, just setting it as an output

Ran Talbott

Quote
Is this a decent shield


Probably, but I have no personal experience to confirm/dispute that.

I have the Adafruit shields (also sold by robotshop, if you want to buy other stuff from them).

Advantages for the robotshop shield: lower profile (the Adafruit shield is a nuisance to stack on because the Wiznet module is so tall),  and the SD card slot (the Adafruit shield can't share the SPI bus due to a bug in the Wiznet. It appears there's a fix for that on the robotshop board). 

Advantages for the Adafruit: it's easy to wire the Wiznet reset to a digital pin to control resetting in software, which many have found useful.  Also, it has the Arduino pins brought out to a separate set of holes.  I found these useful for one project,  where I needed to connect a small number of pins to sensors more reliably than the usual "solder wires to male PCB pins" method.  Instead, I put polarized headers on the shield, which made it easy to make error-free connections.

zoomkat

Quote
So I can use my normal desktop as a webserver and then switch it back to a computer when I need it? How is this done, with software? Maybe I dont need to do this if I can use the Arduino as the server? Again I apoligize I have never programmed before and have no webdesign experience.


On your pc you can run the apache web server in the background and probably won't even notice it unless it is getting heavy traffic.
Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   8)

speemike

You guys have been a ton of help. I will go ahead and purchase an ethernet sheild today and hope you are still around when I struggle to get it up and running.

Thanks again.
Mike

zoomkat

Quote
I will go ahead and purchase an ethernet sheild today and hope you are still around when I struggle to get it up and running.


I suggest you get the w5100 wiznet chip shield. It will probably save you a lot of time/effort over the cheap chip shield.
Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   8)

speemike

#11
Mar 18, 2011, 07:04 pm Last Edit: Mar 18, 2011, 07:16 pm by speemike Reason: 1
I was wondering if anyone could explain to me the diffrence between the ethernet shield/arduino combo and an IO Bridge. I have seen a lot of great home automation done with the IO Bridge, and it seems very simple to use. It also provides you with a way to simply create websites to monitor and run you automation. For someone who has very limited programming background this seems like a good introduction. I have not made up my mind on which direction I will go but it seems like the IO Bridge is easier to learn. What are the advantages to using an Arduino/Shield combo?

johnwasser


I was wondering if anyone could explain to me the diffrence between the ethernet shield/arduino combo and an IO Bridge.


Looks like IO Bridge costs $119 and you need to pay another $199 (or about $4/month) to use  "Expression Builder" to program it?  Looks like IO Bridge is primarily for environmental automation:  light and humidity sensors.  Ultrasonic range finders, etc.  If that is what you want to do and someone is willing to pay for the expensive hardware and subscription service to avoid programming then IO Bridge would be a fine solution.  If you want to automate something unusual like an art piece and you are willing to deal with programming to save s good deal of money then the Arduino might be a better choice.  There are probably many cases where either would work.
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

zoomkat

The old forum has post concerning the IO bridge, the one below might be of interest.

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1272560163
Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   8)

customctrl

As another option (sorry to re-post):

We're creating a free web-service that relays messages through a cloud server.
We'll post more details soon, but the Arduino essentially authenticates and establishes an ongoing connection to the server.

It's great because it does not require any network configuration.
No need to use a local static address, open up your firewall to setup port forwarding, remember your temporary IP address, configure Dynamic DNS, or pay an exorbitant rate for a static IP.

Check out the project:
http://www.kickstarter.com/projects/916146896/customctrl?ref=category

Go Up