You are on page 1of 6

Internet Controlled Arduino (no Ethernet shield)

1 od 6

http://www.instructables.com/id/Internet-Controlled-Arduino-no-Ethern...

Login
(/account/login)
| Sign Up (/account/gopro?sourcea=header&sourceaUrl=/id/Internet-Controlled-Arduino-no-Ethernet-shield/?ALLSTEPS)
Explore
(/tag/type-id/)
Create (/about/submit.jsp)
Contests
let's make(/contest/) Community (/community/)
(/)

share what you make >


(/)
(/id/intel/)

(/tag/type-id/category-workshop/channel-gardening/?sort=FEATURED)
(/editInstructable/)

(/tag/type-id/category-technology/channel-cnc/?sort=FEATURED)

(/tag/type-id/category-workshop/channel-home-renovation/?sort=FEATURED)

Internet Controlled Arduino (no Ethernet shield)

by ZachariahZebadee (/member

/ZachariahZebadee/)
Download (/id/Internet-Controlled-Arduino-no-Ethernet-shield/?download=pdf)
(/id/Internet-Controlled-Arduino-no-Ethernet-shield/)

5 Steps
(http://www.pinterest.com
Collection
I Made it!
Favorite
Share
/pin/create
/button
/?url=http
About This Instructable
%3A%2F
%2Fwww.instructables.com%2Fid%2FInternetControlledLicense:
15,780 views
Arduinono-Ethernetshield
359 favorites
%2F%3FALLSTEPS&
media=http
%3A%2F
%2Fcdn.instructables.com%2FF0H%2FOLM0%2FI6WDMXDI%2FF0HOLM0I6WDMXDI.MEDIUM.jpg&
ZachariahZebadee
description=Picture%20of%20Internet%20Controlled%20Arduino%20(no%20Ethernet%20shield))

(/member
/ZachariahZebadee/)

Follow
(/member
/ZachariahZebadee/)

22

Tags:
without ethernet shield (/tag/type-id/categorytechnology/keyword-without ethernet shield/)
Arduino internet (/tag/type-id/category-technology
/keyword-arduino internet/)

