Hello, Geek from Arkansas here!

I did not see a specific place for introductions. I just wanted to introduce myself and say how happy I am that I found this forum.

I've started playing with electronics recently and am having a ton of fun too. I am an amateur radio operator (KF5WHN) and have been wanting to learn more about the Arduino and electronics in general for a long time. I spent a lot of time reading books and looking over theory, before my brother-in-law (who has PHD in electrical engineering) encouraged me to just get in and "do it". It was good advice too.

Right now the project I'm working on is using and Arduino to control my electric brewery, homebrewing is another hobby of mine. I've been amazed at how much I was able to learn just by googling and watching YouTube videos. The only programming language I've been decent at in the past has been javascript, and I'm having somewhat of a hard time adapting.

Anyway I look forward to learning through this forum, and hopefully one day I can return the favor and contribute something useful to this community.

Hello, there is no introduction post needed on this forum. You may just drop your question.
Many new users can't find their post anymore of they don't care, so there are a number of questions which are properly answered and the person never replies.

Have you heard of the "DS18B20" ?
This is a project that might interest you : What is Sous Vide? | Sous-vide controller powered by Arduino - The SousViduino! | Adafruit Learning System

Thanks for the reply.

I have ordered a couple of those temp sensors about a week ago actually, they should be in any day. I have downloaded the Dallas library, so hopefully I can get them working soon. Enjoyed reading the article, very good information that pertains to brewing.

This is what the forum is for: when you say that you have downloaded something, please tell us what you have downloaded with a link to it :wink:

In the Arduino IDE, in the menu is a Library Manager : Sketch / Include Libraries / Manage Libraries (= Library Manager).
Search "onewire" and install the OneWire library. Install the normal common OneWire library (not the max31850 version).
That is already enough, after installing that, example(s) have been added to the menu of the Arduino IDE. Those examples have a sketch for the DS18B20.
The DallasTemperature library makes it easier to use them, and almost everyone installs that as well.
Search for "dallas" and install the normal common one (not the max31850 version). After installing the library, the examples for DallasTemperature are in the menu (no need to restart the Arduino IDE), find a simple example and give it a go.

Thanks for the help. I am certainly going to try and use the simple example first, but I did cobble together something that I might could use to at least test my heating element/SSR etc. My temp sensors won't be arriving until next week it looks like.

I'm not sure why I was unable to set those pin modes, if I uncomment them I get an error message as follows:

Arduino: 1.6.6 (Windows 7), Board: "Arduino/Genuino Uno"

C:\Users\Mauser\Documents\Arduino\LCDPIDTEMP\LCDPIDTEMP.ino: In function 'void setup()':

LCDPIDTEMP:49: error: invalid conversion from 'const char*' to 'uint8_t {aka unsigned char}' [-fpermissive]

pinMode (PIN_INPUT, "INPUT");

^

In file included from sketch\LCDPIDTEMP.ino.cpp:1:0:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:125:6: error: initializing argument 2 of 'void pinMode(uint8_t, uint8_t)' [-fpermissive]

void pinMode(uint8_t, uint8_t);

^

LCDPIDTEMP:50: error: invalid conversion from 'const char*' to 'uint8_t {aka unsigned char}' [-fpermissive]

pinMode (PIN_OUTPUT, "OUTPUT");

^

In file included from sketch\LCDPIDTEMP.ino.cpp:1:0:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:125:6: error: initializing argument 2 of 'void pinMode(uint8_t, uint8_t)' [-fpermissive]

void pinMode(uint8_t, uint8_t);

^

exit status 1
invalid conversion from 'const char*' to 'uint8_t {aka unsigned char}' [-fpermissive]

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.

One other thing that is confusing is the "&" in front of the variables in the PID setup.

// PID library
#include <PID_v1.h>
// Wire library needed for LCD
#include <Wire.h>
//NewLCD library
#include <LCD.h>
#include <LiquidCrystal_I2C.h>
//One Wire library 
// Downloaded from https://github.com/PaulStoffregen/OneWire
#include <OneWire.h>
// Dallas library from the Arduino Temp Control Library
//https://github.com/milesburton/Arduino-Temperature-Control-Library
#include <DallasTemperature.h>
// Stuff for the LCD
#define I2C_ADDR    0x3F // My LCD's address
// no backlight pin connected
#define En_pin  2
#define Rw_pin  1
#define Rs_pin  0
#define D4_pin  4
#define D5_pin  5
#define D6_pin  6
#define D7_pin  7

