3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Web Controlled Arduino LED

Web Controlled Arduino LED
This instructable shows you how to build a Web-enabled tri-color LED based on an Arduino and the WIZnet Ethernet shield, controllable from any Web browser .

Check the live demo at http://try.yaler.net/~arduino/led

Because the LED is exposed through a simple RESTful web service running on the Arduino color changes can also be triggered by Pachube or other platforms offering Web hooks. Welcome to the Web of Things ! The LED can of course be replaced by a motor or a high voltage switching relay to enable more interesting browser controlled applications, e.g. for home automation.

Publishing your Arduino through the Yaler relay server makes the Arduino accessible from everywhere even if it is hidden behind a firewall or a NAT and does not have a public IP address. A single Yaler relay server instance can host many Arduinos (and any other device with a TCP Socket library, e.g. a Sheevaplug or an Android phone) and is available for non-commercial use including full source code at http://yaler.org/ (Disclosure: I founded the company developing Yaler)

Material
  • Tri color LED [Ladyada | SparkFun]
  • Arduino Duemilanove ATmega 328 [Ladyada | SparkFun]
  • Arduino WIZnet Ethernet Shield [Ladyada | SparkFun]
  • Resistors [1 x 150 Ohm, 2 x 82 Ohm for the Ladyada LED or
                        1 x 180 Ohm, 2 x 100 Ohm for the SparkFun LED]
  • RJ45 cable
Tools
  • Soldering iron
  • Helping hands
  • A / B USB cable
Infrastructure
  • Internet access with DHCP, no public IP address needed for Arduino
  • (Optional: PC or Cloud Server with a public IP address, to run Yaler)
 
Remove these adsRemove these ads by Signing Up
 

Step 1Soldering resistors and wire to the tri-color LED

Soldering resistors and wire to the tri-color LED
(Note: All images show the Ladyada LED with the corresponding resistors and wire color)
  • Shorten all except for the longest leg of the LED
  • Solder the resistors to the LED legs as shown below
  • Shorten the remaining long leg
  • If you use the Ladyada LED, solder the red wire to it [as shown below]
  • If you use the SparkFun LED, solder the black wire to it

« Previous StepDownload PDFView All StepsNext Step »
38 comments
Apr 22, 2012. 3:31 AMjaypozo says:
Great project, but it doesn't seem to work for me. Everything compiles and I can connect to the Arduino and see the colour select page, but when I click one of the boxes, it doesn't change on the Arduino. Any ideas? I get this output when I hit the page:

n/led/ HTTP/1.1

And this when I click on the RED box:


n/led/led/ff0000 HTTP/1.1
Host: try.yaler.net

It looks like the "isPut" variable never gets set to "true" and so the pins never get set.
Apr 22, 2012. 10:35 AMjaypozo says:
This is the URL I'm using: http://try.yaler.net/gsiot-2fds-hkan/led/
Mar 29, 2012. 7:09 PMcrackHacker says:
ok i can get it to compile and everything but my network keeps showing it as expired on the lease.
Jan 25, 2012. 6:29 PMwhanif says:
I had a problem, when compiling the "HelloTriColorLedYalerService.pde" sketch, the result return with errors and the main error is "cannot declare parameter 'c' to be of abstract type 'client'" can i know why ? I've add the EthernetDHCP into libraries but still produce that error. TQ
Jan 27, 2012. 12:32 AMwhanif says:
Thank you for the reply, I'm now using Arduino Uno Revision 2 and the IDE is version 1.0, for the libraries, it is Version 1.0b4. Thanks in advance...
Jan 27, 2012. 3:58 AMwhanif says:
Ok, thank you for your help...
Jan 29, 2012. 7:33 PMwhanif says:
I've patched my latest Arduino libraries to version 0018 and this error come up -->

