BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Please help show data sensors in app

hi
ineed to showing sensors data on my android app

const int sensor1=A0; // Assigning analog pin A0 to variable 'sensor'
float tempc1;  //variable to store temperature in degree Celsius
float tempvalue1;  //temporary variable to hold sensor reading

const int sensor2=A1; // Assigning analog pin A1 to variable 'sensor'
float tempc2;  //variable to store temperature in degree Celsius
float tempvalue2;

const int sensor3=A2; // Assigning analog pin A2 to variable 'sensor'
float tempc3;  //variable to store temperature in degree Celsius
float tempvalue3;

/* Simple example code for Force Sensitive Resistor (FSR) with Arduino */

int FSRsensor1=A3;// Assigning analog pin A3 to variable 'sensor' //Variable to store FSR value
int fsrVoltage1;     // the analog reading converted to voltage
unsigned long fsrresistance1;  // The voltage converted to resistance, can be very big so make "long"
unsigned long fsrConductance1; 
float FSRforce1; // The resistance converted to force. 
float weight1; // The force converted to weight. 


/* Simple example code for Force Sensitive Resistor (FSR) with Arduino */

int FSRsensor2=A4;// Assigning analog pin A4 to variable 'sensor' //Variable to store FSR value
int fsrVoltage2;     // the analog reading converted to voltage
unsigned long fsrresistance2;  // The voltage converted to resistance, can be very big so make "long"
unsigned long fsrConductance2; 
float FSRforce2; // The resistance converted to force. 
float weight2; // The force converted to weight. 


/* Simple example code for Force Sensitive Resistor (FSR) with Arduino */

int FSRsensor3=A5;// Assigning analog pin A3 to variable 'sensor' //Variable to store FSR value
int fsrVoltage3;     // the analog reading converted to voltage
unsigned long fsrresistance3;  // The voltage converted to resistance, can be very big so make "long"
unsigned long fsrConductance3; 
float FSRforce3; // The resistance converted to force. 
float weight3; // The force converted to weight. 
#include <SoftwareSerial.h>
 SoftwareSerial BTserial(0, 1); // RX | TX

void setup() {

pinMode(sensor1,INPUT); // Configuring pin A0 as input
Serial.begin(9600);

pinMode(sensor2,INPUT); // Configuring pin A1 as input
Serial.begin(9600);

pinMode(sensor3,INPUT); // Configuring pin A2 as input
Serial.begin(9600);

pinMode(FSRsensor1,INPUT); // Configuring pin A3 as input
 // Begin serial communication at a baud rate of 9600:
Serial.begin(9600);

pinMode(FSRsensor2,INPUT); // Configuring pin A3 as input
 // Begin serial communication at a baud rate of 9600:
Serial.begin(9600);

pinMode(FSRsensor3,INPUT); // Configuring pin A3 as input
 // Begin serial communication at a baud rate of 9600:
Serial.begin(9600);

 // HC-06 default serial speed is 9600
  BTserial.begin(9600);  

}

