Loading...

You have no items in your shopping cart.

 
 
 
×

Registration

Profile Informations

Login Datas

or login

First name is required!
Last name is required!
First name is not valid!
Last name is not valid!
This is not an email address!
Email address is required!
This email is already registered!
Password is required!
Enter a valid password!
Please enter 6 or more characters!
Please enter 16 or less characters!
Passwords are not same!
Terms and Conditions are required!
Email or Password is wrong!
Captcha is required!
Captcha is wrong!

ESP8266: Use Android Phone to Control ITEAD Rboard

Recently, ESP8266 as a low cost wifi module is a hot hacking issue in Hackaday. These days, our engineer Stan Lee has come up with a tutorial to use android phone to control our product Rboard through this mini wifi module.

Rboard is a unique Arduino board which features 4 channels isolated relays, an XBee socket, and an ATMega328. This board will add relay control as well as wireless connectivity to your projects and it will be a possible solution for smart home applications controlling.

For more questions, you can contact with him by sending emails or leave your comment in the end of this blog.

Components we need

1. Upload Demo to the Rboard

Before uploading demo to Rboard, The ESP8266 libraries need to be downloaded from below link and put them into the libraries folder of Arduino IDE.

https://github.com/itead/ITEADLIB-ESP8266

Open file uartWIFI.h and uncomment the definition of UNO as we will use atmega328p to do this tutorial.

	#define UNO
	//#define MEGA

Meanwhile, you should modify the definition of pins _DBG_RXPIN_ and _DBG_TXPIN_ to A0 and A1 respectively as there is no D2 and D3 pin in Rboard.

	#define _DBG_RXPIN_ 14             //A0
	#define _DBG_TXPIN_ 15             //A1

Then save this file.

Download the wifi_rboard demo here, then open it by your Arduino IDE. You need to modify the macro definition of SSID and PASSWORD to your own wifi name and password. For example:

	#define SSID       "Itead_1(Public)"    //type your own SSID name
        #define PASSWORD   "2xxxxx"		//type your own WIFI password 

Plug 9V power adapter to Rboard, and connect FOCA with it. The board type is “Arduino Duemilanove w/ATmega328” and then you can upload the demo to Rboard.

2.Hook up

Unplug FOCA, now you need hook up ESP8266, FOCA and Rboard through dupont lines by following instruction.

ESP8266_TX->D0
ESP8266_RX->D1
ESP8266_CH_PD->3.3V
ESP8266_VCC->3.3V
ESP8266_GND->GND

FOCA_RX->A1
FTDI_TX->A0
FTDI_GND->GND

Then open the Serial monitor, press the reset button in Rboard once, wait for a while, you will see its IP address show. Now you will need an app to realizing wireless control.

3.Install UDP/TCP Server App to the Android Phone

Open Google play app via your android phone, and search for “UDP TCP Server” , and install this app to your phone.

Open this app after installation. Click Settings in the up right corner. Set the Target IP as the wifi IP that has shown on the serial monitor. We are 172.16.1.12 in this blog. UPD/TCP option is TCP, Target Port is 8080, and TCP connection behavior is “Initiate connection, and keep open”.

Then do the Button Settings. Set 8 buttons in this app, they are “CH0ON”, “CH1ON”, “CH2ON”, “CH3ON”, “CH0OFF”, “CH1OFF”, “CH2OFF”, “CH3OFF”, which represent the on and off status for each relay on Rboard.

Return to the main interface, you can see the button names have changed. Press each one of them, you will see the channel setting is in the same with the status of the button.

Now, connect some home applications to this Rboard, you can control them with your android phone!