What's new

Help Arduino IOT

Ve3

Eternal Poster
Established
Joined
Apr 21, 2017
Posts
1,224
Solutions
1
Reaction
293
Points
451
Hello, hindi naba working ang Blynk IOT via Serial USB?
Hindi ko na po kasi mapagana, kung hindi baka may suggestions kayo po. Ang gusto ng prof ko sa Smoke Detector na project ko mag di-display ung date and time pag naka detect ng smoke.

Please help
 
Hello! I'm sorry to hear that you're having trouble getting Blynk IOT to work via Serial USB. Here are some suggestions that might help you:

1. Make sure that you have installed the Blynk library properly in your Arduino IDE. You can check this by going to Sketch > Include Library > Manage Libraries and then searching for "Blynk". Make sure that the library is installed and up to date.

2. Check your wiring connections. Make sure that your Arduino board is connected to your computer via USB and that your sensors are properly connected to your board.

3. Double-check your code. Make sure that you have set up your Blynk widgets and virtual pins correctly. Also, make sure that you have included the necessary Blynk and Wi-Fi credentials in your code.

4. Try using the Blynk app instead of Serial USB. You can download the app on your smartphone or tablet and then connect it to your Arduino board via Wi-Fi. This method is usually more reliable and easier to use.

As for displaying the date and time when smoke is detected, you can use an RTC (Real Time Clock) module to keep track of the time. You can then display the time on your Blynk app using a Timer widget. Here's an example code:

Code:
#include <Wire.h>
#include <RTClib.h>
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

char auth[] = "your_blynk_auth_token";
char ssid[] = "your_wifi_ssid";
char pass[] = "your_wifi_password";

RTC_DS1307 rtc;

BlynkTimer timer;

void setup() {
  Serial.begin(9600);
  Blynk.begin(auth, ssid, pass);
  Wire.begin();
  rtc.begin();

  timer.setInterval(1000L, displayTime); // update time every second
}

void loop() {
  Blynk.run();
  timer.run();
}

void displayTime() {
  DateTime now = rtc.now();
  String time = String(now.hour()) + ":" + String(now.minute()) + ":" + String(now.second());
  Blynk.virtualWrite(V1, time); // display time on V1 widget
}

void detectSmoke() {
  // code to detect smoke
  // if smoke is detected, display the time
  displayTime();
}

In this example code, the RTC module is connected to the I2C pins of the Arduino board. The displayTime() function gets the current time from the RTC module and then sends it to the Blynk app using the Blynk.virtualWrite() function. You can call this function whenever smoke is detected in your detectSmoke() function.
 
Hello! I'm sorry to hear that you're having trouble getting Blynk IOT to work via Serial USB. Here are some suggestions that might help you:

1. Make sure that you have installed the Blynk library properly in your Arduino IDE. You can check this by going to Sketch > Include Library > Manage Libraries and then searching for "Blynk". Make sure that the library is installed and up to date.

2. Check your wiring connections. Make sure that your Arduino board is connected to your computer via USB and that your sensors are properly connected to your board.

3. Double-check your code. Make sure that you have set up your Blynk widgets and virtual pins correctly. Also, make sure that you have included the necessary Blynk and Wi-Fi credentials in your code.

4. Try using the Blynk app instead of Serial USB. You can download the app on your smartphone or tablet and then connect it to your Arduino board via Wi-Fi. This method is usually more reliable and easier to use.

As for displaying the date and time when smoke is detected, you can use an RTC (Real Time Clock) module to keep track of the time. You can then display the time on your Blynk app using a Timer widget. Here's an example code:

Code:
#include <Wire.h>
#include <RTClib.h>
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

char auth[] = "your_blynk_auth_token";
char ssid[] = "your_wifi_ssid";
char pass[] = "your_wifi_password";

RTC_DS1307 rtc;

BlynkTimer timer;

void setup() {
  Serial.begin(9600);
  Blynk.begin(auth, ssid, pass);
  Wire.begin();
  rtc.begin();

  timer.setInterval(1000L, displayTime); // update time every second
}

void loop() {
  Blynk.run();
  timer.run();
}

void displayTime() {
  DateTime now = rtc.now();
  String time = String(now.hour()) + ":" + String(now.minute()) + ":" + String(now.second());
  Blynk.virtualWrite(V1, time); // display time on V1 widget
}

void detectSmoke() {
  // code to detect smoke
  // if smoke is detected, display the time
  displayTime();
}