int n = 1;

LiquidCrystal_I2C  lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);
// PID variables and setup
#define PIN_INPUT 2  // I changed it from 0 to 2 since that is where the temp sensors are going to be?
#define PIN_OUTPUT 13 //using onboard LED for now 
//Define Variables we'll be connecting to
double Setpoint, Input, Output;

//Specify the links and initial tuning parameters
PID myPID(&Input, &Output, &Setpoint,2,5,1, DIRECT);

// Data wire is plugged into port 2 on the Arduino
#define ONE_WIRE_BUS 2

// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);

// Pass our oneWire reference to Dallas Temperature. 
DallasTemperature sensors(&oneWire);
void setup()
{
  // set pins This would not compile
 // pinMode (PIN_INPUT, "INPUT");
 // pinMode (PIN_OUTPUT, "OUTPUT");
  // starts LCD, 20x4 display
 lcd.begin (20,4); 
 // start the temp sensors
sensors.begin();
 Serial.begin(9600);
 //Display Splash Screen
lcd.home (); // go home
 lcd.print(" Petit Jean");  
  lcd.setCursor (5,1);        
lcd.print("Home");
lcd.setCursor (4,2);
lcd.print("Brewery");

// Variables for the PID controller
Setpoint = 165;  // This would be inputed by the user, hard coded number for now
Input = analogRead(PIN_INPUT);
  //turn the PID on
  myPID.SetMode(AUTOMATIC);
}


void loop()
{
// Get temps and display them on the LCD
 sensors.requestTemperatures();
int Ambient = sensors.getTempFByIndex(0);
int Kettle = sensors.getTempFByIndex(1); 
lcd.setCursor (1,3);
lcd.print(Ambient);  
lcd.setCursor (1,4);
lcd.print (Kettle); 
delay(100);
// called once every loop for PID to continue
  myPID.Compute();
  analogWrite(PIN_OUTPUT, Output);
lcd.setCursor(10,4);
lcd.print(PIN_OUTPUT);
}

It just occurred to me that I can't use the pin 2 as an input for the PID, because there will be 2 different sensors connected to it, and the PID wouldn't know which is which? I should probably declare a variable as the input for the PID, such as "Kettle".

Which Arduino board do you use, and what is connected to which pins ?

The reference is online : pinMode() - Arduino Reference
Look at the examples, it is : pinMode ( pinButton, INPUT ) ;
The "INPUT" is a constant or define, it is not a string.

The analogWrite() does not work on pin 13 for an Arduino Uno : analogWrite() - Arduino Reference

The 1-Wire requires its own digital pin.

Can you read the temperatures ? Then maybe you can add PID. If you have selected a PID library, tell us which one. Also tell us how you have installed it.
I assume you want the temperature to be the input of the PID. To use the digital protocol for the 1-Wire (pin 2) as input for the PID is not going to work of course.

Pin numbers are preferred declared with 'const int'.
const int pinButton = 5 ;
const int pinRelay = 10 ;

I cannot read the temperature yet, because my sensors have not arrived.

I'm using a Genuine Arduino Uno R3. I am going to connect pin 11 to my PID output, which will be an external LED for now (an SSR later). I see from the link you posted that I do not have to declare that pin as an output in order to use analogwrite(). The pin that my sensors will be connected to, has been declared as an input by the library it seems? So the only pins that leaves are the ones for my LCD, which are A4 and A5, my LCD IS already working.

This is where I got the libraries:
//One Wire library
// Downloaded from GitHub - PaulStoffregen/OneWire: Library for Dallas/Maxim 1-Wire Chips
#include <OneWire.h>
// Dallas library from the Arduino Temp Control Library
//GitHub - milesburton/Arduino-Temperature-Control-Library: Arduino Temperature Library

I see that I had quotes around INPUT and OUTPUT, which is incorrect as you pointed out. I changed the code so that the PID will not use an input pin, but instead I assigned the value of Input to the temperature from the sensor.

Here are my changes:

