My name is Ahmad Shamshiri. I am presenting this tutorial from Canada.
Hi! Welcome to Robojax. in this video I'm going to show you how we can use this MAX6675
modules with a K-type connectors thermal couple art or you will see three section where we'll be
just measuring temperature with this one using Arduino. the second stage will be connecting it
to a relay controlling a load. and the third stage will including the display so we will have three
type of project and three different type of codes so you can see from basic to the second level and
third level. so this is used extensively in the industry to monitor the temperature and this can
go for example this one with a manual this can go from 0 to 600°C (other models can go to 1024°C) it can measure and this unit
is very simple can be used with or the winner so I'm gonna show you how you can set this up
I'm gonna heat this up and practically measure temperature and after that I'm gonna show you
how you can turn something on and off an AC load with the relay. then I'm gonna show you connecting
it to controlling an AC load like this this is a ball but this can be also a fan so we will
use this module using the relay to control the AC load at the certain temperature so either we set
the temperature that if it reaches above that the load will be turning on for example if there is a
cooler to cool it based on temperature or maybe we can set it if the temperature goes below certain
level we can also turn on a load like a heater to bring up the heat back so this relay and
this device can do this. also let's have a look at this specs from Maxim integrated .this is MAX6675
this is a chip that can do the calculation with a k-type thermocouple from zero to 1024°C
degrees Celsius. and here is the chip configuration of the chip is this is very tiny
so we don't have to worry how it works but the only thing that you should know the resolution
is 0.25 degrees Celsius and it's 12bits. how you can download I will provide that full project and
also that library link that you can directly downloaded from the GitHub and also we
will provide it at Robojax.com the link will be at the description. but so first you do is either
from our website Robojax.com or from GitHub which we provide the link you can just click here
so download it and once download is completed. click on show folder after that right click on
the on this and then select with the 7-zip is a free software if you don't have it you can get it
from www.7-zip.org and then select "extract here". once this is done you will see a folder called the same name as
that one so maxixe have a library so let me just open it for you so it has two files max6675cpp
and max6675.h these are very important files that are needed and here are the examples so
(Click on Sketch->Library->Add .zip library) I'm just exiting that folder then right click copy so this one's copy that go to wherever you have
you are you know in my case or doing this in the Downloads folder and then I have or do you know
multiple Arduino so this is or do you know that I'm looking for and then inside the Arduino folder
this is a file that I am running to open the Arduino so go under the library and inside this
some blank area right click and then paste it. so once you paste it this is a folder that is there
Close Arduino IDE and re-open it.
you download it just go to file and then example and then go here max library and then select the
serial. so let's have a look here depends with a code that I have we have the first pin which is
data outputs do that goes to pin 4 then this is the clock select or cable select pin 5 and this is
a clock pin 6 so 4, 5, 6 and then we have VCC (5V) and then ground or this goes to four
five and six this is a positive this is a negative so and then the three pin or two four five and six
and positive and negative or from here to the breadboard and from breadboard to there so this
is just follow those whichever we can connect it doesn't matters connected directly or connect it
through the breadboard doesn't matter so now this is a k-type thermocouple. so let me open the code
for you and then explain it so when you open the code the first line this is a library that goes
to the .h file and .h requires .cpp so don't worry about it just leave it here and we
are defining three variables of type integer so pen for is called do thermal do and the thermal
CS and thermal CLK so four five and six is set well if your Arduino Spencer occupied you can
change them accordingly to something else and then here we are creating the thermocouple here
and then we are assigning this as the object and you are assigning pen four and five and four and
five and pin 6 to the library which goes here so you do not touch this and you do not worry
about it VCC pen three and pen to death if you follow it fine if not don't worry you can even
remove it will work so this is for printing on a screen this is a serial monitor 9600 baud the
speed and then here we see pen so as I mentioned if you don't put that you can delete this because
you don't have to go this way just connected directly to positive and negative and this is
now just printing the text and here it says wait for 500 millisecond which is half a second for
the chip to stabilize so this is done inside the setup now inside the loop is very simple
it just prints see and then remember we created objects here that object is here thermocouple
then this method dot read failure Celsius when you put dot read Celsius it gets the
temperature in failures Celsius and if you want it in Fahrenheit just put thermocouple dot read
for a night the first one is print the second one is print LM so this is printed and this
parent beside it without any Intel and then it will print an interline and then it waits for
1000 milliseconds which is one second so then it goes again to the loop so just continues and
it reads it so now let me just stop upload the code normal room temperature that's compiling
so as I start reading every second at least 20 6.25 centigrade on seventy nine
point two five and Fahrenheit so it just reads it now let me just apply some heat
So I have a heat gun here and I'm applying some heat so please pay
attention to the temperature and this area the bottom one
say it reached hundred degrees Celsius which is 220 foreign height still increasing but it
will be stabilized and now started slowly it will start decreasing so this can be tightened
to any industrial application because it has wire and it will withstand a temperature of up
to a hundred degrees so don't worry about it just put it up to 600 degrees this can handle
I've now changed the coat and I've added this one and 10 as an output so we can control it
really nothing else has changed and here after this I put this condition and I said if this
is the value of Celsius I said if the Celsius temperature is bigger than 80 said the pen 10
as low otherwise keep it high so this is the characteristic of this relay that normally it
should be low in order to disconnect this normally open of normally open and oh and
common so what you do is you can you connect your load or two wires here and here so common
and normally open if this is the reverse of what you're doing keep this one the middle wire the
same just move this on the other side that will be normally connected so one of them will work
for you but let me explain the AC bulb here so this is a table light that is connected to the
wall outlet and then the wire goes and will be turned on but I have disconnected one of these
two wires here so let me show you so I've just cut this wire from here now this can be connected to
that relay the relay job is to just connect it so it will be on and disconnect it will be off I've
just twisted them and then put some solder so this can be inserted into a connectors with the screw
so I have connected the load here between the common and normally open so the relay is here
the power is now connected as you can see here the temperature shows at 45 degrees or 44 degrees so
now I'm gonna heat this up and as you can see I said this that the relay should go on at 80
degrees so let me test it now I'm applying heat so you also pay attention to the temperature here
so at 80 that relates on and let's just connected let's say this was a fan and the temperature and
went above the threshold of 80 so the fan will start working to cool things up this was one
way if you want to do it the other way that the temperature reaches a certain level then
H something should be off like heater so you can set it that the lower temperature the heater is
working and slowly when it reaches 80 degrees at 80 it will shut off when the temperature reaches
below 80 the load will turn off now I said this normally its high which means the relay is on
we assume that the load is some kind of heater so let me just connect it and load it so by default
it's on and the temperature is now 71 degrees so when the temperature reaches 80 this will turn off
okay so now the load is turned off because we reached 80 degrees now it's on almost 96 99 Wow
100 degrees so it's very hot now Celsius so this way you can do it so when the temperature goes
below 80 again this will turn on so it's almost 80 now you see it will turn on corrected now the
road and then let's just say I'm going to show you how we can connect it so you can see live
value here I have another video explaining this team one six seven one six three seven
this module I have complete video for this one but I'm gonna use it quickly here to show you
so we have a few pencil ground VCC the ground is ground GCC has five volts and then we have
clock this goes to pen two with a code that I'm providing and then this is going for data
input that goes to sentry so and then plugging in this into pin two and Gen 3 and then the
Ground and another value is connected so now this is connected let me show you the code
So the code has changed as follow we have added these two lines for
this one I have another video that explains how to get a library for
this one so get the library from the link that's provided at the description below
so once you have this library file everything will be fine just copy and paste this code that I'm
providing so I'm explaining that the difference between previous code and this code is this two
line and then here we have n2 for the clock this is for the data another section and these so these
are for the display nothing added there and this line sets the brightness to the maximum and this
line with this set the value of the display to be zero again we have another video to explain
it so at this step what I've done is this is the Celsius that this prints on the screen so
I've taken this one and using the cache method because this is a float I'm converting it to
integer and storing at the temple temperature and then here we say display show number decimal temp
two root three it's three digit we says show at three digit stores from zero which means from the
left side to room in also show a zero on the left side so that's at that else is the same so let me
just now turn this on upload the code and show you the temperature that you see on the screen
So here it's safe for the nine degrees and the same thing that
you see on the screen you will see now let me just heat up this one
and you can pay attention here at this temperature and also pay attention here
As you can see the compressor is increasing
and it's completely reflecting the temperature that you see there all the codes for this in
three stage the first stage the sample code and also then the second stage the
rear a code and the third stage the adding the display will be provided at the link
of the description which you will take you to robotics that come / to learn /
or do we know all our codes are available at Robojax.com. thank you for watching please
thumb up 👍 the video and also please share it a subscribe so you can get updates I appreciate