In this example code, the RTC module is connected to the I2C pins of the Arduino board. The displayTime() function gets the current time from the RTC module and then sends it to the Blynk app using the Blynk.virtualWrite() function. You can call this function whenever smoke is detected in your detectSmoke() function.
My device is Arduino Uno r3 i think it has no wifi connectivity
 
My device is Arduino Uno r3 i think it has no wifi connectivity
I apologize for the confusion in my previous response. You are correct that the Arduino Uno R3 does not have built-in Wi-Fi connectivity. In that case, you will need to use some external Wi-Fi module or shield in order to connect it to the internet and use Blynk.

One option is to use the ESP8266 Wi-Fi module which can be easily connected to the Arduino Uno R3. Here's an example code that demonstrates how to use the ESP8266 module with Blynk:

Code:
#include <SoftwareSerial.h>
#include <ESP8266WiFi.h>
#include <BlynkSimpleShieldEsp8266.h>

char auth[] = "your_blynk_auth_token";
char ssid[] = "your_wifi_ssid";
char pass[] = "your_wifi_password";

SoftwareSerial EspSerial(2, 3); // RX, TX
ESP8266WiFiClass WiFi(EspSerial);
BlynkTransportShieldEsp8266 EspTransport(EspSerial);
BlynkWifi Blynk(EspTransport);

void setup() {
  Serial.begin(9600);
  EspSerial.begin(9600);
  delay(10);
  Blynk.begin(auth, WiFi, ssid, pass);
}

void loop() {
  Blynk.run();
}

void detectSmoke() {
  // code to detect smoke
  // if smoke is detected, send data to Blynk
  Blynk.virtualWrite(V1, "Smoke Detected");
}

In this example code, the ESP8266 module is connected to pins 2 and 3 of the Arduino Uno R3 board. The code uses the BlynkSimpleShieldEsp8266 library to connect to the Blynk server via Wi-Fi.

To display the date and time when smoke is detected, you can use an RTC (Real Time Clock) module as I mentioned in my previous response. You can connect the RTC module to the Arduino Uno R3 using the I2C pins (A4 and A5). Here's an updated example code that includes the RTC module:

Code:
#include <SoftwareSerial.h>
#include <ESP8266WiFi.h>
#include <BlynkSimpleShieldEsp8266.h>
#include <Wire.h>
#include <RTClib.h>

char auth[] = "your_blynk_auth_token";
char ssid[] = "your_wifi_ssid";
char pass[] = "your_wifi_password";

SoftwareSerial EspSerial(2, 3); // RX, TX
ESP8266WiFiClass WiFi(EspSerial);
BlynkTransportShieldEsp8266 EspTransport(EspSerial);
BlynkWifi Blynk(EspTransport);

RTC_DS1307 rtc;

BlynkTimer timer;

void setup() {
  Serial.begin(9600);
  EspSerial.begin(9600);
  Wire.begin();
  rtc.begin();
  delay(10);
  Blynk.begin(auth, WiFi, ssid, pass);

  timer.setInterval(1000L, displayTime); // update time every second
}

void loop() {
  Blynk.run();
  timer.run();
}

void displayTime() {
  DateTime now = rtc.now();
  String time = String(now.hour()) + ":" + String(now.minute()) + ":" + String(now.second());
  Blynk.virtualWrite(V1, time); // display time on V1 widget
}

void detectSmoke() {
  // code to detect smoke
  // if smoke is detected, display the time and send data to Blynk
  displayTime();
  Blynk.virtualWrite(V2, "Smoke Detected");
}

In this updated example code, the RTC module is connected to the I2C pins (A4 and A5) of the Arduino Uno R3 board. The displayTime() function gets the current time from the RTC module and sends it to the Blynk app using the Blynk.virtualWrite() function. You can call this function whenever smoke is detected in your detectSmoke() function.
 
I apologize for the confusion in my previous response. You are correct that the Arduino Uno R3 does not have built-in Wi-Fi connectivity. In that case, you will need to use some external Wi-Fi module or shield in order to connect it to the internet and use Blynk.

One option is to use the ESP8266 Wi-Fi module which can be easily connected to the Arduino Uno R3. Here's an example code that demonstrates how to use the ESP8266 module with Blynk:

Code:
#include <SoftwareSerial.h>
#include <ESP8266WiFi.h>
#include <BlynkSimpleShieldEsp8266.h>

char auth[] = "your_blynk_auth_token";
char ssid[] = "your_wifi_ssid";
char pass[] = "your_wifi_password";

