Hi, welcome to another lecture from Robojax. my name is Ahmad Shamshiri
we are going to learn how we can use this k-type thermocouple with Max 6675 to control
a load at the heater or cooler so we can turn it on and off and keep the
temperature in certain range either as a cooler or other heater. I'm using now
bulb as a heater or cooler when the temperature reaches at 100 degrees and
the same we can use it as a cooler I will apply heat when the temperature
reaches 100 degree Celsius this heater will turn off. I'm applying heat
here now
it turned off. You can get the code for this by clicking at the link below the video
in the description which will take you to www.Robojax.com/learn/arduino
let's get started with this
I've seen a lot of requests for this k-type thermocouple with max6675 to
use it at heater control or cooler control with relay to turn on and off
a load. and for that reason I'm using this thermocouple and I'm using this
bulb as a heater and cooler. how it works is for heater and cooler we have two
different start and stop for heater I put for heater and cooler you need to
have two temperature because you cannot have a one number for that reason I put
80 and 100 I put them apart because that demonstration will be easy but for real
application you might have some something very closer for example this
might be start might be 80 and stop instead of 100 maybe 85 it's up to you
in the code you can change it so this is just a demonstration so how it works for
a heater because we want a heat or certain temperature now when the
temperature reaches below 80 degree Celsius the heater control will turn on
at this point so that's why we call it START and our stop is said to be
hundred now the heater will turn on at the temperature will
slowly increase when it reaches 100 degrees
we don't want above that it will turn off the heater and it will not turn on
again until it reaches 80 because this is our range it will stay at this
temperature when it goes below 80 will turn on. and if you want to use it for
the cooler the same way we have it but pay attention the start was on this side
now start is on this side. so when the temperature reaches 100 degrees we don't
want this to heat up so the cooler or refrigerator will turn on at this
temperature (100) for example and it will reduce the temperature slowly cool it
down when it reaches at a stopped and pressure in this case 80 degrees the
cooler will stop. below this this cooler is not used anyways so it is turned OFF. as the
environment temperature will slowly increase when it reaches back to 100
degrees the cooler will start and again stop at 80 so we will always keep the
liquid or whatever you have, within the certain temperature range
In hotter environment you want to control a cooler with the thermocouple or in a
cooler environment you want to use a heater to keep the temperature a certain
level so the thermocouple is one of the one of the option because it can go
depending on the type you can go up to 1,000 degrees Celsius or even higher
I've separate video explaining this thermocouple sensor with Max6675 I'm
not going to explain all the detail and specification the link for that video is
below this video in the description. and also I have an introduction video for
relay. we can use this type of module or it can use this type of module and I
have separate video for those the link for that is also below the video
description. in this video we are going directly on how to use it as a heater or
cooler controller.
Wiring Explained
now let me explain the wiring for the relay we have VCC we have ground and we
have input signal from the left this is connected using orange wire to five
volts the middle pin is ground have been connected using red wire to the ground
and the last one on this side is input it has been connected to pin 8 here.
for this K type sensor to MAX6675 I have connected all these
wire in order as you can see it from this side
I'm just inserting them in order here I'm inserting them from pin 2 to
6 like that. they are in the same order.
for thermocoupler connect Red wire to + and Blue wire to - terminals as shown on photo.
for this demonstration I'm going to use this AC bulb this is a plug that will be
connected to wall outlet and the light will be turned on. the middle at this
point I have disconnected the wire one of the wild the live wire here and I've
twisted them and prepare them these two will be connected to the relay. job of
really is to turn it on by connecting these two wires turning on the light and
disconnecting it turning it off so this can be a bulb or a fan or any other load
the same way the relay will connect it and disconnect it. the two wires that I've
shown you for the AC bulb is connected to these two terminal of this relay and
if you are using this really it will be connected exactly the same way to this
to last terminals and here and in here. and for this one we have here the
negative this will be connected to ground this is connected to five volts
and this pin is the signal or the input which will be connected to pin 8.if
you need the wiring diagram for this it is available as part of my Arduino
course at udemy.com. if you want to learn Arduino I have a
best seller course on udemy where you can learn Arduino ground up with
hundreds of projects all course material library codes wiring diagram everything
available in one place. the link for my Arduino courses below this video in
the description.
now let me explain the code. first thing that you need is to download the library
I will provide you the zip file and this is the address that you can get it I
will also provide you the link that you can get it from there as well
once you download a zip file click on a sketch->Include library->Add .zip library
and then point it to where you are saved it in my case if I go to
this PC->download->tutorial and if this was the zip select it and click open.
after that you have to close your Arduino all incenses that . you have all of
them and then reopen it. if you go now on File->Examples-> and then MAX6675 library
there are two examples already and this is a code that I have written based on
that library. because our relay needs five volts and that thermocouple needs
five volts so we are creating extra five verse a separate video explaining how to
use it but here quickly we are defining a ground pin for our thermocouple pin
to VCC pin which gives 5 volts to pin 3 and also we are defining clock pin .like
that data output for these 3 we are selecting pin 4, 5 and 6.
I have put them in order exactly I've put them in order exactly the way that
they appear on the module so you do not make mistake in the wiring. and here this
is from the library we are creating an object we call it thermocouple and we
pass these three pins here to the library so I already can use them then
this portion is for relay we define a pin for relay, relayPin 8 you can choose to
type something else and then we are defining realyON, relayOFF if you
relay is LOW trigger this is the way you do with LOW it will turn on and with
HIGH it will turn off. if you relay is the opposite and if i tis HIGH trigger that changes
to HIGH and this to LOW otherwise do not change it. initial state is whatever you
want if the really you wanted to be turned ON or the load to be turned ON
change this to this relayON in here otherwise it would keep it off like that.
and then here you can use a temperature either as Celsius Fahrenheit or Kelvin
just set here one two or three depending on whichever you prefer. and you set our
your start temperature at 80 for example and stop temperature at 100 change it
accordingly. and then CONTROL_TYPE here if the most important one. and if you
want to use it as a heater type here one otherwise type here 2 .and inside the
loop if you want to do something else this printing on this side is coming
from here print temperature and then load control so these three this first
one this and this must be here for the system to function but for actual
application you perhaps you do not need it in that case just comment this out
and this will turn off this printing the temperature. but if you want to do
something with a temperature for example the reading is 1000 millisecond you can
reduce it if you want to print it faster. or if you want to read faster this is
now 1000 millisecond or one second and beside that if you want to do something
with temperature you can use F and then temperature this is a variable that is
holding the temperature. and you can do something for example if temperature is
greater than or equal 89.5 you can do something
and the condition is here between these two curly parenthesis put your condition in
here. you can turn ON or OFF a relay or do something else if you want otherwise the
code will work fine. if you need full explanation of the code it is available
as part of my Arduino course at udemy.com.
where I will explain everything.
Demonstration of Heater Control
now let me demonstrate the heater control. for heater control we set this
to one. and in heater control pay attention to the start because we are
starting at this point because we want the temperature to be a certain
level or higher now the temperature when it reaches below 80 degrees
the heater will turn on the heater will stay on until it reaches to the stop
point which we set in our code to be hundred. now at 100 degrees it will
stop and it will stay off until it reaches 80 degrees it will not be on
here when it did you had stop stop it just stopping it when it reaches at
eighty again it will start and the cycle will continue. now the temperature is
around 60 degrees and as you can see the heater is on
because it is below this and the heater is on and is trying to heat it up now we
are using a heat gun to heat it up to reach this hundred to see if it turns
off and when it reaches back at 80 it will turn on.
now let me apply heat.
now at 100 degrees the heater is now turned off. because we don't want any
temperature above this. and it will cool down slowly until it reaches 80 degrees
again it will turn on.
now the heater is turned on and the cycle will continue the same way.
Demonstration of cooler control
now let me explain the cooler control. we have a sort temperature of 100 degrees
Celsius and stop temperature of 80. initially the temperature increases and
reaches 100 degrees the cooler will start and will turn on and will be running until
it reaches 80 degrees and it will stop. because below this we don't need it. then
when the temperature increases this will not turn ON here because the starting
point is at hundred. so it allows it to reach hundred when it reaches hundred
degrees then the cooler will start. so you can adjust this if you want to have
a narrow controlled area for temperature. currently it shows 62 degrees and I
think when it reaches hundred degrees it will turn on let me apply heat with this
heat gun
seventy
so now it will reach at 100 and now this is our cooler the cooler is turned on
and when the temperature reaches at 80 it will stop. now you see this 127
degrees because it's a metal and it when I blowed it slowly it penetrated now and
inside so that's why it's very hot.
so at 80 it we'll turn off now.
now there it is off and the load is off. and it will be off until the
temperature reaches back to 100 to turn it on.
I would like to thank my Patrons from Patreon.com
Subtitle typed and corrected on May 29, 2020 at 05:44 by Ahmad Shamshiri
in Ajax, Ontario, Canada
I did my part to help you learn. It is your turn now to help me.
You can Subscribing 🔔 to my channel, and click 👍 the video and say "thank you".
If you want to send donations, my PayPal account link is below this video.
thank you for watching the forth how to use this thermocouple sensor and the
heater or cooler control with relay and Arduino. if you liked this video
and learned something please stamp up 👍 as this will help my video in the search
algorithm of YouTube. if you have comment or question posted a comment section
below I try to answer and reply .if you want to get updates of my upcoming
videos make sure to subscribe.
Extra Clips
you pay attention to this, when the temperature reaches 100 degrees this
should turn off
quickly seventy
25 so the temperature reaches at 100 and v now turned off this will stay off
until this temperature is drop back to 100 degrees as you can see now it is
almost hundred and thirty six degrees so the temperature is slowly being reduced
if you want to learn Arduino I have a best seller course on udemy where you
can learn Arduino from ground up with hundreds of projects all course material
library codes wiring diagram everything available in one place the link for my
Arduino courses below this video in the description