Temperature Controlled LED

Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum

Help Support Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

Skagdog

Supporting Member
HBT Supporter
Joined
Oct 8, 2011
Messages
455
Reaction score
43
Location
Fairbanks
Greetings!

I'm currently sourcing parts to build the controller in the "PWM..Show us How" thread (found here, also in the electric section) mostly because Fairbanks winters SUCK for boiling 7+ gallons of anything outside in the winter.....

I'm trying to figure out if there is a way to control an LED (or other light) with a temp sensor, i.e. when the temp gets to 155F, a green light illuminates, when the temp gets to 170F, a yellow light illuminates, and when the temp gets to 185F, a red light illuminates.

I have a few thoughts:

1) Would it be best to do this independently of the power circuit for the controller/element? (Don't want anything other than an overtly visible temp indicator)

2) I'm only interested in "if the temp = this, then this light comes on."

3) The 155 light will probably stay on even while the 170 and 185 lights are on.


I've searched things like "LED temp sensor", LED Temp indicator", and various other things with both "temp" and "temperature" as well as "indicator" and "display".

Any guidance would be greatly appreciated....

Happy Brewing!
 
I should add that the PWM thing will be 240v and the temp thing could be either 110v (stand alone) or tied into the 240v system (if possible).
 
I think you might be able to do this with a PID. I'm not 100% on everything an auber like PID can do but I'm pretty sure lots of people set up lights and alarms when they reach certain temp points.
 
A series of thermostatic switches would be a simple answer, but would require one for each light (and might get pricey). Otherwise, as Tinga suggest, most basic PIDs have 2 "alarm" outputs that could be used for this purpose and because of the logic circuits, would only require the one sensor.
 
A series of thermostatic switches would be a simple answer, but would require one for each light (and might get pricey). Otherwise, as Tinga suggest, most basic PIDs have 2 "alarm" outputs that could be used for this purpose and because of the logic circuits, would only require the one sensor.

So one PID would be able to illuminate 2 separate LEDs at specific temps?

I could live with two.

I'm gonna look around here at PID stuff now....
Thanks for the direction so far. Once I get something drawn up, I'll give it a post and see what y'all think...
 
you can do everything (PWM, temperature triggers, even PID/control heating elements) with a microcontroller, like an arduino or raspberryPi.

http://www.arduino.cc/en/Main/ArduinoBoardProMini

in addition to everything you described, you can also add a small LCD display that can show the actual temperature of any given probe reading.
 
jimmayhugh said:
Ya mean like this??

Wow! That's certainly something to work up to. I don't know all the code and whatnot it looks like it'll take to pull this off but man It makes me want to learn something....

Off to research more about this stuff...
 
Ya mean like this??

possibly. doesnt have to be that involved, but it could be. heres a quick arduino sketch that should get you started... i threw it together from some other code i had written. its not tested but it seems to compile...

the only values you need to set are in the first 7 lines of code.

Code:
#define ONE_WIRE_BUS 8 //onewire temp sensor(s) are on this pin (DS18B20; DS18S20, etc)

const int lowLEDpin = 1; //arduino pin with the low LED attached
const int medLEDpin = 2; // ...with the med LED attached
const int highLEDpin = 3; //...with the high LED attached

const int lowTemp = 150; //temperature that you want the lowLED to turn on for
const int medTemp = 170; //temperature that you want the medLED to turn on for
const int highTemp = 185; //temperature that you want the highLED to turn on for


//dont change anything below here unless you know what your doing//
float temp = 0; //stores actual temperature value

/*you need these two libraries if you dont already have them installed
http://www.pjrc.com/teensy/td_libs_OneWire.html
and
http://milesburton.com/Dallas_Temperature_Control_Library
they get pasted into the \arduino install\libraries\  folder */

#include <OneWire.h>
#include <DallasTemperature.h>
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);

void setup(){
//set pinModes to output to drive LEDs
pinMode(lowLEDpin, OUTPUT);
pinMode(medLEDpin, OUTPUT);
pinMode(highLEDpin, OUTPUT);

//make all LEDs off to start
digitalWrite(lowLEDpin, LOW);
digitalWrite(medLEDpin, LOW);
digitalWrite(highLEDpin, LOW);

//start serial output if needed
Serial.begin(9600);
Serial.println("temp info")

// Start up the sensors library
sensors.begin();
}

