Book Image

Arduino Networking

By : Marco Schwartz
Book Image

Arduino Networking

By: Marco Schwartz

Overview of this book

Table of Contents (13 chapters)

Controlling the relay from anywhere


In the last section of this chapter, we are going to take another approach. So far, we have a server running on our Arduino board, which can receive commands from any device on your local network. However, this is not convenient if you want to control a device from anywhere in the world. For example, you want to activate a lamp in your home at given intervals when you are away from your home.

To do so, we are going to use the Teleduino service, which allows you to do exactly that. The Arduino Ethernet shield will be constantly connected to this service, so you can transmit commands to the board from anywhere in the world if you have an Internet connection. We are going to build a new sketch for the Arduino board and then adapt the interface accordingly, so you can control the relay from anywhere in the world right from your web browser.

You first need to include the required libraries:

#include <EEPROM.h>
#include <Servo.h>
#include <Wire.h...