Author Topic: Relative Newbie: Extend functionality of electric smoker  (Read 13390 times)

0 Members and 1 Guest are viewing this topic.

Offline NegativeTenTopic starter

  • Contributor
  • Posts: 14
Re: Relative Newbie: Extend functionality of electric smoker
« Reply #25 on: August 20, 2015, 09:48:33 pm »
So this project stayed on the shelf for a while and I finally have time to pick it back up. I've made a little bit of progress, though I'm still having some issues.

Through the process of trial and error, I can say with relative confidence (take that with a grain of salt...) that the missing link to the assumed voltage divider circuit is a 1K resistor to ground that's inside the the chassis of the smoker. I was able to simulate this on breadboard with a small 10K NTC thermistor and 1k resistor, and +5V regulated through an arduino (powered externally). I attached this to the OEM controller board, and it displayed the correct temperature. I then hooked up the same circuit to my arduino with my code, and it displayed the same temperature reading. (~78*F)

Success!! Or so I thought...

I took it outside, plugged the arduino into the smoker, and turned on the heating element. Right away, my Arduino was displaying a temperature about 10*F higher than the actual temperature (displaying 104*F vs 94*F actual at the time). For the first few minutes of heating, this 10*F difference remained, so I figured I could just account for that in the code. Once the temperature started climbing, though, the difference increased to 15*F, then to 20*F, and ultimately it was 30*F off (reading 250*F at an actual temperature of 220*F). I understand that the profile of thermistors isn't linear, which explains the increasing margin of error across a wider temperature range, but I'm unsure of how to adjust for this in my code (or at the hardware level?). Below is the code for determining temperature, I'm using coefficients for the Steinhart-Hart equation from the web, as it seems most normal 10K thermistors have similar values.

One thought I have is that since I'm powering the Arduino from the +5V of the smoker, maybe that's affecting the values read by the ADC? Any help or insight is appreciated!

Code: [Select]
float a = 0.001125308852122;
float b = 0.000234711863267;
float c = 0.000000085663516;


void loop() {
 
  adc = analogRead(A0);
  // 1000.0 being the value of the other resistor in our voltage divider circuit 
  Temp = log(1000.0*((1024.0/adc-1)));
  Temp = 1 / (a + (b + (c * Temp * Temp ))* Temp );
  TempC = Temp - 273.15;            // Convert Kelvin to Celcius
  TempF = (TempC * 9.0)/ 5.0 + 32.0; // Convert Celcius to Fahrenheit

   Serial.print("ADC: ");
   Serial.print(adc);
   Serial.print(" Temp (C): ");
   Serial.print(TempC);
   Serial.print(" Temp (F): ");
   Serial.println(TempF);
///
}
« Last Edit: August 20, 2015, 09:52:05 pm by NegativeTen »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf