Starrider
Well-Known Member
I hope there are some Arduino coders out here.
I have been (slowly) building an E-Herms setup around an Arduino Uno. A fairly simple setup, or so I thought, and after multiple versions each adding a little more to the features, it was just about done and crashed.
For the controls; I have two DS18B20 probes, one for the HLT and one for the Mash Tun. I have a 12v pump to recirculate from the TUN through a copper coil in the HLT. I had also added PID for a heating element in the HLT although have never tested or used it. I havent installed the heating element yet. It has a 20x4 L2C LCD for displaying data and an IR Remote for button input. I have used it on a few batches just monitoring temp and turning the pump on and off to maintain mash temp.
Here is where the trouble starts. It was working but after some minor changes, it stopped registering input from the remote. I added some Serial Prints to see if I could find where it was stopping but seems to just jump over the section where it checks for button presses.
I put together a simple test sketch to verify remote operation and it works perfectly. I then took my working sketch and stripped it all the way back to just registering button presses and updating the LCD display. Except for the detail in the LCD display, the codes looks identical to me. Something must be wrong though because past the Splash screen, no button presses will register.
Im about ready to give up and just buy some Inkbird controllers but it wont be the same. Plus, I already have the Arduino mounted in an enclosure with quick connects for probes and pump. Enclosure turned out nice even if I do say so myself.
I will try to attach the two sketches in hopes someone can see what is causing it to fail. The short one is the one that works. The longer one no longer works and I see no reason why it shouldnt.
Ok, so I can't attach the file, I'll try to paste it.
Thanks in advance for any help.
I have been (slowly) building an E-Herms setup around an Arduino Uno. A fairly simple setup, or so I thought, and after multiple versions each adding a little more to the features, it was just about done and crashed.
For the controls; I have two DS18B20 probes, one for the HLT and one for the Mash Tun. I have a 12v pump to recirculate from the TUN through a copper coil in the HLT. I had also added PID for a heating element in the HLT although have never tested or used it. I havent installed the heating element yet. It has a 20x4 L2C LCD for displaying data and an IR Remote for button input. I have used it on a few batches just monitoring temp and turning the pump on and off to maintain mash temp.
Here is where the trouble starts. It was working but after some minor changes, it stopped registering input from the remote. I added some Serial Prints to see if I could find where it was stopping but seems to just jump over the section where it checks for button presses.
I put together a simple test sketch to verify remote operation and it works perfectly. I then took my working sketch and stripped it all the way back to just registering button presses and updating the LCD display. Except for the detail in the LCD display, the codes looks identical to me. Something must be wrong though because past the Splash screen, no button presses will register.
Im about ready to give up and just buy some Inkbird controllers but it wont be the same. Plus, I already have the Arduino mounted in an enclosure with quick connects for probes and pump. Enclosure turned out nice even if I do say so myself.
I will try to attach the two sketches in hopes someone can see what is causing it to fail. The short one is the one that works. The longer one no longer works and I see no reason why it shouldnt.
Ok, so I can't attach the file, I'll try to paste it.
Thanks in advance for any help.
#include <IRremote.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); //Set LCD I2C address
int recv_pin=11; //IR receive input pin
IRrecv irrecv(recv_pin);
decode_results results;
unsigned long lastcode;
int volup =0;
int voldn=0;
int chaup=0;
int chadn=0;
int right=0;
int left=0;
//**********************Void Setup*********************************
void setup() {
irrecv.enableIRIn(); //Start the IR receiver
lcd.begin(20, 4);
Serial.begin(9600);
splash();
}
//****************************************************************************
// Void Loop
//****************************************************************************
void loop() {
//*********** Read button presses from remote ****************
if(irrecv.decode(&results)){
Serial.println(results.value,HEX);
if(results.value != 0xFFFFFFFF)
{lastcode=results.value;
}
switch (lastcode) { //Adjust HLT or MLT setpoint based on menu value (Case select)
case 0x2A71BFFD: // Menu button, back to splash screen
splash();
break;
case 0x636d99da: //Right arrow
right++;
break;
case 0xD20E2899: //Left arrow
left++;
break;
case 0x22d912bb: // Volume up button
volup++;
break;
case 0x776c6e7a: // Volume down button
voldn--;
break;
}
irrecv.resume();
}
/*
if(lastcode==0x22d912bb){ //5846514513 0x22d912bb
volup++;
}
if(lastcode==0x776c6e7a){
voldn++;
}
if(lastcode==0x636d99da){
right++;
}
if(lastcode==0xD20E2899){
left++;
}
if(lastcode==0x2A71BFFD){
splash();
}
irrecv.resume();
} */
PrintData();
}
//******************Below are Functions called from above******************************************
void PrintData(){
// First Row
lcd.setCursor(6, 0);
lcd.print(volup);
lcd.setCursor(17, 0);
lcd.print(voldn);
// Second Row
lcd.setCursor(6, 1);
lcd.print(chaup);
lcd.setCursor(17, 1);
lcd.print(chadn);
// Third Row
lcd.setCursor(6, 2);
lcd.print(right);
lcd.setCursor(17, 2);
lcd.print(left);
// Fourth Row
lcd.setCursor(0,3);
lcd.print(lastcode);
}
void Static(){
lcd.clear();
lcd.home();
// First Row
lcd.setCursor(0, 0);
lcd.print("Vol + |");
lcd.setCursor(10, 0);
lcd.print("Vol -");
// Second Row
lcd.setCursor(0, 1);
lcd.print("Cha + |");
lcd.setCursor(10, 1);
lcd.print("Cha -");
// Third Row
lcd.setCursor(0, 2);
lcd.print("Right |");
lcd.setCursor(10, 2);
lcd.print("Left");
}
void splash(){
lcd.clear();
lcd.home();
lcd.setCursor(4, 0);
lcd.print("WELCOME TO");
lcd.setCursor(18, 0);
lcd.write(3); //Upper left logo
lcd.write(4); //Upper right logo
lcd.setCursor(3, 1);
lcd.print("Hickey Brewing");
lcd.setCursor(18, 1);
lcd.write(5); //Lower left logo
lcd.write(6); //Lower right logo
lcd.setCursor(3, 2);
lcd.print("press any key");
lcd.setCursor(0, 3);
lcd.print("v2.2 to start");
//This will pause program until a button is pressed, then continue with void loop.
while (irrecv.decode(&results)==LOW) {
delay(10);
}
irrecv.resume();
Static();
}