Forum >Control your relay remotely and in real time with the Arduino UNO and W5100.
General

Control your relay remotely and in real time with the Arduino UNO and W5100.

userHead xjme 2014-05-29 17:49:16 3577 Views0 Replies

https://www.youtube.com/watch?v=b3N1Z-3 ... e=youtu.be

This tutorial introduces how to control your relay using devicebit.com. Follow the instruction, and you will see how simple it can be.

Note: The DeviceBit E-KIT used in this tutorial is a board including an Arduino UNO and W5100. You can use Arduino UNO+W5100 to replace the DeviceBit E-KIT. 

You need the following devices and an account:
1. DeviceBit E-KIT(X1) with quick-plug-shield

[img]

2. 5v relay (X1) Purchase link:
http://www.dfrobot.com/index.php?oute=p ... 2HHCvmSyo0
[img]http://www.devicebit.com/userfiles/E-kit/Snap40.jpg[/img]


3. An account on DeviceBit.com (http://www.devicebit.com/home/login)

[img]http://www.devicebit.com/UserFiles/WIFI ... Snap13.jpg[/img]

You need to make these things ready:
1. Add a controller on the website, and set its name to relay just below your device 01. Remember to tick YES for Controllable because we’ll control our device now. The API Address is default. Edit the name to relay, for we will need them in our codes later.

[img]http://www.devicebit.com/userfiles/E-kit/Snap42.jpg[/img]

[img]http://www.devicebit.com/userfiles/E-kit/Snap44.jpg[/img]

2. Download the arduino IDE from www.arduino.cc . Remember to select the version 1.0.5, not the lastest version 1.5.0 by now.

3. Plug E-KIT to usb port and installed the drivers using the Arduino UNO.

OK, here comes the tutorial.
1. Download library from github.com for free:
https://github.com/DevicebitDemo/DeviceBitTcpClient

Put them to your arduino library directory,such as d:arduinolibraries

2. Open arduino IDE now,
select File->Examples->DeviceBitTcpClient->userSwitch_revertControl
replace “YOUR_API_KEY_HERE” with your user key in the user center of DeviceBit My account->Account settings.

[img]http://www.devicebit.com/UserFiles/E-kit/Snap39.jpg[/img]

3. Connect 5v relay data wire to the shield D6 (not Analog foot).
[img]http://www.devicebit.com/userfiles/E-kit/Snap45.jpg[/img]


4. Upload codes to E-KIT, and plug network cable to E-KIT. Your relay is controllable on website now.

[img]http://www.devicebit.com/userfiles/E-kit/Snap41.jpg[/img]

More tutorials later.

Tips:
1 You can control your relay via your mobile phone by visiting m.devicebit.com.
2 For more practical functions of DeviceBit, please refer to http://www.devicebit.com/dev/doc/167.