This tutorial is part of: Controlling Relay Using Arduino
This is groups videos all related to relay. Links to other videos are below this article.
MAX6675 K-ટાઈપ થર્મોકપલને રિલે અને ડિસ્પ્લે સાથે ઉપયોગ કરવું
આ પ્રોજેક્ટ દર્શાવે છે કે કેવી રીતે MAX6675 K-પ્રકારના થર્મોકપલને Arduino સાથે જોડવું, જેમાં નિયંત્રણ માટે રિલે અને તાપમાન રીડિંગ્સ માટે ડિસ્પ્લે સામેલ છે. આ સેટઅપ વિવિધ એપ્લિકેશનો માટે અમૂલ્ય છે જ્યાં ચોક્કસ તાપમાન મોનિટરિંગ અને સ્વચાલિત પ્રતિસાદની જરૂર હોય છે. અહીં કેટલાક પ્રોજેક્ટ વિચારો છે:

- સંવેદનશીલ ઇલેક્ટ્રોનિક્સ માટે ઓવરહીટ સંરક્ષણ
- જૈવિક પ્રયોગો માટે તાપમાન-નિયંત્રિત ઇન્ક્યુબેટર
- કોફી અથવા બીયર માટે સ્વચાલિત ઉકાળવાની સિસ્ટમ
- ઔદ્યોગિક પ્રક્રિયા મોનિટરિંગ અને નિયંત્રણ
- ગ્રીનહાઉસ અથવા અન્ય નિયંત્રિત વાતાવરણમાં પર્યાવરણીય મોનિટરિંગ
હાર્ડવેર/ઘટકો
આ પ્રોજેક્ટ બનાવવા માટે, તમારે નીચેના ઘટકોની જરૂર પડશે:
- Arduino Uno (અથવા સુસંગત બોર્ડ)
- MAX6675 K-પ્રકારનું થર્મોકપલ મોડ્યુલ (વિડિયોમાં 00:58 પર)
- રિલે મોડ્યુલ
- TM1637 4-અંકનું LED ડિસ્પ્લે મોડ્યુલ
- જમ્પર વાયર
- કનેક્ટિંગ વાયર
વાયરિંગ માર્ગદર્શિકા
વાયરિંગ વિડિયોમાં સમજાવવામાં આવ્યું છે (વિડિયોમાં 05:36 પર). ચોક્કસ જોડાણો આના પર નિર્ભર કરે છે કે તમે સરફેસ માઉન્ટ ચિપ અથવા PCB મોડ્યુલનો ઉપયોગ કરી રહ્યા છો. વિગતવાર વાયરિંગ ડાયાગ્રામ માટે વિડિયો જુઓ.

