Hi, welcome to esp8266 D1 Mini, NodeMCU tutorial from Robojax.
my name is Ahmad Shamshiri. in this tutorial we're going to measure the
temperature using k-type thermocouple are with MAX6675
and esp8266 either NodeMCU or d1 mini and display
the temperature on the browser using your Wi-Fi.
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 am presenting this tutorial from Canada.
this thermocouple k-type sensor with MAX6675 is one of the famous
temperature sensors for an industrial application as you can see it can go up
to 1,300 degrees Celsius with the different depending on the type that you
get. but this I have introduction video with all the detail and explanation and
I have a lot of other videos related to this with Arduino but this is the first
time that I'm using esp8266 so we can measure it over Wi-Fi. and either if you
can if you use this LINON d1 mini or this D1 Mini, doesn't matter or the
NodeMCU. because it's all esp8266 that the code that I have written will
work with all of these and we will be able to access it over the Wi-Fi either
on the browser or using your mobile browser mobile phone browser. I'm using
Ajax because accessing this will be very easy so your Wi-Fi needs to be connected
to the Internet and I will also provide you a version that works without
internet as well
To use it with Ajax, set "useAjax=true" and your router should be connected to internet.
To use it with Ajax, set "useAjax=false" and you don't need internet.
so the choice is yours and the temperature will be displayed as
Cynthia's Kelvin and Fahrenheit.
Wiring Explained
and now let me explain the wiring we have here on the side GND, GND is
connected to ground of Arduino the second pin here because yellow is ground
the second ping is here VCC it can be connected to 3.3V to 5
volts the green I have corrected it here to 5 volts the last one,
and connected in order if you see here blue purple gray and they have been
connected to pin 4 3 & 2 accordingly. and if you're connecting it to this it will
be exactly the same. and for this module I've put all this in order and I've
connected them at the same color as you can see here white his first white is
first and yellow is the last one yellow is the last one
so in here yellow is connected to ground and then green is connected to 3.3 volts
and then blue is to d4 purple is d3 and then white is d 2 so I have connected
them from d2 to ground all in order.
Code Explained
now let me explain the code. I've started the example by clicking at file ->examples
and then example for generic ESP8266 and if you scroll down to web server and
then advanced web server I've taken it from here and heavily modified it.
these lines are defining the pins so you don't have to remember the actual GPIO
number these are printed directly on the module so you just connect to these pins
and I've selected from file I've selected the board generic esp8266
module so if you select this this will work fine and otherwise if you select
different if you select for example D1 Mini you have to comment this
meaning right click and comment it like that. but right now I'm uncommenting them
because they are needed. this is the MAX6675 in the library you
can get it by clicking at sketch-> include library and
then manage libraries wait for this to complete and that type MAX6675
and press ENTER and as you can see this is the one mark six six
seven five by Adafruit it shows installed in your case this install will
be active so you can click it in my case it's already deactivated which means it
is installed. so this is part of that and here we are defining for clock for data
and channel select we are selecting D4, d3 d2 because we have
already mapped it and the for d3 d2 means 2, 0, 4 but we don't do that
because this is directly printed on the board and we it will make it easy. and
here you can select the unit from here you can type F capital F for Fahrenheit
K for Kelvin. and this title tell if you want to change it
if this title in here and this title and the lower section is this one. the
refresh time is 5000 millsecond this is five seconds every five seconds this is
refreshing right now it is not connected if you want to refresh it faster put
smaller value whatever you need if you need it
very slower make this larger this 5,000 millisecond means five seconds if you do
not select that "true" here use Ajax if you select this to "false" you will see a
screen something like that where you can get Fahrenheit filters and Kelvin but
now I'm uploading the Ajax so you can see it now I am playing uploading the
Ajax version by setting usaAjax=true and this file ajax dot
google api so we need to have access to the internet if you are trying to use
this one
now let me refresh the page
so this is Ajax now within five seconds because we said this - five seconds it
tries to read that temperature for us and as you can see it's now 29 degrees.
now let me refresh the page so this is Ajax now within five seconds because we
said this - five seconds it tries to read that and pressure for us and as you
can see it's now 29 degrees .and then here you will type your SSID for your
Wi-Fi pay attention to the upper end lower case otherwise it will
not work. and then enter your Wi-Fi password inside this double quotation. 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.
Preparing Arduino IDE to work with ESP8266
the first thing that you need to prepare is your Arduino for esp8266, I have separate
video explaining that. but here I can tell you quickly. I will provide you the
link click on file->preferences and then ->additional board managers URL click here
and then paste like the link that I provided I will provide you this one so
you copy and paste it here. once you paste it you click OK and then click OK.
now this this link will make Arduino to know where to look for the board then
click on Tools-> board and then-> board manager once you're able to type type
esp8266 then you will see this esp8266 by esp8266 community and if you have not
installed it in my case it is installed and there is a remove button in your
case if you have not installed it you will see here install button click on it
and wait and tell the bar graph finishes and then close. and you have to selecct
your board before using it click on tools->boards and here there are tons of
other boards but the one that we are using will be genericEsp8266 module.
select this and the rest of the settings should be automatic. and then you have to
select of course the right port. if you don't know what is the Port that you are
using on the Start menu right click go to device manager or any other way that
you have go to device manager and under the port collapse it and you will see
USB serial maybe you will see some different number but this is a chip
for USB ch340 that's COM11 and that's why I have selected here
and the COM11.
Now your Arduino IDE is ready to work with ESP8266 microcontroller.
Getting the IP address and selecting WiFi
now for demonstration first open the serial monitor from here I've opened it
so you can see this is the serial monitor and after that after uploading
the code press this reset button and if you're using this module just press
just reset button or on this one this reset button so I'm pressing it and pay
attention here. now it shows the IP address that you can access this is IP
address that we are going to type on the browser or we type this one
robojaxESP8266 so I'm pressing this and pressing ctrl C to copy it then the most
important part is that click on your Wi-Fi networks and make sure that you
are connected to the same network as this module. This is connected to Robojax
and as you can see this is connected to Robojax. here I'm gonna
open a new tab and pressing control V so this is the screen and that is the
temperature that is reading from here.
Demonstration of measuring temperature with NodeMCU
and here this is currently I'm at the 192,168.1.100 also you can
copy this robojaxESP8266 and then open a tab and paste it and
it will open. so now I'm taking this heat gun and I will apply some heat here so
this is now made with Ajax and it will update every five seconds
and as you can see this is the temperatures that we are reading now as
the temperature increased so it's responding very well. and here now I just
have opened 192.168.1.100 and here is a
temperature that is displaying from this module and as time passes by that the
pressure will be reduced if I hold it with my hand I will cool it down
you
Demonstration of measuring temperature with D1 Mini
and here is a demonstration with d1 mini either this type or this type doesn't
matter. and once I opened the screen this is now that temperature and let me apply
some heat using the heat gun
and after five seconds and it refreshes and to show you the temperature as you
can see and we can change the time so you can refresh very quickly and here on
192.168.1.102 also I can see it here.
there is no limit for accessing it you can connect a lot of devices I do know a
specific number but it should work for few devices so that temperature is being
reduced slowly and here on that screen and as well in here so each will update
at the friend interval of five seconds
I would like to thank my Patrons from Patreon.com
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.
thank you for watching this was how to display it in pressure from k-type
thermocouple our sensor with MAX6675 over the Wi-Fi on the browser.
thank you for watching a tutorial from Robojax. if you learn something and
found it useful please thumb up 👍 as this will help my video in the search
algorithm of YouTube. if you have comment or question please post a comment
section below I try to answer a reply. and to get
updates of my upcoming videos make sure to subscribe. 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.
Extra clips
the power and this is the charge led1 if you connect the
battery it will charge let me connect this so I will put it from the Boren
thinking feet up the light the green light now it is charging and the red
shows the power