Day 7 - Section 4 - Controlling a device

Site: ΕΛ/ΛΑΚ Moodle
Course: Robotics - 3D Printing - Internet of Things
Book: Day 7 - Section 4 - Controlling a device
Printed by: Guest user
Date: Monday, 30 December 2024, 7:42 PM

Description

After the completion of this section the students will be able to:

  • create a new project in Blynk
  • place widgets inside Blynk's desktop
  • adjust Blynk's widgets
  • prepare the code to make our device communicate with the smartphone
  • create a circuit to experiment with blinking a LED via their smartphone

Creating a new project in Blynk

In this section we will learn how to control a remote device using the smartphone

At the beginning we usually plan and design our application, but we can modify or even change anything later. 

As a first application we will control an led that we will connect to our arduino IDE micro controller unit (MCU)

  1. Open the Blynk application of our smartphone
  2. Click on New Project
  3. Write the Project Name : NodeMCU LED
  4. Choose Device : ESP8266
  5. Choose Connection Type : WiFi
  6. Click : Create

At the moment an email was sent to your account with the authentication token of the project but you can find it and copy it or resend it inside the menu project settings


 


es


es2


p


Inside the project

  1. Click on the plus sign 
  2. Select Button
  3. Click on the button
  4. Click on PIN 
  5. Select Digital and GP13
  6. Turn slider to switch
  7. Click on the back button

gg



bbb


hh



Arduino IDE and connections

1.Connect your NodeMCU to your PC

2. Open Arduino IDE

3. Then go to File->Examples->Blynk-Boards_Wifi->Esp8266Standalone



4. Select the correct board (NodeMCU 1.0) and the com port from the Tools Menu

5. Change the credentials to yours. If you don't know them, ask the admins. The auth[] is the key that you received previously on your email. The ssid[] is the name of your WiFi network and the pass[] is the password.

char auth[] = "????????????";

char ssid[] = "XXXXXXXXXX";
char pass[] = "YYYYYYYYYYY";

Finally Save the file and Press Upload.

Also, make the necessary connections to your circuit:

We connected the LED on pin D7 which corresponds to GPIO13.

Now go back to your mobile press Play and......play with the button in Blynk!