Here is a standalone Dynamic Temperature Indicator and Controller Using Ardunio that also controls the electric appliance according to temperature. The use of Arduino technology makes this closed-loop feedback control system efficient and reliable. Arduino allows dynamic and faster control. Here we used a rotary encoder and liquid crystal display for more users friendly. The sensed and set temperature values are simultaneously displayed on the LCD panel in centigrade which can be changed Kelvin in scale.
Circuit Description of Dynamic Temperature Indicator and Controller Using Arduino
The circuit is programmed for on-off control. It is very compact using a few components and can be implemented for several applications like air-conditioning, water heater, heat-exchanger, etc.
The thermistor senses the temperature and changes its internal resistance as like LDR does, which is applied to the analog pin A0 of Arduino, the analog signal into digital format by the in-build analog to digital converter (ADC) of Arduino. The senses temperature is displayed on the 16*2 line display. The Arduino drives a transistor to control the heating element with the help of an electromagnet relay.
A rotary encoder allows the set temperature to be changed. The button on it also acts as an override switch.
Check out other temperature-controlled and indicator circuits posted in bestengineeringprojects.com
- ESP8266 Temperature Logger using PIC16F887
- Arduino Based Data Logger (Temperature)
- Temperature Controlled Fan using Arduino
- Wireless Temperature and Humidity Indicator for Fridge
- Temperature Deviation Indicator Using OP-AMP 741
PARTS LIST OF DYNAMIC TEMPERATURE INDICATOR AND CONTROLLER USING ARDUINO
Resistor (all ¼-watt, ± 5% Carbon) |
R1 – R3 = 100 KΩ
R4 = 33 KΩ R5 = 270 Ω R6 = 1 KΩ R7 = 100 Ω |
Semiconductors |
Th1 = 33 KΩ Thermistor beta = 4090
Arduino Diecimila or Uno or clone LCD1 = LCD module HD44780 T1 = BC548 (General Purpose NPN Silicon Transistor) D1 = 1N4004 (Rectifier Diode) LED1 = 5-mm LED |
Miscellaneous |
RL1 = 5V relay
Rotary Encoder |
Software Code:
The Software code of Dynamic Temperature Indicator and Controller Using Ardunio is written in Arduino programming language and compiled using Arduino IDE. The source code takes the analog input from the thermistor at analog pin A0 and the inbuilt ADC of Arduino uno board converts this analog into corresponding digital output. This digital value of temperature is displayed on LCD. As this device also controls the appliance according to temperature thus, it makes its digital output high when the required condition is matched. The complete source code is shown below, you can directly use this in your system.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 |
#include <LiquidCrystal.h> #define beta 4090 // from your thermistor's datasheet #define resistance 33 // LiquidCrystal display with: // rs on pin 12 // rw on pin 11 // enable on pin 10 // d4-7 on pins 5-2 LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2); int ledPin = 15; int relayPin = 16; int aPin = 8; int bPin = 7; int buttonPin = 6; int analogPin = 0; float setTemp = 20.0; float measuredTemp; char mode = 'C'; // can be changed to F boolean override = false; float hysteresis = 0.25; void setup() { lcd.begin(2, 20); pinMode(ledPin, OUTPUT); pinMode(relayPin, OUTPUT); pinMode(aPin, INPUT); pinMode(bPin, INPUT); pinMode(buttonPin, INPUT); lcd.clear(); } void loop() { static int count = 0; measuredTemp = readTemp(); if (digitalRead(buttonPin)) { override = ! override; updateDisplay(); delay(500); // debounce } int change = getEncoderTurn(); setTemp = setTemp + change * 0.1; if (count == 1000) { updateDisplay(); updateOutputs(); count = 0; } count ++; } int getEncoderTurn() { // return -1, 0, or +1 static int oldA = LOW; static int oldB = LOW; int result = 0; int newA = digitalRead(aPin); int newB = digitalRead(bPin); if (newA != oldA || newB != oldB) { // something has changed if (oldA == LOW && newA == HIGH) { result = -(oldB * 2 - 1); } } oldA = newA; oldB = newB; return result; } float readTemp() { long a = analogRead(analogPin); float temp = beta / (log(((1025.0 * resistance / a) - 33.0) / 33.0) + (beta / 298.0)) - 273.0; return temp; } void updateOutputs() { if (override || measuredTemp < setTemp - hysteresis) { digitalWrite(ledPin, HIGH); digitalWrite(relayPin, HIGH); } else if (!override && measuredTemp > setTemp + hysteresis) { digitalWrite(ledPin, LOW); digitalWrite(relayPin, LOW); } } void updateDisplay() { lcd.setCursor(0,0); lcd.print("Actual: "); lcd.print(adjustUnits(measuredTemp)); lcd.print(" o"); lcd.print(mode); lcd.print(" "); lcd.setCursor(0,1); if (override) { lcd.print(" OVERRIDE ON "); } else { lcd.print("Set: "); lcd.print(adjustUnits(setTemp)); lcd.print(" o"); lcd.print(mode); lcd.print(" "); } } float adjustUnits(float temp) { if (mode == 'C') { return temp; } else { return (temp * 9) / 5 + 32; } } |