void loop() {
tempvalue1=analogRead(sensor1);
tempvalue1=(tempvalue1*500)/1023;
tempc1=tempvalue1; // Storing value in Degree Celsius
Serial.print("temp 1 in DegreeC =");
Serial.print("\t");
Serial.print(tempc1);
Serial.println();
delay(5000); //Delay of 5 second for ease of viewing



tempvalue2=analogRead(sensor2);
tempvalue2=(tempvalue2*500)/1023;
tempc2=tempvalue2; // Storing value in Degree Celsius
Serial.print("temp 2 in DegreeC =");
Serial.print("\t");
Serial.print(tempc2);
Serial.println();
delay(5000); //Delay of 5 second for ease of viewing 



tempvalue3=analogRead(sensor3);
tempvalue3=(tempvalue3*500)/1023;
tempc3=tempvalue3; // Storing value in Degree Celsius
Serial.print("temp 3 in DegreeC =");
Serial.print("\t");
Serial.print(tempc3);
Serial.println();

delay(5000); //Delay of 5 second for ease of viewing 



// Read the FSR pin and store the output as fsrreading:
int fsrreading1 = analogRead(FSRsensor1);
// Print the fsrreading in the serial monitor:
// Print the string "Analog reading = ".
Serial.print("FSR1 = ");
Serial.print("\t");
// Print the FSR1:
Serial.print(fsrreading1);
Serial.println();


// analog voltage reading ranges from about 0 to 1023 which maps to 0V to 5V (= 5000mV)
fsrVoltage1 = map(fsrreading1, 0, 1023, 0, 5000);
Serial.print("Voltage reading in mV = ");
Serial.println(fsrVoltage1);  
if (fsrVoltage1 == 0) {
Serial.println("No pressure");  
} else {
// The voltage = Vcc * R / (R + FSR) where R = 10K and Vcc = 5V
  // so FSR = ( (Vcc - V) * R) / V
  // fsrVoltage is in millivolts so 5V = 5000mV
  fsrresistance1 = 5000 - fsrVoltage1;     
  fsrresistance1 *= 10000; // 10K resistor
  fsrresistance1 /= fsrVoltage1; // FSR resistance in ohms.

  fsrConductance1 = 1000000; //We measure in micromhos.
  fsrConductance1 /= fsrresistance1; //Conductance in microMhos.


  // Calculate the force.     
   FSRforce1 = fsrConductance1 / 80.00;
   
Serial.print("force in Newton =");
Serial.print("\t");
Serial.print(FSRforce1);
Serial.println();
  
  weight1 = FSRforce1 / 9,8;
  Serial.print("weight in Kg =");
Serial.print("\t");
Serial.print(weight1);
Serial.println();
}

delay(500); //Delay 500 ms.


 // Read the FSR pin and store the output as fsrreading:
int fsrreading2 = analogRead(FSRsensor2);
// Print the fsrreading in the serial monitor:
// Print the string "Analog reading = ".
Serial.print("FSR2 = ");
Serial.print("\t");
// Print the FSR2:
Serial.print(fsrreading2);
Serial.println();


// analog voltage reading ranges from about 0 to 1023 which maps to 0V to 5V (= 5000mV)
fsrVoltage2 = map(fsrreading2, 0, 1023, 0, 5000);
Serial.print("Voltage reading in mV = ");
Serial.println(fsrVoltage2);  
if (fsrVoltage2 == 0) {
Serial.println("No pressure");  
} else {
// The voltage = Vcc * R / (R + FSR) where R = 10K and Vcc = 5V
  // so FSR = ( (Vcc - V) * R) / V
  // fsrVoltage is in millivolts so 5V = 5000mV
  fsrresistance2 = 5000 - fsrVoltage2;     
  fsrresistance2 *= 10000; // 10K resistor
  fsrresistance2 /= fsrVoltage2; // FSR resistance in ohms.

  fsrConductance2 = 1000000; //We measure in micromhos.
  fsrConductance2 /= fsrresistance2; //Conductance in microMhos.


  // Calculate the force.     
   FSRforce2 = fsrConductance2 / 80.00;
   
Serial.print("force in Newton =");
Serial.print("\t");
Serial.print(FSRforce2);
Serial.println();
  
  weight2 = FSRforce2 / 9,8;
  Serial.print("weight in Kg =");
Serial.print("\t");
Serial.print(weight1);
Serial.println();
}

delay(500); //Delay 500 ms.


 // Read the FSR pin and store the output as fsrreading:
int fsrreading3 = analogRead(FSRsensor3);
// Print the fsrreading in the serial monitor:
// Print the string "Analog reading = ".
Serial.print("FSR3 = ");
Serial.print("\t");
// Print the FSR3:
Serial.print(fsrreading3);
Serial.println();


// analog voltage reading ranges from about 0 to 1023 which maps to 0V to 5V (= 5000mV)
fsrVoltage3 = map(fsrreading3, 0, 1023, 0, 5000);
Serial.print("Voltage reading in mV = ");
Serial.println(fsrVoltage3);  
if (fsrVoltage3 == 0) {
Serial.println("No pressure");  
} else {
// The voltage = Vcc * R / (R + FSR) where R = 10K and Vcc = 5V
  // so FSR = ( (Vcc - V) * R) / V
  // fsrVoltage is in millivolts so 5V = 5000mV
  fsrresistance3 = 5000 - fsrVoltage1;     
  fsrresistance3 *= 10000; // 10K resistor
  fsrresistance3 /= fsrVoltage3; // FSR resistance in ohms.

  fsrConductance3 = 1000000; //We measure in micromhos.
  fsrConductance3 /= fsrresistance3; //Conductance in microMhos.


  // Calculate the force.     
   FSRforce3 = fsrConductance3 / 80.00;
   
Serial.print("force in Newton =");
Serial.print("\t");
Serial.print(FSRforce3);
Serial.println();
  
  weight3 = FSRforce3 / 9,8;
  Serial.print("weight in Kg =");
Serial.print("\t");
Serial.print(weight3);
Serial.println();
}

delay(500); //Delay 500 ms.



// Keep reading from Arduino Serial Monitor and send to HC-06
  if (Serial.available())
  {
      BTserial.write(Serial.read());
  }
   //Write sensor data to HC06
BTserial.println(tempc1);

delay(100);

}

please help me please

Start here:

in there, you will find thing that will help. Like:

After reading all of this, you should be able to accomplish what you are asking.

Also, Bluetooth does not incorporate all of the BLYNK features/widgets, and has very limited documentation. I suggest you go the WiFi route instead.

