Demande aide pour programme régulation de température


bonjour à tous. alors voilà je suis sur un projet de régulation de température. j'utilise une carte arduino uno, un capteur de température lm35 et un mosfet irfp 150 pour la régulation. mon montage est déjà fait.
j'ai trouvé ce programme sur un site qui parle de régulation sauf que le régulateur utilisé est un switch et il utilisé une librairie rc code. je voudrais savoir par quoi remplacer les rcswitch, myswitch, myswitch.switchon(1,1) ou encore myswitch.switchoff(1,1). j'utilise le pin 8 pour le mosfet.

voici le programme:

code: [select]
#include <rcswitch.h> //only used remote control switches, not used if have relay

#define aref_voltage 3.3         // tie 3.3v aref , measure multimeter!

//tmp36 pin variables
int temppin = 1;       
int tempreading;

float desiredtempc = 28; // temperature maintain

rcswitch myswitch = rcswitch(); 

void setup(void) {
  // we'll send debugging information via serial monitor
  serial.begin(9600);   
  // if want set aref other 5v
  analogreference(external);
  //enable rc switch transmissions on pin 10.
  myswitch.enabletransmit(8);
}


void loop(void) {

  tempreading = analogread(temppin); 

  // converting reading voltage, based off reference voltage
  float voltage = tempreading * aref_voltage;
  voltage /= 1024.0;

  // print out temperature
  float temperaturec = (voltage - 0.5) * 100 ; 
  serial.print(temperaturec); serial.println(" degrees c");

  /* convert fahrenheight
  float temperaturef = (temperaturec * 9.0 / 5.0) + 32.0;
  serial.print(temperaturef); serial.println(" degrees f");
   */
   
  if(temperaturec < desiredtempc){
    myswitch.switchon(1,1);
    serial.println("heater on");
  }
  else{
    serial.println("heater off");
    myswitch.switchoff(1,1);
  }
   
   
  delay(1000);
}


merci d'avance. coordialement, breav

tu remplace par un http://arduino.cc/en/reference/digitalwrite


Arduino Forum > International > Français (Moderators: jfs, Snootlab) > Demande aide pour programme régulation de température


arduino

Comments

Popular posts from this blog

opencv3, tbb and rasp pi 2 - Raspberry Pi Forums

small ethernet problem - Raspberry Pi Forums

Multithumb configuration params not working? - Joomla! Forum - community, help and support