Here, we will show how to use OSOYOO Smart Home IoT Kit with Blynk APP to control some electronic devices, such as leds, active buzzers, fan modules,relay modules, etc.
In this lesson, we will learn how to use Blynk to remotely turn on or turn off the LED and control the brightness of the LED. . . Using the same principle, you can also control other electronic devices
First, please plug OSOYOO MEGA-IoT Extension Board into MEGA2560 board:
Make sure that jumper caps in following red circle are installed. These two jumper caps connect A9 to ESP_TX and A8 to ESP_RX.
Connect the LED Module to the D2 port as below:
Google Play and Apple Store do not support Blynk Legacy APP downloading anymore. But Android Mobile Device can still download the apk file from the following link:
https://osoyoo.com/driver/blynk/blynk_legacy.apk
You also need to get your Blynk Server local IP address, create a new project and get Blynk Token.If you haven’t done above tasks yet, please read following tutorial to complete the tasks:
https://osoyoo.com/2021/01/15/how-to-install-a-local-blynk-server-in-your-pc-and-get-a-local-blynk-token/
To install above two zip files, please need go to Arduino IDE ->Sketch ->Include Library ->Add ,Zip library to load above zip files into Arduino IDE.
Download , Edit and Run lesson2-1 Arduino Code
Step 1) Please download the code from following link, unzip it:
https://osoyoo.com/driver/Smart_House_IoT_Learning_Kit_V2.0_code/Lesson2-1.zip
Step 2) After above operations are completed, connect OSOYOO MEGA2560 Board to PC with USB cable.
Step 6 Open Arduino IDE: Choose corresponding board type and port type for you project .
Step 7 Arduino IDE: Click file – Open, then choose code in the folder, load up the sketch onto your Arduino.
Note: In the sketch, find these lines 13 as following:
char auth[] =”sM1i_rSJjDlQxesfuhOzrL0h9NiivJkn”;
Replace sM1i_rSJjDlQxesfuhOzrL0h9NiivJkn with your local Blynk Token. If you don’t know how to get token, read this article.
Then find lines 22 23 24 and replace your wifi ssid/password and your blynk server IP address
char ssid[] = "***";//replace this line with your wifi ssid
char pass[] = "***"; //replace this line with your wifi password
char server_ip[]="192.168.1.81"; // replace this line with your Blynk Server IP address
Upload the sketch to the board. Wait until you see something like this:
Done uploading
Now open Serial monitor in the upper right corner, you should see your Arduino IP address and Ready message as following:
Congratulations! You are all ready! Your hardware is now connected to the Blynk cloud!
If you can’t see your IP address, please check your WIFI SSID/Password setting in your code, If you can see IP address but no Ready message, please check your Blynk Token and Local Server IP address are correctly updated in your code file.
Open your project page and press the “+” button to add the “Button” Widget.
Button Widget settings:
Name Column: You can name your button widget, whatever you like.
OUTPUT: D2 | 0-1
MODE: We choose the Switch mode here.
You can modify other options according to your own habits or keep them as default.
Then back to the project page. and press the “▷” button to start your project.
Press the Button on the project page and you will find that the LED connected to D2 has been lit.
Press the Button again, the LED will be extinguished.
While in PLAY mode, you won’t be able to drag or set up new widgets, press “□” and get back to EDIT mode.
If you find the device is offline, please check your code, wiring and app settings, and try again.
In this section we will introduce how to control the brightness of the light through this kit and Blynk APP.
The wiring and code of this experiment are the same as the previous part, we only need to add a new widget.
Open your project page and press the “+” button to add the “Slider” Widget.
Slider Widget settings:
Name Column: You can name your button widget, whatever you like.
OUTPUT: D2 | 0-255
You can modify other options according to your own habits or keep them as default.
After you finished all above operations,open the Serial Monitor and you will see the connection situation,then open the Blynk APP, press the PLAY button “▷“. This will switch you from EDIT mode to PLAY mode where you can interact with the hardware.
While in PLAY mode, you won’t be able to drag or set up new widgets, press “□” and get back to EDIT mode.
Slide the slider to change the brightness of the LED module connected to D2. When the slider is on the far left, the LED is off, and when the slider is on the far right, the LED is brightest.
If you find the device is offline, please check your code, wiring and app settings, and try again.
No. | Picture | Device | Qty. | Link |
1 | OSOYOO MEGA2560 Board | 1 | Click here to buy | |
2 | OSOYOO MEGA-IoT Extension Board | 1 | Click here to buy | |
3 | Photosensitive Sensor | 1 | Click here to buy | |
4 | Temp & Hum Sensor | 1 | Click here to buy | |
5 | OSOYOO Active Buzzer Module | 1 | Click here to buy | |
6 | Flame Detection Sensor | 1 | Click here to buy | |
7 | Fan Motor Module | 1 | Click here to buy | |
8 | Micro Servo Motor | 1 | Click here to buy | |
9 | RGB Module | 1 | Click here to buy | |
10 | Ultrasonic Sensor | 1 | Click here to buy | |
11 | PIR Motion Sensor | 1 | Click here to buy | |
12 | Microphone Module | 1 | Click here to buy | |
13 | 1602 I2C LCD Screen | 1 | Click here to buy | |
14 | RFID Module | 1 | Click here to buy | |
15 | White LED Module | 1 | Click here to buy | |
16 | Red LED Module | 1 | Click here to buy | |
17 | Colorful Light | 1 | Click here to buy | |
18 | Red Button Module | 1 | Click here to buy | |
19 | Blue Button Module | 1 | Click here to buy | |
20 | Philips Screwdriver | 1 | Click here to buy |
DownLoad Url osoyoo.com
You must be logged in to post a comment.
Hello,
When I try to connect the ESP to the Wi-Fi I get the following result: [1715] ESP is not responding.
How can I connect it successfully?
Waiting for an answer from you.
Hi Gabi,
1)Please put the two jumper caps to join A9 to ESP_TX , A8 to ESP_RX.
2)Make sure the Every Pin of the Wifi Shield is properly inserted into the MEGA2560 board.Sometimes, if some of the pins of wifi shield are not properly inserted into the MEGA2560, the wifi won’t work.
more detail seting about 1),2),please look at above tutorial at part “How to make”
3)Make sure you have compiled and uploaded the sketch to Arduino IDE properly(IDE must show Done upload!). If there is any error message when
you upload the sketch, please let us know.
After 1),2),3) is completed , your Serial monitor should show the ESP8266 connected to Wifi with IP address.
If still no update, please send email to [email protected] or [email protected].
Best Regards
Susan@OSOYOO support team
Hi Susan,
the 2 jumper caps are well put, all the pins of the card are connected and there is no error on the code but it still does not work.
Best regards
Gabi