Buy from US | Buy from UK | Buy from DE | Buy from IT | Buy from FR | Buy from ES | ここでご購入を! |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
In this lesson, we’ll learn how use Cell Phone APP to control a relay switch to turn on/off an LED.
Relay is switch which is turn on/off a high voltage circuit with low voltage signal. We often use relay to control 110V or 220 V devices in home and office.
First, please insert the ESP8266 wifi Shield into your OSOYOO Basic board,
OSOYOO Basic Board | Relay |
D9 | S |
GND | GND |
5V | VCC |
Software Installation:
Step A) Install latest IDE from https://www.arduino.cc/en/Main/Software?setlang=en. If you have IDE version after 1.1.16, please skip this step).
Step B) Connect the OSOYOO Basic board to computer via USB cable,
Step C) Open the IDE and choose corresponding board type and port type for you project.
Step D) Download the sketch file from : https://osoyoo.com/driver/wifi-iot/lesson11/esp8266-lesson11B.zip
unzip the file and double click the esp8266-lesson11B.ino file, load the sketch into IDE, find following lines:
char ssid[] = "******"; // your network SSID (name) char pass[] = "******"; // your network password
please replace the ****** with your correct wifi SSID and password, otherwise your project can not connect to Internet.
Step E) After change above lines, load the sketch into IDE.
STEP F)Open your Serial Monitor, you can see your router will assign an IP address to your IDE as following:
please set your UDP APP target IP to: 192.168.50.47 target port 8888
In above example, 192.168.50.47 is the IP address of my mainboard and 8888 is the UDP port number which will be set into our cell phone APP in next step.
Step G) Open your OSOYOO IOT UDP Robot APP , If you haven’t installed this APP, please read APP installation section in Lesson 2
Step H)Make sure your Cell phone is in the same Local Network of Arduino. Open the APP, click Settings, enter your Arduino IP address from Step F and Port to 8888 in settings:
Notes:When the phone is operating the APP,Please keep the phone on the same LAN with UNO board .
Now click Save and go back to your APP Home Screen:
Press F1 , Your Relay will open and LED will on. Press F2, Your relay and LED will turn off
DownLoad Url osoyoo.com