ArduinoproMini
SondeTempérature
ressorti sonde 3 fils:
noir
rouge
jaune
chercher sketch:
DS18B20
http://www.instructables.com/id/Digital-Thermometer-With-Arduino-DS1307/
sonde analogique 2 fils resistance:
datasheep (probable):
http://www.murata.com/~/media/webrenewal/support/library/catalog/products/thermistor/ntc/r44e.ashx
Type: NTC 10k±1% 3950 sans doute 10Ko
http://www.ebay.fr/itm/5PCS-1m-NTC-Thermistor-accuracy-temperature-sensor-10K-1-3950-Waterproof-Probe-/310811243265?
valeur haute: pas de réistance ou chaud
bas froid:
GAFFE ci dessous pas étaloné!
la théorie:
http://playground.arduino.cc/ComponentLib/Thermistor2
Ok avec Pull-Up externe de 10 kOhm
(possible que la pull-up résistance interne ne soit pas de 10 Ko ?)
abaque:
https://www.adafruit.com/products/372
donne:
https://www.adafruit.com/datasheets/103_3950_lookuptable.pdf
min: -83 max: 373 (de la formule)
min max de la tabmle:! -40 +200, la résistance de 10 kOhms est à 25°
avec pullup interne, semble environ 40 kOhms, valeur lue descend à 40
étalonnage avec résistance de 10kOhms
raw: 220, V:1.07 R:10350
/*
The circuit:
* LED attached from pin 13 to ground (internal)
* themistor 10K A0 & Grnd
* Note: on most Arduinos there is already an LED on the board
attached to pin 13.
created 20160210 antiguide
*/
// constants won't change. They're used here to
// set pin numbers:
const int resistorPin = A0; // the number of the pushbutton pin
const int ledPin = 13; // the number of the LED pin
const bool internal=true;
float ohmsPullUp =10000.0;
void setup() {
if (internal) {ohmsPullUp = 38000.0;}
Serial.begin(9600);
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
// initialize the resistor pin as an input:
pinMode(resistorPin, INPUT);
if (internal) digitalWrite(resistorPin, HIGH); // set pullup on analog pin 0
}
double Thermistor(int RawADC) {
double Temp;
Temp =log(ohmsPullUp/(1024.0/RawADC-1)); // for pull-up configuration
Temp = 1 / (0.001129148 + (0.000234125 + (0.0000000876741 * Temp * Temp ))* Temp );
Temp = Temp - 273.15; // Convert Kelvin to Celcius
return Temp;
}
void loop(){
delay(1000);
// read the state of analogic pin:
digitalWrite(ledPin, !digitalRead(ledPin)); // turn the LED On/off
float reading=analogRead(resistorPin);
// float ratio=1023/reading-1;
float ratio=reading/(1023-reading);
float R=ohmsPullUp*ratio;
Serial.print("\nRaw value: ");
Serial.print(reading);
Serial.print(" V: ");
Serial.print(5.0*reading/1023);
Serial.print(" ratio: ");
Serial.print(ratio);
Serial.print(" R: ");
Serial.print(R);
Serial.print(" temperature: : ");
Serial.print(Thermistor(reading));
}