void loop(){

delay(1000); //1 second delay, just to slow things down a bit

//start gathering temp sensor data
  sensors.requestTemperatures();

temp = sensors.getTempCByIndex(0);  //get the temp of sensor
temp = (temp * 9)/ 5 + 32; //convert C to F


//if temperature is > set low temp, but not > medium, turn on lowLED and off all others
if ( temp >= lowTemp && temp < medTemp){
digitalWrite(lowLEDpin, HIGH);
digitalWrite(medLEDpin, LOW);
digitalWrite(highLEDpin, LOW);
}

//if temperature is > medium, but not > high, turn on low and medium LED, and off high LED
if ( temp >= medTemp && temp < highTemp){
digitalWrite(lowLEDpin, HIGH);
digitalWrite(medLEDpin, HIGH);
digitalWrite(highLEDpin, LOW);
}


//if temp > high, turn on all LEDs
if ( temp >= highTemp ){
digitalWrite(lowLEDpin, HIGH);
digitalWrite(medLEDpin, HIGH);
digitalWrite(highLEDpin, HIGH);
}

//if temp < lowTemp, turn all off
if (temp < lowTemp){
digitalWrite(lowLEDpin, LOW);
digitalWrite(medLEDpin, LOW);
digitalWrite(highLEDpin, LOW);
}

//send the actual temperature to serial output
Serial.print("measured temp: ");
Serial.println(temp);
}

there are plenty of tutorials on the hardware needed to control a LED...
http://www.arduino.cc/en/Tutorial/BlinkingLED
 
audger said:
possibly. doesnt have to be that involved, but it could be. heres a quick arduino sketch that should get you started... i threw it together from some other code i had written. its not tested but it seems to compile...

the only values you need to set are in the first 7 lines of code.


#define ONE_WIRE_BUS 8 //onewire temp sensor(s) are on this pin (DS18B20; DS18S20, etc)

const int lowLEDpin = 1; //arduino pin with the low LED attached
const int medLEDpin = 2; // ...with the med LED attached
const int highLEDpin = 3; //...with the high LED attached

const int lowTemp = 150; //temperature that you want the lowLED to turn on for
const int medTemp = 170; //temperature that you want the medLED to turn on for
const int highTemp = 185; //temperature that you want the highLED to turn on for

//dont change anything below here unless you know what your doing//
float temp = 0; //stores actual temperature value

/*you need these two libraries if you dont already have them installed
http://www.pjrc.com/teensy/td_libs_OneWire.html
and
http://milesburton.com/Dallas_Temperature_Control_Library
they get pasted into the \arduino install\libraries\ folder */

#include <OneWire.h>
#include <DallasTemperature.h>
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);

void setup(){
//set pinModes to output to drive LEDs
pinMode(lowLEDpin, OUTPUT);
pinMode(medLEDpin, OUTPUT);
pinMode(highLEDpin, OUTPUT);

//make all LEDs off to start
digitalWrite(lowLEDpin, LOW);
digitalWrite(medLEDpin, LOW);
digitalWrite(highLEDpin, LOW);

//start serial output if needed
Serial.begin(9600);
Serial.println("temp info")

// Start up the sensors library
sensors.begin();
}

void loop(){

delay(1000); //1 second delay, just to slow things down a bit

//start gathering temp sensor data
sensors.requestTemperatures();

temp = sensors.getTempCByIndex(0); //get the temp of sensor
temp = (temp * 9)/ 5 + 32; //convert C to F

//if temperature is > set low temp, but not > medium, turn on lowLED and off all others
if ( temp >= lowTemp && temp < medTemp){
digitalWrite(lowLEDpin, HIGH);
digitalWrite(medLEDpin, LOW);
digitalWrite(highLEDpin, LOW);
}

//if temperature is > medium, but not > high, turn on low and medium LED, and off high LED
if ( temp >= medTemp && temp < highTemp){
digitalWrite(lowLEDpin, HIGH);
digitalWrite(medLEDpin, HIGH);
digitalWrite(highLEDpin, LOW);
}

//if temp > high, turn on all LEDs
if ( temp >= highTemp ){
digitalWrite(lowLEDpin, HIGH);
digitalWrite(medLEDpin, HIGH);
digitalWrite(highLEDpin, HIGH);
}

//if temp < lowTemp, turn all off
if (temp < lowTemp){
digitalWrite(lowLEDpin, LOW);
digitalWrite(medLEDpin, LOW);
digitalWrite(highLEDpin, LOW);
}

//send the actual temperature to serial output
Serial.print("measured temp: ");
Serial.println(temp);
}



there are plenty of tutorials on the hardware needed to control a LED...
http://www.arduino.cc/en/Tutorial/BlinkingLED

You've somehow managed to convince me that I might be able to pull this off. I'm gonna look around and see where I can source parts.
 
Back
Top