(http://cdn.instructables.com/F0H/OLM0/I6WDMXDI/F0HOLM0I6WDMXDI.LARGE.jpg)

Internet (/tag/type-id/category-technology/keywordinternet/)
Smart House (/tag/type-id/category-technology

Ethernet Shields are a lot of fun, but they can be expensive. In this project I will
show you how to control your Arduino from any computer that is connected to
the internet, without using an Ethernet shield. This project is completely free,
assuming you already have an Arduino.

/keyword-smart house/)
Appliance control (/tag/type-id/category-technology
/keyword-appliance control/)
Control (/tag/type-id/category-technology/keywordcontrol/)

Related

Step 1: Ingredients:

(http://cdn.instructables.com/FVP/43BX/I6WDMPRQ/FVP43BXI6WDMPRQ.LARGE.jpg)

1. An Arduino with USB cable


2. Internet Connected Computer
3. Web Hosting with php support (I use biz.nf for free)
4. Processing App (Which you can get here https://processing.org/download
(https://processing.org/download/) )

Step 2: Getting Starte

Run Ethernet shield on


arduino
(http://www.instructables.com
/id/Run-Ethernet-shieldon-arduino
Smart Home Automation
with Android + Ethernet
Internet + Arduino
(http://www.instructables.com
/id/SmartRemote control via
GPRS/GSM SMS(Arduino)
(http://www.instructables.com
/id/Control-the-relaysvia-GPRSCamera Surveillance
Controller System
(http://www.instructables.com
/id/Camera-SurveillanceController-SystemArduino-controlled Smart
Home
(http://www.instructables.com
/id/Arduino-controlledSmartSee More
(http://www.instructables.com/tag/typeid/?q=&utm_source=base&
utm_medium=related-instructables&
utm_campaign=related_test)

9.3.2015. 8:25

Internet Controlled Arduino (no Ethernet shield)

2 od 6

http://www.instructables.com/id/Internet-Controlled-Arduino-no-Ethern...

(http://cdn.instructables.com/F2Z/C7ET/I6WDMQUD/F2ZC7ETI6WDMQUD.LARGE.jpg)

This is where we add the functionality we want to the Arduino. This part
is very similar to setting up a simple Arduino project; the difference is
the input the arduino receives.
Set up an arduino sketch that does whatever you like upon receiving the input of
a certain character from the serial port. This is done by starting the serial
conversatin with Serial.begin(9600); in the setup. Then in the loop if
(Serial.available() > 0) checks for serial input and Serial.read(); returns a string
of input text. The example I will refer to throughout opens and closes my blinds
for me. You can see that my Arduino will open my blinds upon receiving the
character 2 and will close them upon receiving the character 1.

Step 3: The Internet Side

(http://cdn.instructables.com/F8B/TKZ4/I6WDMTDV/F8BTKZ4I6WDMTDV.LARGE.jpg)

(http://cdn.instructables.com/FYH/F9HD/I6WDMTDU/FYHF9HDI6WDMTDU.LARGE.jpg)

In this step we will create a webpage that takes user input, and using that
input edits a text file on the server.
The website does not not to be complex, it just has to take some input and send
it back to the server for processing. The easiest way to do this is with a get
request. When making the form to receive the input, define method as "get".
My whole HTML consists of just a form.
The form is submitted back to my page itself, and is handled my the PHP. This

9.3.2015. 8:25

Internet Controlled Arduino (no Ethernet shield)

3 od 6

http://www.instructables.com/id/Internet-Controlled-Arduino-no-Ethern...

is where the magic happens. If it receives a get request, it opens my file


Blinds.txt on the server. When it opens the file in the "w" mode it deletes
everything in the file and then writes whatever you tell it to on the blank file. I
have mine write either a one or two, then replace it with a zero after five
seconds. The delay comes from sleep(5);. I have the number, either one or two,
written the the file from only five seconds because I am sure that my Processing
app can detect the change during that interval. I reset it to zero afterwards
because otherwise, if I want to open my shades twice in a row, the second time I
updated Blinds.txt my processing app wouldn't see any difference and therefore
wouldn't do anything.

Step 4: Put it Together with Processing

(http://cdn.instructables.com/FGB/TCWT/I6WDMWY5/FGBTCWTI6WDMWY5.LARGE.jpg)

Processing is a useful little tool that comes in handy when interfacing


the Arduino with the computer (among other times).
The point of the processing app is to retrieve the data from the text file on your
server and feed it, through the serial port, to the Arduino. To send the data we
need the processing serial library. To start we set up the serial port at the same
baud rate as we set the Arduino (9600). In the draw loop we begin by retrieving
the data from my text file using loadstrings("url"); which returns an array of
strings, each element being a line of text from the document. I then parse the
array element into an int so it is a primitive instead of a reference variable, and I
can compare its value. After waiting a second I retrieve another value and if they
are different I know that something has happened and I need to tell my Arduino,
so I send the data using ComPort.write(data);. I also test for nullity throughout
so I do not accidentally pass on misread data.

Step 5: Test It Out!


1. Make sure your Arduino is plugged into your computer
2. Upload Arduino Sketch (You cannot do this while your processing app is
running).
3. Run Processing app
4. Go to your website and submit your forms!

9.3.2015. 8:25

Internet Controlled Arduino (no Ethernet shield)

4 od 6

http://www.instructables.com/id/Internet-Controlled-Arduino-no-Ethern...

We have a be nice comment policy.


Please be positive and constructive.

I Made it!

Add Images

Make Comment

x4junk (/member/x4junk/)
-398 minutes ago
(/member
/x4junk/)

Reply

'Still pre-Arduinoin-action myself,


in the research
phase. But the
Wolfram Data
Drop looks like it
might be an
interesting tool in
this mix.
https://datadrop.wolframcloud.com/
(https://datadrop.wolframcloud.com/

ailsa11 (/member/ailsa11/)

3 minutes ago

Reply

9 hours ago

Reply

1 hour ago

Reply

2 hours ago

Reply

Thanks for Share.....!


(/member
/ailsa11/)

sumondigi (/member/sumondigi/)

great job.what about using a rasberry pi instead of a PC?


(/member
/sumondigi/)

artaex (/member/artaex/)

sumondigi

Good suggestion, but an ethernet shield is cheaper.


(/member
/artaex/)

artaex (/member/artaex/)

(/member
/artaex/)

Ethernet shield expensive? They cost around $10... That's a lot cheaper than
the electricity required to power a computer 24/7.

econjack (/member/econjack/)

(/member
/econjack/)

2 hours ago

Reply

Good intro to the Internet of Things. I'm not sure how this statement would
work correctly:
int key = Serial.read();
If you touch the '1' key, the computer sends the ASCII code for 1, which is
actually 49 expressed as an integer. The easiest way to fix this is:
int key = Serial.read() - '0'; // Subtract ASCII code for zero
Because the ASCII code for zero is 48, then the digit character '1 becomes:
int key = 49 - 48;
key = 1;
which would work correctly. I would also add these two lines to the very top of
the program:
#define CLOSEBLINDS 1
#define OPENBLINDS 2
and change the if statement code to:
switch (key) {
case CLOSEBLINDS:
Close();
break;
case OPENBLINDS:
Open();

9.3.2015. 8:25

Internet Controlled Arduino (no Ethernet shield)

5 od 6

http://www.instructables.com/id/Internet-Controlled-Arduino-no-Ethern...

break;
default:
Serial.println("Unresolved state, shouldn't be here!");
break;
}
I find a switch/case much easier to read once you get rid of the magic numbers
for 1 and 2, plus it makes it easy to add new commands.

3 hours ago

stannickel (/member/stannickel/)

Reply

I have absolutely got to try this. It opens up a whole world of interesting


(/member projects!
/stannickel/)

3 hours ago

lzu (/member/lzu/)

Reply

Very nice. I suggest you to take a look also here: www.ardulink.org


(http://www.ardulink.org)

(/member
/lzu/)

It's my java library you can use instead of Processing. With Ardulink, for
example, you can connect a single PC to several Arduino board with a
bluetooth connection that is cheaper.

4 hours ago

anode505 (/member/anode505/)

Reply

Where's the security? The whole Internet of (Insecure) Things.


(/member
/anode505/)PHP

is inherently insecure. You need to jump through hoops to make it


secure. (but reasonably possible)

anandchauhan2k6 (/member/anandchauhan2k6/)

4 hours ago

Reply

yesterday

Reply

Great attempt for beginners. Thanks for sharing.


(/member
/anandchauhan2k6/)

pelegren (/member/pelegren/)

(/member
/pelegren/)

nice ible but here's the catch... arduino needs to be connected to the
computer at all times.... OBVIOUSLY, ETHERNET SHIELD IS CHEAPER
THAN PC or LAPTOP!!!

rocketman221 (/member/rocketman221/)

pelegren

12 hours ago

Reply

That's not a problem if you already have a server that runs 24/7. You
also modify this to work with a router running the openwrt
firmware as long as it has a serial port.

(/member could
/rocketman221/)

russ_hensel (/member/russ_hensel/)

rocketman221

15 hours ago

Reply

But your opening picture suggest that you really need about a dozen
all around the house.

(/member computers
/russ_hensel/)

snoop911 (/member/snoop911/)

yesterday

Reply

Great work!
(/member
/snoop911/) There's

also something called SLIP, that allows an embedded device like the
Arduino to talk TCP/IP using an RS232 cable.
I haven't been able to get it to work, and haven't found an instructable for it,
but perhaps someone else has better luck!

lightakesally (/member/lightakesally/)

cool

9.3.2015. 8:25

Internet Controlled Arduino (no Ethernet shield)

6 od 6

http://www.instructables.com/id/Internet-Controlled-Arduino-no-Ethern...
yesterday

Reply

(/member
/lightakesally/)

jamshaid,shahid (/member/jamshaid%2Cshahid/)

yesterday

Reply

yesterday

Reply

nice instructable
(/member
/jamshaid%2Cshahid/)

tomatoskins (/member/tomatoskins/)

This is so cool! I've never seen anyone interface an arduino without an


shield. before.

(/member ethernet
/tomatoskins/)

About Us

Find Us

Who We Are (/about/)

Facebook (http://www.facebook.com/instructables)

Advertise (/advertise/)

Youtube (http://www.youtube.com/user/instructablestv)

Contact (/about/contact.jsp)

Twitter (http://www.twitter.com/instructables)

Jobs (/community/Positions-available-at-Instructables/)
Help (/id/how-to-write-a-great-instructable/)

Pinterest (http://www.pinterest.com/instructables)
Google+ (https://plus.google.com/+instructables)
Tumblr (http://instructables.tumblr.com)

Resources

Mobile

For Teachers (/teachers/)

Download our new apps for iOS,


Android and Windows 8!

Artists in Residence Join


(http://www.autodesk.com/artist-in-residence/home)
Join!
our newsletter:

English

Gift Pro Account (/account/give?sourcea=footer)


Forums (/community/)
Answers
(/tag/type-question/?sort=RECENT)
Terms
of Service
(http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=21959721) |
SitemapStatement
(/sitemap/)
Privacy
(http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=21292079) |

Android (https://play.google.com/store
/apps/details?id=com.adsk.instructables)
iOS (https://itunes.apple.com

Legal Notices & Trademarks (http://usa.autodesk.com/legal-notices-trademarks/) | Mobile Site (http://m.instructables.com)


/app/instructables/id586765571)
(http://usa.autodesk.com/adsk/servlet/pc/index?id=20781545&siteID=123112)
2014 Autodesk, Inc.

Windows
(http://apps.microsoft.com
/windows/en-us/app/7afc8194c771-441a9590-54250d6a8300)

Go Pro Today (/account/gopro?sourcea=footer)

We're Hiring! (/community/Positions-available-at-Instructables/)

9.3.2015. 8:25

You might also like