Project Description

Description:

1 iot

This Project describes about controlling the Smart Light by using the Arduino Ethernet Shield.The controlling of the Light can be done with the help of Mobile,tablet and the Desktop

Hardware:

Arduino Ethernet

Push button

10K Ohm resistor

LED

Software:

To program your Arduino you need to install the Arduino IDE and the following libraries (if you do not know how to install a library checkout this tutorial)

LIBRARY NOTES
PubSubClient This is a fork of the original PubSubClient setting the max packet size to 512 bytes (needed for Lelylan to work).

Hardware Setup:

This schema represents the led, resistor and pushbutton setup. With this setup each time you press the button, the LED is turned on and off.

Lelylan Setup

Open Lelylan Dashboard and create a new device by following 3 simple steps (if you are new to Lelylan, you can sign up for free).

1) Set a meaningful name (e.g. bedroom light).

2) Choose the device type. For this tutorial choose Basic Light.

What is a type? A type defines what a device is by defining its properties, functions and statuses. For this tutorial you do not need to now more about.

3) Choose “Connect with MQTT” as connectivity option.

In this tutorial we’ll use MQTT, a publish subscribe protocol for the Internet of Things.

4) Get the Device ID and Device Secret.

Once the device is created, click the settings link (placed under the device name) and get the device ID and device secret. You’ll need them in the next section.

Code

Once the (virtual) device is defined on Lelylan you need to make it communicate with Arduino. Copy the sketch below and change the following variables: deviceIddeviceSecretoutTopicinTopic and clientId (it will not take more than one minute).

 

Output:

 

Tags:

201802,W5500,Ethernet,Arduino,Smart Light.

Author:

William Bergamo,Andrea Reginato