In this lesson, we will use this IoT kit to remotely monitor the home environmental temperature and humidity, and display the data to the Blynk APP.
First, please insert the ESP8266 wifi Shield into your OSOYOO Basic board,
Build the circuit as below:
Connect your DHT11 with mainboard as following diagram, Data pin connects to D2
Prerequisite:
You need to install Local Blynk Server, Blynk APP, Arduino IDE, Blynk Libraries before running the code of this lesson. We suppose you have installed them in previous lessons. If you haven’t done these installations, please read following lesson links:
You also need to download following DHT11 from following link:
In Arduino IDE, click Sketch->Include Library ->Add .ZIP library and upload the library zip files to the IDE.
Download and Edit Blynk4.ino Arduino Code File
Step 1 ) After installing above library, please download the code from following link, unzip it:
https://osoyoo.com/driver/blynk/blynk4.zip
unzip the file and double click the blynk4.ino file.
You can also open the blynk4.ino in IDE: Click file -> click Open -> choose code “blynk4.ino”
Step 2) Open Arduino IDE: Choose corresponding board type and port type for you project.
Note: In the sketch , find these lines as following:
char auth[] =”0ByWpc50cmOJ5O6OyHMaK4OSHkDvUeI-”;
char server_ip[]=”192.168.1.81″; // replace this line with your Blynk Server IP addres
Replace 0ByWpc50cmOJ5O6OyHMaK4OSHkDvUeI- with your local Blynk Token.
Replace 192.168.1.81 with your local Blynk Server LAN IP address.
If you don’t know how to get token and Server IP address, read this article.
find following lins and replace *** with your wifi ssid/password
char ssid[] = "***";//replace this line with your wifi ssid
char pass[] = "***"; //replace this line with your wifi password
Upload the sketch to the board. Wait until you see something like this:
Done uploading
Now open your Serial Monitor, you will see Arduino is trying to talk to Blynk server. After 20 to 30 seconds, your Serial monitor will finally shows Arduino’s IP address and a “Ready (ping: 25ms)” ending message.
Congratulations! You are all ready! Your hardware is now connected to the Blynk server.
Open your project page and press the “+” button to add the “LCD” Widget.
Widget settings:
Name Column: You can name your widget, whatever you like.
PIN V5, value: H
PIN V6, value: T
Here, you can try to change the LCD Widget to Labeled Value Widget by yourself, so that you can add the symbols of the corresponding data, but you need more Blynk energy.
After you finished all above operations, press the “▷“ 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.
Now, you can see the temperature and humidity remotely!
If you find the device is offline, please check your code, wiring and app settings, and try again.
DownLoad Url osoyoo.com