It is only a hypothetical project that will be presented for information purposes only

Please write to me. Display data from my code only as an example

Is this for a school project?
If so, what exactly is the objective you’ve been set?

Pete.

I have three temperature sensors and three pressure sensors
I want the values ​​to appear on the Android phone
When I appeared on the serial screen as in the picture but did not succeed in making it appear on the application

#define BLYNK_PRINT Serial


#include <SoftwareSerial.h>
//SoftwareSerial SwSerial(10, 11); // RX, TX

#include <BlynkSimpleSerialBLE.h>
SoftwareSerial SerialBLE(2, 3); // RX, TX //D6, D7


// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "DvLKTiwMUf5BGhJnNj6J3VGZcY7JiGqK";

BlynkTimer timer;

// This function sends Arduino's up time every second to Virtual Pin (5).
// In the app, Widget's reading frequency should be set to PUSH. This means
// that you define how often to send data to Blynk App.
void myTimerEvent()
{
int  sensor1 = analogRead(A0);
  Blynk.virtualWrite(V5, sensor1);
}
void setup()
{
  // Debug console
  Serial.begin(9600);

    SerialBLE.begin(9600);
  Blynk.begin(SerialBLE, auth);
   Serial.println("Waiting for connections...");
  timer.setInterval(1000L, myTimerEvent);
}

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

This code does not show any values ​​on the application screen

I don’t understand the “hypothetical project” part of your statement.
I also don’t know…
What hardware you are using
What Blynk library version you are using
What Blynk Android app version you are using
What steps you’ve taken to connect the app with the hardware
What data is appearing in your serial monitor.

This is all information that you were asked to supply when start a new topic.

Pete.

Arduino Uno
Bluetooth h-06
blynk 0.6.1
blynk 2.27.17 last

Okay, we’re getting there - slowly!

I asked this question because I’m not prepared to waste my time looking at “hypothetical projects” unless I can understand the context of the project. As you haven’t answered that question then this will be my last post on the subject until you explain more about what this means.

Have you used the Bluetooth widget in the app to connect to the “h-06” (presumably HC-06) module? If so, sharing information about how that went would be useful.

You’ve already shared the data that appears in your serial monitor when you use your non-Blynk code, sharing it again serves no purpose.
If your issue is that your Blynk code:

then it’s the serial output from your Blynk code that is going to be of use - but you’ve not chosen to share that.

Pete.

Sorry, my friend, I did not understand your question for the first time well
The project is sensors to measure the pressure and temperature of the foot for diabetics as it protects against clots in the foot

yes bluetooth HC-06

Unfortunately I did not understand how to write the code, so I did not share it

    //Made for arduino
//by ArduiCreate
//if any problems pls email to sumithaak@gmail.com
//Thanks

#include <SimpleTimer.h>

#define BLYNK_PRINT Serial
#include <BlynkSimpleSerialBLE.h>
 #include <SoftwareSerial.h>
SoftwareSerial SerialBLE(10, 11); // RX, TX //D6, D7

float vref = 3.3;
float resolution = vref / 1023.0;
float temperature;

char auth[] = "DvLKTiwMUf5BGhJnNj6J3VGZcY7JiGqK";//yourauthtoken


SimpleTimer timer;

void setup()
{
  Serial.begin(9600);
  Blynk.begin(SerialBLE, auth);
  timer.setInterval(2000, sendUptime);
}

void sendUptime()
{
  float temperature = analogRead(A0);//lm35 is connected to pin A0 on NodeMcu
  temperature = (temperature * resolution);
  temperature = temperature * 100.0;
  Serial.print("LM35 temperature: ");//serial print the value 
  Serial.println(temperature);
  Blynk.virtualWrite(V0, temperature);//send the value to blynk application
}

void loop()
{
  Blynk.run();
  timer.run();
}
//Thanks for your use

You’ve already shared this code in post #8, and you’ve shared the serial output from the code that you posted in post #1 twice.
What you haven’t done is to share the serial output from this code.

In post #4 you said…

Can you explain what this specific statement means in more detail please?
Who will the project be presented to?
Why is it only a hypothetical project?

Pete.

[0] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _ [0] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v0.6.1 on Arduino Uno

[89] Connecting...
[3189] Login timeout
[5189] Connecting...
[8270] Login timeout
[10270] Connecting...
[13351] Login timeout
[15351] Connecting...
[20432] Connecting...
[23513] Login timeout
[25513] Connecting...
[30594] Connecting...
[33674] Login timeout
[35674] Connecting...
[40754] Connecting...
[43835] Login timeout
[45835] Connecting...
[48916] Login timeout
[50916] Connecting...
[53997] Login timeout
[55997] Connecting...
[59078] Login timeout
[61078] Connecting...

It will be submitted to the university where I study

@SYRIANTECHNO Are you a medical student or software engineer?