કોડ સમજૂતી
Arduino કોડ થર્મોકપલમાંથી તાપમાન મૂલ્યો વાંચવા માટે MAX6675 લાઇબ્રેરીનો ઉપયોગ કરે છે. કોડના મુખ્ય રૂપરેખાંકિત ભાગો છે:
- થર્મોકપલ પિન વ્યાખ્યાઓ:
thermoDO,thermoCS, અનેthermoCLK(વિડિયોમાં [03:53] પર). આ પિન તમારી વાયરિંગ યોજના અનુસાર ગોઠવવાની જરૂર છે. - રિલે નિયંત્રણ પિન: રિલેને નિયંત્રિત કરવા માટે પિન 10 નો ઉપયોગ થાય છે (વિડિયોમાં [05:36] પર). જરૂર પડે તો આ બદલો.
- ડિસ્પ્લે રૂપરેખાંકન (જો ઉપયોગમાં હોય તો): કોડમાં TM1637 ડિસ્પ્લેને રૂપરેખાંકિત કરવા માટેના વિભાગો શામેલ છે. જરૂર પડે તો CLK અને DIO પિન ગોઠવો (વિડિયોમાં [03:53] પર).
કોડમાં સેલ્સિયસ અને ફેરનહીટમાં તાપમાન વાંચવા માટેના કાર્યો શામેલ છે. કોડનો એક નિર્ણાયક ભાગ શરતી વિધાન છે જે તપાસે છે કે તાપમાન થ્રેશોલ્ડ (આ ઉદાહરણમાં 80.0°C) કરતાં વધી જાય છે કે નહીં. જો તે વધે છે, તો રિલે સક્રિય થાય છે (પિન 10 LOW થાય છે).
// જો તાપમાન 80.0C થી ઉપર જાય, તો રિલે ચાલુ કરો
if(thermocouple.readCelsius() > 80.00){
digitalWrite(10, LOW);// પિન 10 ને LOW સેટ કરો
} else {
digitalWrite(10, HIGH);// પિન 10 ને HIGH સેટ કરો
}
લાઇવ પ્રોજેક્ટ/પ્રદર્શન
વિડિયો પ્રોજેક્ટને કાર્યરત દર્શાવે છે (વિડિયોમાં 06:59 પર). સેન્સર આસપાસનું તાપમાન ચોક્કસ રીતે વાંચે છે અને ગરમ કરવાથી વધે છે. રિલે કાર્યક્ષમતા પણ દર્શાવવામાં આવી છે.
પ્રકરણો
- [00:00] પરિચય
- [00:39] સેન્સર ઝાંખી
- [01:40] પિન જોડાણો
- [02:22] લાઇબ્રેરી ઇન્સ્ટોલેશન
- [03:53] કોડ સમજૂતી (સેટઅપ)
- [04:06] કોડ સમજૂતી (લૂપ)
- [05:36] વાયરિંગ
- [06:59] લાઇવ પ્રદર્શન
This tutorial is part of: Controlling Relay Using Arduino
- આર્ડુઇનો કોડ અને ડ્યુઅલ-ચેનલ 5V રિલે માટે વિડિઓ
- આર્ડુઇનોનો ઉપયોગ કરીને 5V રિલેને નિયંત્રિત કરવું, જેથી બલ્બ અથવા મોટર જેવા AC અથવા DC લોડને નિયંત્રિત કરી શકાય
- TTP224 4-ચેનલ ટચ સેન્સર રિલે સાથે AC/DC લોડ ચાલુ કરવા માટે
- આર્ડુઇનો સાથે 5V રિલે મોડ્યુલ (લો-ટ્રિગર) નો ઉપયોગ કરવો
- રીડ સ્વિચનો ઉપયોગ કરીને આર્ડુઇનો સાથે રિલે અને AC/DC લોડ્સને નિયંત્રિત કરવું
- TTP223B ટચ મોડ્યુલ અને રિલેનો ઉપયોગ કરીને Arduino સાથે AC/DC લોડને નિયંત્રિત કરવું
- આર્ડુઇનો પુશ બટનનો ઉપયોગ કરીને રિલે અને AC બલ્બ સ્વિચ કરવું
/*
* This is the Arduino code for MAX6675 Thermocouple K-Type with Relay and Display.
* This code has been explained in our video at https://youtu.be/cD5oOu4N_AE.
*
* Written by Ahmad Shamshiri for Robojax Video
* Date: December 9, 2017, in Ajax, Ontario, Canada
* Permission granted to share this code given that this
* note is kept with the code.
* Disclaimer: This code is "AS IS" and for educational purposes only.
*
*/
// This example is public domain. Enjoy!
// www.ladyada.net/learn/sensors/thermocouple
#include "max6675.h"
int thermoDO = 4;
int thermoCS = 5;
int thermoCLK = 6;
MAX6675 thermocouple(thermoCLK, thermoCS, thermoDO);
int vccPin = 3;
int gndPin = 2;
void setup() {
Serial.begin(9600);
// Use Arduino pins
pinMode(vccPin, OUTPUT); digitalWrite(vccPin, HIGH);
pinMode(gndPin, OUTPUT); digitalWrite(gndPin, LOW);
Serial.println("Robojax: MAX6675 test");
// Wait for MAX chip to stabilize
delay(500);
}
void loop() {
// Basic readout test, just print the current temperature
Serial.print("C = ");
Serial.println(thermocouple.readCelsius());
Serial.print("F = ");
Serial.println(thermocouple.readFahrenheit());
// If temperature goes above 80.0C, turn the relay ON
if(thermocouple.readCelsius() > 80.00){
digitalWrite(10, LOW);// Set pin 10 LOW
}else{
digitalWrite(10, HIGH);// Set pin 10 HIGH
}
delay(1000);
}
/*
* This is the Arduino code for MAX6675 Thermocouple K-Type with Relay and Display
* The output pin 10 is connected to the relay.
* When the temperature reaches the desired value, pin 10 turns the
* relay ON.
* This code has been explained in our video at https://youtu.be/cD5oOu4N_AE
*
* Written by Ahmad Nejrabi for Robojax Video
* Date: December 9, 2017, in Ajax, Ontario, Canada
* Permission granted to share this code given that this
* note is kept with the code.
* Disclaimer: This code is "AS IS" and for educational purposes only.
*
*/
// This example is public domain. Enjoy!
// www.ladyada.net/learn/sensors/thermocouple
#include "max6675.h"
int thermoDO = 4;
int thermoCS = 5;
int thermoCLK = 6;
MAX6675 thermocouple(thermoCLK, thermoCS, thermoDO);
int vccPin = 3;
int gndPin = 2;
void setup() {
Serial.begin(9600);
// Use Arduino pins
pinMode(vccPin, OUTPUT); digitalWrite(vccPin, HIGH);
pinMode(gndPin, OUTPUT); digitalWrite(gndPin, LOW);
pinMode(10, OUTPUT);// set pin 10 as output
Serial.println("Robojax: MAX6675 test");
// wait for MAX chip to stabilize
delay(500);
}
void loop() {
// basic readout test, just print the current temp
Serial.print("C = ");
Serial.println(thermocouple.readCelsius());
Serial.print("F = ");
Serial.println(thermocouple.readFahrenheit());
// If temperature goes above 80.0C, turn the relay ON
if(thermocouple.readCelsius() > 80.00){
digitalWrite(10, LOW);// set pin 10 LOW
}else{
digitalWrite(10, HIGH);// set pin 10 HIGH
}
delay(1000);
}
/*
* This is the Arduino code for MAX6675 Thermocouple K-Type with Relay and Display
* The output pin 10 is connected to the relay.
* When the temperature reaches the desired value, pin 10 turns the
* relay ON.
* The temperature is also displayed on the display.
* You must include the TM1637 library to make the display work.
* You can download the TM1637 from http://robojax.com/learn/library
* This code has been explained in our video at https://youtu.be/cD5oOu4N_AE
*
* Written by Ahmad Nejrabi for Robojax Video
* Date: December 9, 2017, in Ajax, Ontario, Canada
* Permission granted to share this code given that this
* note is kept with the code.
* Disclaimer: This code is "AS IS" and for educational purposes only.
*
*/
// This example is public domain. Enjoy!
// www.ladyada.net/learn/sensors/thermocouple
#include "max6675.h"
#include <Arduino.h>
#include <TM1637Display.h>
int thermoDO = 4;
int thermoCS = 5;
int thermoCLK = 6;
// Code for display
#define CLK 2
#define DIO 3
#define TEST_DELAY 2000
TM1637Display display(CLK, DIO);
// Code for display end
MAX6675 thermocouple(thermoCLK, thermoCS, thermoDO);
int vccPin = 3;
int gndPin = 2;
void setup() {
Serial.begin(9600);
// Use Arduino pins
pinMode(vccPin, OUTPUT); digitalWrite(vccPin, HIGH);
pinMode(gndPin, OUTPUT); digitalWrite(gndPin, LOW);
pinMode(10, OUTPUT);// set pin 10 as output
Serial.println("Robojax: MAX6675 test");
// wait for MAX chip to stabilize
delay(500);
}
void loop() {
// Basic readout test, just print the current temp
// Code for display
display.setBrightness(0x0f);
// All segments on
uint8_t data[] = { 0x0, 0x0, 0x0, 0x0 };
display.setSegments(data);
delay(1);
int temp = (int) thermocouple.readCelsius();
display.showNumberDec(temp, true, 3, 0);
// Code for display end
Serial.print("C = ");
Serial.println(thermocouple.readCelsius());
Serial.print("F = ");
Serial.println(thermocouple.readFahrenheit());
// If temperature goes above 80.0C, turn the relay ON
if(thermocouple.readCelsius() > 80.00){
digitalWrite(10, LOW);// set pin 10 LOW
}else{
digitalWrite(10, HIGH);// set pin 10 HIGH
}
delay(1000);
}
/*
* This is the Arduino code for MAX6675 Thermocouple K-Type with Relay and Display
* The output pin 10 is connected to the relay.
* When the temperature reaches the desired value, pin 10 turns the
* relay ON.
* This code has been explained in our video at https://youtu.be/cD5oOu4N_AE
*
* Written by Ahmad Shamshiri for Robojax Video
* Date: June 02, 2018, in Ajax, Ontario, Canada
* Permission granted to share this code given that this
* note is kept with the code.
* Disclaimer: This code is "AS IS" and for educational purposes only.
*
*/
// This example is public domain. Enjoy!
// www.ladyada.net/learn/sensors/thermocouple
#include "max6675.h"
int thermoDO1 = 4;
int thermoCS1 = 5;
int thermoCLK1 = 6;
int thermoDO2 = 7;
int thermoCS2 = 8;
int thermoCLK3 = 9;
MAX6675 thermocouple1(thermoCLK1, thermoCS1, thermoDO1);// first thermocouple
MAX6675 thermocouple2(thermoCLK2, thermoCS2, thermoDO2);// 2nd thermocouple
int vccPin1 = 3;
int gndPin1 = 2;
int relayPin1 =10;
int vccPin2 = 11;
int gndPin2 = 12;
int relayPin2 =13;
void setup() {
Serial.begin(9600);
// use Arduino pins
pinMode(vccPin1, OUTPUT); digitalWrite(vccPin, HIGH);
pinMode(gndPin1, OUTPUT); digitalWrite(gndPin, LOW);
pinMode(relayPin1, OUTPUT);// set pin 10 as output for thermocouple1
pinMode(vccPin2, OUTPUT); digitalWrite(vccPin, HIGH);
pinMode(gndPin2, OUTPUT); digitalWrite(gndPin, LOW);
pinMode(relayPin2, OUTPUT);// // set pin 13 as output for thermocouple2
Serial.println("Robojax: MAX6675 test");
// wait for MAX chip to stabilize
delay(500);
}
void loop() {
// basic readout test, just print the current temp
// for thermocouple 1
Serial.print("C = ");
Serial.println(thermocouple.readCelsius());
Serial.print("F = ");
Serial.println(thermocouple.readFahrenheit());
// if temperature goes above 80.0C, turn the relay ON
if(thermocouple1.readCelsius() > 80.00){
digitalWrite(relayPin1, LOW);// set pin relayPin1 LOW
}else{
digitalWrite(relayPin1, HIGH);// set pin relayPin1 HIGH
}
// thermocouple1 end
// for thermocouple 2
Serial.print("C2 = ");
Serial.println(thermocouple2.readCelsius());
Serial.print("F2 = ");
Serial.println(thermocouple2.readFahrenheit());
// if temperature goes above 80.0C, turn the relay ON
if(thermocouple2.readCelsius() > 80.00){
digitalWrite(relayPin2, LOW);// set pin relayPin2 LOW
}else{
digitalWrite(relayPin2, HIGH);// set pin relayPin2 HIGH
}
// thermocouple2 end
delay(1000);
}
Resources & references
Files📁
Other files
-
MAX6675 library
robojax-max6675-thermo.zip0.01 MB