The code.... 
//Libraries
#include <OneWire.h> //Enables use of one wire temperature sensors
#include <DallasTemperature.h> //Enables support of specific Dallas temperature sensors
#include <Wire.h> //Needed to communicate with data logger
#include <LiquidCrystal_I2C.h> //I2C LCD Librarry
#include <Tlc5940.h> //Library for TLC5940
// Constructed Objects for LCD
LiquidCrystal_I2C lcd1(0x27,20,4);
LiquidCrystal_I2C lcd2(0x26,20,4);
//Temperature Sensors all connected through a single pin
#define ONE_WIRE_BUS 19
//Sets the pin to read the bus
OneWire RTD_oneWire(ONE_WIRE_BUS); // Setup a oneWire instance to communicate with any OneWire devices
DallasTemperature RTDsensors(&RTD_oneWire); // Pass our oneWire reference to Dallas Temperature.
//Define the address of each RTD on the bus
DeviceAddress HLT_T1 = { 0x28, 0x5D, 0x08, 0x70, 0x06, 0x00, 0x00, 0x3D }; //Green: Bus address for the specific sensor
DeviceAddress MashT1 = { 0x28, 0xB4, 0x28, 0x6F, 0x06, 0x00, 0x00, 0xD8 }; //Blue: Bus address for the specific sensor
DeviceAddress MashT2 = { 0x28, 0xF3, 0x94, 0x6E, 0x06, 0x00, 0x00, 0xC9 }; //Orange: Bus address for the specific sensor
DeviceAddress MashT3 = { 0x28, 0xAC, 0x50, 0x70, 0x06, 0x00, 0x00, 0xD3 }; //Pink: Bus address for the specific sensor
DeviceAddress BK_T1 = { 0x28, 0xC0, 0x1A, 0x6F, 0x06, 0x00, 0x00, 0x9B }; //Black: Bus address for the specific sensor
//Limit the update frequency of the RTD's
int RTD_MillisDelay = 1000;
unsigned long RTD_lastRequested = 0;
//Define the variables used to store temperatures
double HLT_TempF = 0; //HLT temperature
double MashTempF_T1 = 0; //Mash temperature - 1
double MashTempF_T2 = 0; //Mash temperature - 2
double MashTempF_T3 = 0; //Mash temperature - 3
double BK_TempF = 0; //BK temperature
//TLC5940 Varaibles
int LED_Brightness = 600; //PWM signal for LED brightness (4095 = 100%)
int UpdateHz = 10000; //Millis - Update frequency
unsigned long TLCmillis = 0; //Millis - Time tracking variable for TLC update frequency
//Machine State variables.
byte ValveState = 0; // 0 = Off or Closed / 1 = On or Open
//Variables specifically for debug investigation
int ErrorH = 0;
int ErrorM1 = 0;
int ErrorM2 = 0;
int ErrorM3 = 0;
int ErrorB = 0;
double attempts = 0;
double duration = 0;
//=====================================================================================================
void setup(){
// put your setup code here, to run once:
lcd1.init();
lcd2.init();
lcd1.backlight();
lcd2.backlight();
// Call Tlc.init() to setup the tlc. You can optionally pass an initial PWM value (0 - 4095) for all channels
Tlc.init();
// other setup routines
RTD_Setup(); //Defines the RTD bus addresses & output data resolution
}
//=====================================================================================================
void loop(){
//Read sensors
TempSensors();
//Control Valves/Pumps
ValvePump_Loop();
}
//=====================================================================================================
void RTD_Setup(){
// Start up the library
RTDsensors.begin();
//Define Sensor resolutions
RTDsensors.setResolution(HLT_T1, 12); //Green: Bus address for the specific sensor
RTDsensors.setResolution(MashT1, 12); //Blue: Bus address for the specific sensor
RTDsensors.setResolution(MashT2, 12); //Orange: Bus address for the specific sensor
RTDsensors.setResolution(MashT3, 12); //Pink: Bus address for the specific sensor
RTDsensors.setResolution(BK_T1, 12); //Black: Bus address for the specific sensor
//True = Library will use delay() functions to prevent from reading sensors too often. This ties up the processor and prevent further activities.
//False= This allows other processes to occur while waiting for the sensors to read. User must take precautions not to read too often.
RTDsensors.setWaitForConversion(false);
//Initiates sensor request for first reading
RTDsensors.requestTemperatures();
}
//=====================================================================================================
void ValvePump_Loop(){
//Control update frequency to avoid errors. TLC.update() takes a loooong time to update
if(millis() > TLCmillis){
TLCmillis = millis() + UpdateHz;
//Set the initial state of duration
duration = micros();
//Blink the LEDs to signal when routine is called
ValveState = abs(ValveState - 1);
//Clear GS values
Tlc.clear();
//Set the TLC5940 machine state values for the system machine state values to operate the hardware and LEDs
TLC_Update(ValveState, 58, 26);
TLC_Update(ValveState, 54, 22);
TLC_Update(ValveState, 48, 16);
TLC_Update(ValveState, 46, 14);
TLC_Update(ValveState, 42, 10);
TLC_Update(ValveState, 38, 6); // if you comment out this line and below, the issue goes away
TLC_Update(ValveState, 32, 0); // if you comment out everything below here, the issue begins to appear
TLC_Update(ValveState, 56, 24); // the invalid sensor reading just gets worse as more of these lines are included
TLC_Update(ValveState, 52, 20);
TLC_Update(ValveState, 50, 18);
TLC_Update(ValveState, 44, 12);
TLC_Update(ValveState, 40, 8);
TLC_Update(ValveState, 36, 4);
TLC_Update(ValveState, 62, 30);
TLC_Update(ValveState, 60, 28);
//Tlc.update() sends the data to the TLCs. This is when the LEDs will actually change
Tlc.update();
//Capture the duration to run the TLC code. Printed on the LCDs later
duration = micros() - duration;
}
}
//=====================================================================================================
void TLC_Update(byte MachineState, byte Hardware_Pin, byte LED_Pin){
//Set the TLC5940 machine state values for the system machine state values to operate the hardware and LEDs
if(MachineState == 0){
Tlc.set(Hardware_Pin, LED_Brightness);
Tlc.set(LED_Pin, LED_Brightness);
}
else{
Tlc.set(Hardware_Pin + 1, LED_Brightness);
Tlc.set(LED_Pin + 1, LED_Brightness);
}
}
//=====================================================================================================
void TempSensors(){
//Limit the update frequency of the RTD's
if(millis() > RTD_lastRequested){
RTD_lastRequested = millis() + RTD_MillisDelay;
//Retrieves temperature from RTD's
HLT_TempF = RTDsensors.getTempF(HLT_T1); //ZERO invalid readings over a 1000 second cycle
MashTempF_T1 = RTDsensors.getTempF(MashT1); //Third worst
MashTempF_T2 = RTDsensors.getTempF(MashT2); //Second worst
MashTempF_T3 = RTDsensors.getTempF(MashT3); //Worst one for invalid readings
BK_TempF = RTDsensors.getTempF(BK_T1); //Hardly any invalid readings over a 1000 second cycle
//Initiates sensor request for next reading
RTDsensors.requestTemperatures();
//Everything below this line is only for debugging------------------------------------------------------
attempts ++;
if(HLT_TempF < 0){
ErrorH++;
}
if(MashTempF_T1 < 0){
ErrorM1++;
}
if(MashTempF_T2 < 0){
ErrorM2++;
}
if(MashTempF_T3 < 0){
ErrorM3++;
}
if(BK_TempF < 0){
ErrorB++;
}
//LCD1
//Line 1
lcd1.setCursor(0,0);
lcd1.print("HLT= ");
lcd1.print(HLT_TempF,1);
lcd1.print(" BK= ");
lcd1.print(BK_TempF,1);
lcd1.print(" ");
//Line 2
lcd1.setCursor(0,1);
lcd1.print("Mash1= ");
lcd1.print(MashTempF_T1,1);
lcd1.print(" ");
//Line 3
lcd1.setCursor(0,2);
lcd1.print("Mash2= ");
lcd1.print(MashTempF_T2,1);
lcd1.print(" ");
//Line 4
lcd1.setCursor(0,3);
lcd1.print("Mash3= ");
lcd1.print(MashTempF_T3,1);
lcd1.print(" ");
//LCD2
//Line 1
lcd2.setCursor(0,0);
lcd2.print("#= ");
lcd2.print(attempts, 0);
lcd2.print(" uS= ");
lcd2.print(duration, 0);
lcd2.print(" ");
//Line 2
lcd2.setCursor(0,1);
lcd2.print("H= ");
lcd2.print(100.0 * ErrorH / attempts, 1);
lcd2.print(" B= ");
lcd2.print(100.0 * ErrorB/attempts, 1);
//Line 3
lcd2.setCursor(0,2);
lcd2.print("M1= ");
lcd2.print(100.0 * ErrorM1/attempts, 1);
lcd2.print(" ");
lcd2.print("M2= ");
lcd2.print(100.0 * ErrorM2/attempts, 1);
lcd2.print(" ");
//Line 4
lcd2.setCursor(0,3);
lcd2.print("M3= ");
lcd2.print(100.0 * ErrorM3/attempts, 1);
}
}