Hi, welcome to ESP32 tutorial from Robojax. My name is Ahmad Shamshiri. in this
tutorial we are going to learn we're going to measure the temperatures using
this MAX6675 with k-type thermocouple our sensor and ESP 32 with Bluetooth.
touch and read the temperature in Celsius and Fahrenheit or in Kelvin
using your mobile device. you can get the code for this by clicking on 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 am presenting this tutorial from Canada.
this MAX6675 thermocouple sensor which can be used with any k-type
thermocouple sensor is widely used in many applications in industrial and in
educational institutions for research. and I've written this code so you can
use ESP 32 which already has built-in bluetooth and you don't need to have
anything else and it's available very cheap so you can measure the temperature
using any device that has bluetooth app like Apple tablets or mobile phone like
Android so it will you so you can remotely measure the temperature and
monitor some liquid or chemical or whatever system you have. the only
thing that you need is to make your Arduino enabled with ESP 32 and download
a driver download the library for this which I'm going to show you.
Wiring Explained
now let me explain the wiring. this dustpan on this side is ground the
yellow and then green is a VCC and and here green have been connected to this
five volts and yellow is connected to this ground you can also connect this to
3.3 volt pin. the first pin on the side with a chip is because this works this
works with 3.3 volts up and 5.5 volts. so these treatments from the left
this blue purple white or grey have been so they have been connected to pin 12 14
and 27 here.
Preparing Arduino IDE to work with ESP8266
in order to start using esp 32 with arduino ide you need to prepare arduino
ide for this purpose. you will copy and paste here (will provide the link) you see this package is the
32 index dot JSON at the end so once you paste it here click OK click OK. this is
telling arduino IDE where to get the board driver click on tools-> and then
both boards-> board manager and here wait for this to complete at the bottom this
bar graph and then type here ESP 32 you see ESP32 by isspressif system. this is
installed in your case it will not be insulted you will have install button
here click on it and it will take maybe few seconds or a minute and the
installation once it's completed click close. now we have to tell arduino IDE which
board you're working with because the driver is ready click on Tools-> Boards
this is arduino Uuno which you will usually work but scroll down and tell
you see a line below that all of these are ESP32 eSP 32 wrover module is the
one that you click and select and that dot will appear. now we have to select
the port for that we have to find out which port we are using. right click on
the Start menu->device manager and you see Port click on this arrow to collapse
it and mine is using COMPORT silicon lab if I disconnect it now you will see that
it will disappear connecting it back so this has COM6
note that. click on Tools-> port and you will see COM6 is already selected and
now you can write your program and run it.
once you enable your Arduino IDE with ESP 32 do not worry this Bluetooth as this is
already included. so you should be okay but you need to install the library for
MAX6675 and you should have already watched the video if you have not
this driver installed click on sketch-> include library-> and then manage
library wait for this bar graph to complete and
then type here MAX6675 and press Enter.
and in my case it shows MAX6675 library by Adafruit, installed. in your
case this would not be installed if you haven't done so and this button will be
"install" now its deactivated or grayed. so click install and wait for the bar
graph to complete and when when it's done close it. and here we are defining
here CLK, CS and DO 12 14 and 27 you can change it to any
other digital pin that you want. this title temperature is best text that you
see here you can customize it and change it for whatever other value you want
and this is a text inside the setup that the safety ESP32_ROBOJAX this will be
your device as Bluetooth that you are searching and pairing other than this
there is no other settings inside the code. 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 course is below this video in the
description.
Demonstration of measuring temperature
first go to your app store and search for Bluetooth terminal and here this is
a yellow it's a serial Bluetooth terminal and install it. in my case it's
already installed. Go to your settings on the phone and search for Bluetooth and
my case is connected devices. Touch pair new device once the code is loaded you see it says ESP8266_Robojax
select that and it says pairing and it is now in the
recently connected list. then open those app that you have installed so this is
our app and let's go to this line and then devices as you can see it is here
selected if you have multiple devices you will see them here. let's go back go
back select settings->terminals and from here
you can select the text size so I've selected the largest one and then back
to terminal and now this is the main terminal. from here you can connect as
you can see now it shows connected. to clear the screen just press this delete
and the screen will be cleared. we will see you will see this buttons it was in 1 M
2 & 3 & 4 & 5 so I've changed this customized it. let me hold this for a few
seconds and this is now the C means Celsius and type here 1 for celsius
and select hex and then ok and then go the same way for Fahrenheit and type F
and then 2 for Fahrenheit and then hex because we are sending hex value and the
same way for Kelvin type K and then Kelvin and then 3 for value and then hex.
now this is connected already so if I touch Celsius it reads at temperatures
now it's 28 degrees if I wanted Fahrenheit that's a value and if I want
Kelivn. now I will apply some heat with my
Mastercraft heat gun and increase the temperature
let's read it. and it says 53.5 it's still that temperature is penetrating 64 perhaps so
66 now so because it's metal it's absorbing
that and pressure slowly but now maybe we are at the peak 68 so we can get
Fahrenheit and Kelvin. to clear the screen again we just touch this delete
the screen is cleared. and we can read all over again now is slowly decreasing
Issue with the code
so once you see the connection is lost you have to reconnect again by touching
from here and here is a problem. I'm reading the temperatures
it shows 51.75 and let me apply heat and let's read it
and every time I read it it shows still 51.75 if you want Fahrenheit it will be
always the same value Calvin never updates. so the reason for that problem
is in here. this is the main loop inside the code and the delay that I put is now
20ms, twenty when you put twenty it doesn't have enough time to update the
values to read temperature .and this is a datasheet for MAX6675
and if you scroll down and see here can the conversion time when it converts
it the typical is 0.17 second which means this is 170
millisecond and I put that 20 and the maximum is 220 so you have to have
above this we can put 300 or maybe higher to be safe. We can not go less than
220 so to be safe you have to select higher value and it will work so I'm
putting now 300 and uploading the code the code is uploaded and shows
connection lost let me connect. and clear the screen now and I touch it at read
57.50 now let's apply some heat
and as you can see now it is updating it was 57 62 to 91 let me Claire 92 degrees
90 two point five to five so keep that in mind and that was one of the issue
that I faced.
I would like to thank my Patrons from Patreon.com
Subtitle type and corrected on July 9, 2020 by Ahmad Shamshiri
I did my part to help you learn. Now it's your turn.
You can subscribe to my channel, thumb up 👍 the video and say "thank you" in the comment section.
The link to my PayPal account is below this video if you want to send me chase donation. Thank you.
thanks for watching this was how to measure the temperature with Max xx 7 5
and ESP32 over Bluetooth. if you learn something and found this
useful please thumb up 👍 as this will help my video in the first algorithm of
YouTube. if you have comment or question please posted a comment section below I
try to answer and apply and make sure to subscribe so you get updates of my
upcoming videos
Related Videos
in this tutorial we're going to measure the temperature using k-type
thermocouple our with max six six seven five and esp8266 either NodeMCU or
D 1 mini and display and temperature on the browser using your Wi-Fi