Control an LED using Internet

A guide to start your Internet of Things
Home / Blog / Control an LED using Internet

Start your IoT today

Internet of Things, a common word heard by all techies every day. Many people may still have doubts about what is the internet of things, how to implement it? If you too think so, then this is the right place to know.
Internet of Things (IoT), in simple terms, means an environment in which objects, animals and people are provided with unique identifiers and the ability to transfer data over a network without requiring human-to-human or human-to-computer interaction. This area of science has a wide variety of applications in healthcare, home and industrial automation, automotive systems, smart energy systems and many more.
Do you like to know how the signal transfer happens, how the communication establishes between different objects and people using Internet?
Let's get started. Have a glance at this simple project which will help you to control a led using a Local Area Connection.
Step 1:Hardware and Software Needed
Software specifications:
A PC with the windows OS and Arduino 1.6.7 IDE installed in it.
Hardware requirements:
1. Arduino UNO.
2. Arduino Ethernet Shield (Wiznet W5100 based which is compatible with Arduino Uno).
3. A Wifi Modem.
4. USB to USART cable.
5. Ethernet Cable.
6. An led.
Step 2:Connections
1. Mount the Ethernet Shield onto your Arduino UNO.
2. Connect the led to the Ethernet shield such that anode of the led goes to digital pin(here the digital pin 5. You can change it in the code.) and cathode to the ground pin.
3. Connect the Arduino UNO to your PC using USB to USART cable.
4. Connect one end of the Ethernet cable to the Ethernet shield and other to your wifi modem.
NOTE: Do not attempt to control the pins used by the SPI bus or 0,1,4,10,11,12 and 13 pins.

Step 3: Heart of the project
The remaining part is to write the code and execute the project.
Of course, the code is a mixture of C, HTML, Javascript, JQuery.
Now open your Arduino IDE, select the Arduino UNO board from tools and also select the port to which the board the connected, compile and upload the code. Don't worry, the code is attached below. Connect led to the 5th digital pin (here pin 5. You can change it in the code) of the Arduino. Open the serial monitor where you can see the IP address at which the server is present. Enter that IP Address in your web browser. Then you can see a web page displayed with a toggle button. That's all. We are at the climax. Once you click the toggle button, the led glows. Click it once again to turn off the led.
I think now you got an idea, how to transfer a signal through the internet. Similarly, you can receive the data from Arduino to web page so that you can know the status of the pins. You can extend the same to recognise the voice, change the status of the devices, control the electrical and electronic devices, manage the things for better and efficient energy management. It entirely depends on what's the requirement and how to modify the code.
Why late? Start trying something new. All the best.
You can always feel free to contact us if you have any doubts.

Download Source Code