rims-arduino-library  v3.1.1
Recirculation infusion mash system library for Arduino
rimsBasic.ino

Rims and UIRims classes basic example

/*
* Rims library basic example. PID was tuned with RimsIdent toolkit.
*/
#include "LiquidCrystal.h"
#include "Rims.h"
double currentTemp, ssrControl, settedTemp;
// LCD RS pin : 8,
// LCD enable pin : 9
// LCD D4, D5, D6, D7 pins : 4, 5, 6, 7
LiquidCrystal lcd(8,9,4,5,6,7);
// LCD used with UIRims : lcd
// Analog input pin number for reading keys : 0
// Digital output pin number for lcd backlight : 10
// Digital output pin number for speaker alarm : none
UIRims myUI(&lcd,0,10);
// UI used with Rims : myUI
// Analog input pin number for reading temperature : 1
// Digital output pin number for heater solid state relay : 11
// Double variables used for PID : currentTemp, ssrControl, settedTemp
Rims myRims(&myUI,1,11,&currentTemp,&ssrControl,&settedTemp);
void setup() {
Serial.begin(115200);
// PT-100 RTD calibration is performed by reading Arduino ADC with water at
// five different temperatures and an external thermometer as a reference :
float cubicRTD[4] = {-247.1087,2.23511,0.001659,0.0};
myRims.setTempProbe(PROBE_RTD, cubicRTD,124.5);
// tuned manually with 15 L of mash water over a 1500 W water heater
// and tested succesfully on 25 L of mash water, (Kc,Ki,Kd,tau) :
myRims.setTuningPID( 21.1403, 0.0417, -503.8329, 23.8329);
}
void loop() {
myRims.run();
}