SoftwareSerial EspSerial(2, 3); // RX, TX
ESP8266WiFiClass WiFi(EspSerial);
BlynkTransportShieldEsp8266 EspTransport(EspSerial);
BlynkWifi Blynk(EspTransport);

void setup() {
  Serial.begin(9600);
  EspSerial.begin(9600);
  delay(10);
  Blynk.begin(auth, WiFi, ssid, pass);
}

void loop() {
  Blynk.run();
}

void detectSmoke() {
  // code to detect smoke
  // if smoke is detected, send data to Blynk
  Blynk.virtualWrite(V1, "Smoke Detected");
}

In this example code, the ESP8266 module is connected to pins 2 and 3 of the Arduino Uno R3 board. The code uses the BlynkSimpleShieldEsp8266 library to connect to the Blynk server via Wi-Fi.

To display the date and time when smoke is detected, you can use an RTC (Real Time Clock) module as I mentioned in my previous response. You can connect the RTC module to the Arduino Uno R3 using the I2C pins (A4 and A5). Here's an updated example code that includes the RTC module:

Code:
#include <SoftwareSerial.h>
#include <ESP8266WiFi.h>
#include <BlynkSimpleShieldEsp8266.h>
#include <Wire.h>
#include <RTClib.h>

char auth[] = "your_blynk_auth_token";
char ssid[] = "your_wifi_ssid";
char pass[] = "your_wifi_password";

SoftwareSerial EspSerial(2, 3); // RX, TX
ESP8266WiFiClass WiFi(EspSerial);
BlynkTransportShieldEsp8266 EspTransport(EspSerial);
BlynkWifi Blynk(EspTransport);

RTC_DS1307 rtc;

BlynkTimer timer;

void setup() {
  Serial.begin(9600);
  EspSerial.begin(9600);
  Wire.begin();
  rtc.begin();
  delay(10);
  Blynk.begin(auth, WiFi, ssid, pass);

  timer.setInterval(1000L, displayTime); // update time every second
}

void loop() {
  Blynk.run();
  timer.run();
}

void displayTime() {
  DateTime now = rtc.now();
  String time = String(now.hour()) + ":" + String(now.minute()) + ":" + String(now.second());
  Blynk.virtualWrite(V1, time); // display time on V1 widget
}

void detectSmoke() {
  // code to detect smoke
  // if smoke is detected, display the time and send data to Blynk
  displayTime();
  Blynk.virtualWrite(V2, "Smoke Detected");
}

In this updated example code, the RTC module is connected to the I2C pins (A4 and A5) of the Arduino Uno R3 board. The displayTime() function gets the current time from the RTC module and sends it to the Blynk app using the Blynk.virtualWrite() function. You can call this function whenever smoke is detected in your detectSmoke() function.
Is there no other way to use this feature like Connect using usb only? I don't have any module :(
 
Is there no other way to use this feature like Connect using usb only? I don't have any module :(
If you don't have any external Wi-Fi module or shield, you can still use Blynk to communicate with your Arduino Uno over USB. However, you will need to modify your Blynk code to use the Serial connection instead of Wi-Fi.

Here's an example code that demonstrates how to use Blynk over Serial:

Code:
#include <SoftwareSerial.h>
#include <BlynkSimpleSerial.h>

char auth[] = "your_blynk_auth_token";

SoftwareSerial SerialBLE(10, 11); // RX, TX

void setup() {
  Serial.begin(9600);
  SerialBLE.begin(9600);
  Blynk.begin(SerialBLE, auth);
}

void loop() {
  Blynk.run();
}

void detectSmoke() {
  // code to detect smoke
  // if smoke is detected, send data to Blynk
  Blynk.virtualWrite(V1, "Smoke Detected");
}

In this example code, the BlynkSimpleSerial library is used to establish a connection between the
 
Need mo nang rtc module lods tas syempre ung smoke detector mo lagyan muna lang ng condition na pag may na detect ni smoke detect is mag display ung date sa lcd mo.. di naman ata need ng database yan
 
end na yung blynk legacy ts. ang meron na yung blynk 2.0. pwede ka magblynk legacy pero gamit ka ng low version na app tapos lagay ka nalang ng custom server sa github may makikita ka dun. alam ko di mo na need ng rtc kapag ganyan may sariling component si blynk ng rtc kukuha sya sa web ng time. need lang connected sa internet
 

Similar threads

Back
Top