8 Hour Arduino noob

Hello everyone ,
quick back story , Purchased my first Arduino board today , ESP32 Dev Board for a project i am going to work on over Christmas.
I got a few relays and analog thermister ,
i have never programmed a thing in my life and today i managed to get my esp32 online and connected to my iPhone blynk app , and output thermister reading to my phone though it is reading the wrong value.
I have searched this forum and the net for a few hours and cant seem to find anyone with the same issue as me.please find attached pic. I just need a push in the right direction.

Thanks so much!

ESP32 Dev Board
XC4494 Analog Temperature Module
Blynk v0.5.4
iPhone xs 12.1
Arduino IDE 1.8.8

/*************************************************************
  Download latest Blynk library here:
    https://github.com/blynkkk/blynk-library/releases/latest

  Blynk is a platform with iOS and Android apps to control
  Arduino, Raspberry Pi and the likes over the Internet.
  You can easily build graphic interfaces for all your
  projects by simply dragging and dropping widgets.

    Downloads, docs, tutorials: http://www.blynk.cc
    Sketch generator:           http://examples.blynk.cc
    Blynk community:            http://community.blynk.cc
    Follow us:                  http://www.fb.com/blynkapp
                                http://twitter.com/blynk_app

  Blynk library is licensed under MIT license
  This example code is in public domain.

 *************************************************************

  You’ll need:
   - Blynk App (download from AppStore or Google Play)
   - ESP32 board
   - Decide how to connect to Blynk
     (USB, Ethernet, Wi-Fi, Bluetooth, ...)

  There is a bunch of great example sketches included to show you how to get
  started. Think of them as LEGO bricks  and combine them as you wish.
  For example, take the Ethernet Shield sketch and combine it with the
  Servo example, or choose a USB sketch and add a code from SendData
  example.
 *************************************************************/

/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial


#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>

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

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "";
char pass[] = "";

const int analogPin = 36;  // Analog input pin 0 (GPIO 36)
int sensorValue = 0;  // Value read from the ADC

BlynkTimer timer;

void setup() {
  Serial.begin(9600); // Initialize serial monitor output at 9600 bps:
  Blynk.begin(auth, ssid, pass);  // Connect to Blynk Cloud
  timer.setInterval(250L, AnalogPinRead);  // Run sensor scan 4 times a second
}

void AnalogPinRead() {
  sensorValue = analogRead(analogPin);  // Read the analog in value:
  Serial.print("sensor = ");  // Print the results...
  Serial.println(sensorValue);  // ...to the serial monitor:
  Blynk.virtualWrite(V0, sensorValue);  // Send the results to Gauge Widget
}

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

@Benji at least you have values shown on your phone.

Take a look at the code in this sketch and it looks like you need a formula to calculate thermistor analogue value to a real temperature.

https://www.sunfounder.com/learn/sensor_kit_v1_for_arduino/lesson-10-analog-temperature-sensor-sensor-kit-v1-for-arduino.html

https://tkkrlab.nl/wiki/Arduino_KY-013_Temperature_sensor_module

double Thermistor(int RawADC) {
  double Temp;
  Temp = log(10000.0*((1024.0/RawADC-1))); 
  Temp = 1 / (0.001129148 + (0.000234125 + (0.0000000876741 * Temp * Temp ))* Temp );
  Temp = Temp - 273.15;            // Convert Kelvin to Celcius
   //Temp = (Temp * 9.0)/ 5.0 + 32.0; // Convert Celcius to Fahrenheit
   return Temp;

Way to go!!!.. all up and running so quickly (took me a few weeks I think)… we like to see smart new members here :smiley:

As mentioned above… that sensor needs some “math” :scream: and possible calibration to translate its output analog signal into a proper readable value.

Welcome to Blynk!

1 Like

Thanks so much guys ,
If i was really smart i wouldn’t have need any help and i would not have put up my wifi password and API key haha
hopefully no one hacks me haha
Ill give it another crack tonight
thanks for the reply’s!

2 Likes