Skip to content
This repository has been archived by the owner on Nov 10, 2022. It is now read-only.

Dhanabhon/Real-Time-Temperature-Plot-VSCSharp-Arduino

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Real-Time-Temperature-Plot-VSCSharp-Arduino

Example Real-time temperature graph between C#.NET and Arduino

Using ZedGraph Library (http://zedgraph.sourceforge.net/samples.html)

  • Arduino UNO R3 Code:*

    #include <math.h>
    
    #define RESISTOR_CONNECT_THERMISTOR	10000
    
    void setup() {
      Serial.begin(9600);
    }
    
    void loop() {
      Serial.println((Temperature(analogRead(0))));  // display Celsius
      delay(1000);
    }
    
    /* Calculate the temperature according to the following formula. (Steinhart-Hart Equation)
       https://learn.adafruit.com/thermistor/using-a-thermistor
    */
    
    float Temperature(int RawADC) {
      float temperature,resistance;
      // Calculate the resistance of thethermistor
      resistance   = (float)(1023-RawADC)*RESISTOR_CONNECT_THERMISTOR/RawADC;
      int B = 3975;
      temperature  = 1/(log(resistance/RESISTOR_CONNECT_THERMISTOR)/B+1/298.15)-273.15;
      return temperature;
    }
    

About

Example Real-time temperature graph between C#.NET and Arduino

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages