My first post on the community and second project with Blynk. I am trying to do a simple setup with wemos d1 mini clone + TMP36 temp sensor + Blynk. I am still learning so please be patient with me
Hardware is connected as such: TMP36 is connected to G pin, 3v3 pin and A0 pin physically on wemos
Blynk is setup for pin under analog A0
What does your serial monitor show? Does it show connecting to Blynk server. Read up connection manage state of your connection. First check fro Wifi connection and then the Blynk server connection.
Tried this code and it display correct temperature over serial monitor. Now i dont know how to make this code to send data over wifi…i have read the manual in the help section but still at loss at the basics. please help.
int sensorPin = 0;
void setup()
{
Serial.begin(9600);
}
void loop()
{
int reading = analogRead(sensorPin);
// measure the 3.3v with a meter for an accurate value
//In particular if your Arduino is USB powered
float voltage = reading * 3.3;
voltage /= 1024.0;
// now print out the temperature
float temperatureC = (voltage - 0.5) * 100;
Serial.print(temperatureC);
Serial.println(" degrees C");
delay(1000);
}
This is easily done using the value display widget. Please pick out the value display widget example from the sketch builder, run it and you will understand how it works. Fairly simple. I’m sure you will then be able to integrate it into your project.
Essentially, you need to write that value to a virtual pin using blynk.virtualWrite call. Viola…The widget on the phone tied to the same virtual pin will display the value.
can you please help on how to modify the code that display data over serial and send to blynk. after you show me i will be able to compare both codes and learn from that. i understand its super easy for you but i have to see an example to learn. thank you.
Virtual pins are virtual and are meant to transfer information between the App and the sketch, not part of the physical GPIO.
Note, when programming ESP boards with Arduino IDE you do NOT normally use the silkscreened pin designations, rather you would use the Arduino pin designations.
So something is happening. the code uploaded. i am getting values on the app however they not accurate. i remember with serial monitor they were making sense.