I have already tested bluetooth communication using another code on arduino and its working. I can send strings to a test app called “s2 Terminal for Bluetooth”. I also receive the strings typed in this app in my serial monitor. So I confident to say that the problem is not in the hardware and wires connections.
I also have tested the hardware measuring temperature and voltage. Its working and displays the results correctly. The problem is when I try to merge both.
/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial
#include <SoftwareSerial.h>
#include <BlynkSimpleSerialBLE.h>
#include <SoftwareSerial.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "3473f8737181435c96f0f379817e96c8";
/*
The simplest TMP 36 Thermometer
*/
const int analogIn = A4;
int RawValue= 0;
double Voltage = 0;
double tempC = 0;
double tempF = 0;
BlynkTimer timer;
void setup(){
Serial.begin(9600);
Blynk.begin(Serial3, auth); //I'm using pins 15 and 14 for RX and TX
Serial.println("Waiting for connections...");
timer.setInterval(1000L, myTimerEvent);
}
void myTimerEvent()
{
RawValue = analogRead(analogIn);
Voltage = (RawValue / 1023.0) * 5000; // 5000 to get millivots.
tempC = (Voltage-500) * 0.1; // 500 is the offset
tempF = (tempC * 1.8) + 32; // conver to F
Serial.print("Raw Value = " ); // shows pre-scaled value
Serial.print(RawValue);
Serial.print("\t milli volts = "); // shows the voltage measured
Serial.print(Voltage,0); //
Serial.print("\t Temperature in C = ");
Serial.print(tempC,1);
Serial.print("\t Temperature in F = ");
Serial.println(tempF,1);
// You can send any value at any time.
// Please don't send more that 10 values per second.
Blynk.virtualWrite(V5, Voltage);
}
void loop(){
Blynk.run();
timer.run();
}
I removed that delay, but it’s still not transmitting. I have already tested the code without the bluetooth, just printing the voltage values on serial monitor and it works. Thx for your fast reply!
I tried to upload a picture, but It did not work. Well, I have done the changes, but I still cant receive voltage stream on superchart. Thx for your answer again, even if not working I was able to learn
Well, I have done the changes, but I still cant receive voltage stream on superchart. Thx for your answer again, even if not working I was able to learn
Best to just keep posting new info into new posts… not everyone goes back and reads your changes I fixed your post so it shows the images (you had the closing backticks in the wrong place).
You still need to setup Serial3 with the correct begin() and BAUD commands, just like any serial port.
Exactly. There is no Serial3.begin(baudrate); in your code.
AND as @Gunner pointed, it NEEDS TO BE CORRECT baudrate. Those BT modules are not automatically adopted to baudrate - It needs to match on both sides. It SHOULD BE 9600 as a factory setting, but you need to make sure it is.
Sorry for late response, I did what marvin7 and Gunner appointed and its now working. I’m here to give you this feedback and also to say thank you for both. You were nice and kept helping me, my sincere thanks to you!