sketch_jan30a:-1: error: variable or field 'receiveYalerResponse' declared void
sketch_jan30a:-1: error: 'Client' was not declared in this scope
sketch_jan30a:-1: error: variable or field 'sendPutResponse' declared void
sketch_jan30a:-1: error: 'Client' was not declared in this scope
sketch_jan30a:-1: error: variable or field 'sendGetResponse' declared void
sketch_jan30a:-1: error: 'Client' was not declared in this scope
sketch_jan30a:-1: error: variable or field 'receiveRequest' declared void
sketch_jan30a:-1: error: 'Client' was not declared in this scope
In file included from C:\Documents and Settings\User\Desktop\arduino-1.0\libraries\Ethernet/Ethernet.h:5,
from sketch_jan30a.cpp:29:
C:\Documents and Settings\User\Desktop\arduino-1.0\libraries\Ethernet/Client.h:17: error: conflicting return type specified for 'virtual void Client::write(uint8_t)'
C:\Documents and Settings\User\Desktop\arduino-1.0\hardware\arduino\cores\arduino/Print.h:48: error: overriding 'virtual size_t Print::write(uint8_t)'
C:\Documents and Settings\User\Desktop\arduino-1.0\libraries\Ethernet/Client.h:19: error: conflicting return type specified for 'virtual void Client::write(const uint8_t*, size_t)'
C:\Documents and Settings\User\Desktop\arduino-1.0\hardware\arduino\cores\arduino/Print.h:50: error: overriding 'virtual size_t Print::write(const uint8_t*, size_t)'
In file included from C:\Documents and Settings\User\Desktop\arduino-1.0\libraries\Ethernet/Ethernet.h:6,
from sketch_jan30a.cpp:29:
C:\Documents and Settings\User\Desktop\arduino-1.0\libraries\Ethernet/Server.h:20: error: conflicting return type specified for 'virtual void Server::write(uint8_t)'
C:\Documents and Settings\User\Desktop\arduino-1.0\hardware\arduino\cores\arduino/Print.h:48: error: overriding 'virtual size_t Print::write(uint8_t)'
C:\Documents and Settings\User\Desktop\arduino-1.0\libraries\Ethernet/Server.h:22: error: conflicting return type specified for 'virtual void Server::write(const uint8_t*, size_t)'
C:\Documents and Settings\User\Desktop\arduino-1.0\hardware\arduino\cores\arduino/Print.h:50: error: overriding 'virtual size_t Print::write(const uint8_t*, size_t)'
sketch_jan30a.cpp: In function 'void setup()':
sketch_jan30a:217: error: redefinition of 'void setup()'
sketch_jan30a:2: error: 'void setup()' previously defined here
sketch_jan30a.cpp: In function 'void loop()':
sketch_jan30a:230: error: redefinition of 'void loop()'
sketch_jan30a:7: error: 'void loop()' previously defined here


any ideas ?
Dec 27, 2011. 8:38 PMcvasantrao says:
Looks like try.yaler.net is down again. A very interesting project. Was planning something of the sort
Nov 25, 2011. 5:57 AMamcelmon says:
I have a similar project i'm working on, an alert light based on values in a database. I originally started this project thinking I would be making outbound requests to a webserver, on a timer, from Arduino and switching lights based on the returned values.

Am I better off having having the webserver send simple requests to my Arduino device or the other way around.
Feb 7, 2011. 9:18 PMjcouch1227 says:
Hi, if i wanted to run this same sort of operation over a local network, would an ethernet shield be necessary? I want to control my arduino with a website on an iphone but have no need to do it anywhere in the world :) thanks.
Oct 29, 2011. 10:53 AMa_pineda says:
I had problems with running my own instance and using the "HelloTriColorLedYalerService.pde" arduino code above. To get it to work properly, I had to modify the "parseYalerResponseChar" function as follows to get it to work:

// if (yalerCount == 56) { // sizeof("HTTP/1.1 101 ... \r\n\r\n") - 1
if (yalerCount == 75) { // sizeof("HTTP/1.1 101 ... \r\n\r\n") - 1

Now it works fine. Apparently the returned HTML is longer on the source code version that what comes back from Yaler.net.

Maybe I built the Java source incorrectly, but this fix seems to work for me.

Jul 16, 2011. 9:11 AMtyao says:
Hi, this is a very nice project. May I recommend that you put a income data filter to limit the light options to red, green, and blue. I am currently able to go into Firebug, edit the button commands to send whatever data I want. ie. I set the Green button to send "ffffff" which results a almost white led. OR "000000", which turns off the led. maybe "ff00ff" which would give purple.

overall, this project is very well designed
Jun 12, 2011. 9:11 AMtedlawson says:
Caught my errors ... working nicely. Onward!
Jun 10, 2011. 9:14 PMtedlawson says:
After initial success in duplicated this project, I've been getting the 504 error for the past week. I also tried it using a Mega
Jun 2, 2011. 3:35 PMtedlawson says:
Basically duplicating what you have laid out in your instructions and with the addition of JTV. As I said, I had the basic version running fine. I then inserted the code for JTV and when I invoked try.yaler it came back with the 504 error,,, still does even when I go back to the version described here which was working last Sunday and hasn't since.
Can't get your link above to connect either.
Jun 1, 2011. 8:26 PMtedlawson says:
Was up & running. Now seems I (or your demo) can't connect with Yaler. Is this service intermittent. Have JTV embedded nicely in my web site (tedlawson44.com/catcam/JTV.html), but haven't had a chance to see it in Yaler due to the (disconnect?)
May 28, 2011. 10:36 PMtedlawson says:
I miss your demo. Tried to get this going: substituted my MAC from the Ethernet shield and current IP of 'try.yaler.net" (46.137.106.125) and changed the generic ID. Uploaded OK but cannot connect?
In step 5 you state: "if the Yaler instance at the specified IP address is up and running". Don't really know what this means or how correct it?
Any insight?
Thanks
May 10, 2011. 5:29 PMarduino man says:
This is a lot of fun!!!!

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
16
Followers
4
Author:tamberg