// PID library
#include <PID_v1.h>
// Wire library needed for LCD
#include <Wire.h>
//NewLCD library
#include <LCD.h>
#include <LiquidCrystal_I2C.h>
//One Wire library 
// Downloaded from https://github.com/PaulStoffregen/OneWire
#include <OneWire.h>
// Dallas library from the Arduino Temp Control Library
//https://github.com/milesburton/Arduino-Temperature-Control-Library
#include <DallasTemperature.h>
// Stuff for the LCD
#define I2C_ADDR    0x3F // My LCD's address
// no backlight pin connected
#define En_pin  2
#define Rw_pin  1
#define Rs_pin  0
#define D4_pin  4
#define D5_pin  5
#define D6_pin  6
#define D7_pin  7

int n = 1;

LiquidCrystal_I2C  lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);
// PID variables and setup


#define PIN_OUTPUT 11 // Siwtched to 11, I can connect and external LED, or just connect my SSR to it.
//Define Variables we'll be connecting to
double Setpoint, Input, Output;

//Specify the links and initial tuning parameters
PID myPID(&Input, &Output, &Setpoint,2,5,1, DIRECT);

// Data wire is plugged into port 2 on the Arduino
#define ONE_WIRE_BUS 2

// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);

// Pass our oneWire reference to Dallas Temperature. 
DallasTemperature sensors(&oneWire);
void setup()
{

 // starts LCD, 20x4 display
lcd.begin (20,4); 
// start the temp sensors
sensors.begin();
Serial.begin(9600);
//Display Splash Screen
lcd.home (); // go home
lcd.print(" Petit Jean");  
 lcd.setCursor (5,1);        
lcd.print("Home");
lcd.setCursor (4,2);
lcd.print("Brewery");

// Variables for the PID controller
Setpoint = 165;  // This would be inputed by the user, hard coded number for now

 //turn the PID on
 myPID.SetMode(AUTOMATIC);
}


void loop()
{
// Get temps and display them on the LCD
sensors.requestTemperatures();
int Ambient = sensors.getTempFByIndex(0);
int Kettle = sensors.getTempFByIndex(1); 
lcd.setCursor (1,3);
lcd.print(Ambient);  
lcd.setCursor (1,4);
lcd.print (Kettle); 
delay(100);
// call compute once every loop for PID to continue
 Input = Kettle;  // Gives PID the temperature 
 myPID.Compute();
 analogWrite(PIN_OUTPUT, Output);
 // print the PWM value to the LCD
lcd.setCursor(10,4);
lcd.print(PIN_OUTPUT);
}

Thanks, I will report back when my sensors arrive.

I still don't know which PID library and how you have installed the libraries.

You didn't have to download the OneWire and DallasTemperature. They are already in the Library Manager as I wrote in my Reply #3.

An normal SSR together with analogWrite() will not work. I think you have to set the PID output to 'on' and 'off only. I have seen some examples of that in the past. You might have to tweak the timing for the SSR, so that it won't switch too fast or too slow.

If the DS18B20 have arrived, add a pullup resistor and see if you can make them work. The PID requires tuning and tweaking anyway.

Sorry I haven't reported back sooner. I received my temp sensors and was able to get them working pretty easily actually. I deleted all the libraries that I had previously installed, and installed the ones from the library manager search as suggested above. One sensors seems to be reading a slightly different value than the other, maybe 2 degrees. I have them laid out on a breadboard with lots of alligator clips so I may worry about that more as I solder everything together.

I was also able to get the PID working, (using an LED to visually see the PWM and printing the PID value to the LCD to verify). Although the LED is kind of "on" or "off" I can see it coming on above a certain PWM value, about 150 it seems. I will check the data sheet for the switching speed of my SSR, but I'm pretty sure it can handle this. A lot of my other brewing buddies use this same setup with the Arduino. The PID will need some tweaking I'm sure, I did not even try to adjust the values for it, but used the default ones. I will try and adjust those later while heating up plain water when I have everything working.

I also added a rotary encoder and a menu. My cheap Chinese rotary encoders had quite a bit of bounce until I added a capacitor. I'm using it to control a menu and somehow I managed to even get that to work. I think I will switch out that encoder, for a nice 5 position one, (the Chinese ones I bought have 20) and the menu is very touchy.

Thanks for the help, I will try and post a video or some pics of what I have so far tomorrow for anyone interested.

The DS18B20 are very sensitive for heat nearby. A little sunlight, a little closer to a voltage regulator, a little less draft, anything can change the temperature. As if they absorb all the heat from the environment.
If they are encapsulated and you put them all in a ice-water they all will be 0 degrees.