Mini horno

Revisión del 11:41 4 jul 2026 de Antonio (discusión | contribs.) (Página creada con « * * AREF Analog pin 0 * | | * 3.3V |-+---/\/\/\-----+-----/\/\/\-----| GND * * ^ ^ * 10K thermistor 10K resistor: #include <SmoothThermistor.h> float t_objectivo = 15; SmoothThermistor smoothThermistor(A0, // the analog pin to read from ADC_SIZE_10_BIT, // the ADC size 10000, /…»)
(difs.) ← Revisión anterior | Revisión actual (difs.) | Revisión siguiente → (difs.)

/*

*
*          AREF      Analog pin 0
*           |              |
*    3.3V |-+---/\/\/\-----+-----/\/\/\-----| GND
*
*                 ^                ^ 
*          10K thermistor     10K resistor
*/
  1. include <SmoothThermistor.h>

float t_objectivo = 15;

SmoothThermistor smoothThermistor(A0, // the analog pin to read from

                                  ADC_SIZE_10_BIT, // the ADC size
                                  10000,           // the nominal resistance
                                  10000,           // the series resistance
                                  3950,            // the beta coefficient of the thermistor
                                  25,              // the temperature for nominal resistance
                                  10);             // the number of samples to take for each measurement

void setup() {

 Serial.begin(9600);
 smoothThermistor.useAREF(true);
 pinMode(12, OUTPUT);
 pinMode(13, OUTPUT);

}

void loop() {

 float t_actual = smoothThermistor.temperature();
 Serial.print("t_objectivo:");
 Serial.print(t_objectivo);
 Serial.print(" ");
 Serial.print("t_actual:");
 Serial.println(t_actual);
 if (Serial.available() != 0) {
   float temp = Serial.parseFloat();
   if (temp > 0.0) t_objectivo = temp;
 }
 bool calentar = false;
 if (t_actual < t_objectivo) {
   calentar = true;
 } else {
   calentar = false;
 }

 digitalWrite(12, calentar);
 digitalWrite(13, calentar);
 delay(1000);

}