Hi, welcome to esp8266 D1 Mini and NodeMCu tutorial from Robojax.
my name is Ahmad Shamshiri. in this tutorial we are going to see how we can
use this this MLX90614 non-contact infrared temperature
sensor to measure the temperatures over Wi-Fi with NodeMCU or d1 mini so
we can touch and get that temperature in Celsius Fahrenheit or in Kelvin or from
your desktop and tablet. you can get the code for this by clicking at the link
below the video in the description which will take you to the bojack's comm slash
learn / arduino let's get started with this.
I am presenting this tutorial from Ajax, Ontario, Canada.
a separate video explaining this MLX90614 infrared non-contact
temperature sensor that it measures using infrared without
contact in that video I've explained everything about this including the
datasheet specification and many other features of it in this video we are just
going to focus on displaying the temperature on the browser or either
your phone or your tablet or computer quickly mentioned that this will measure
like that from this point when it goes further away it gets the wider view and
the accuracy will be reduced so this is accurate within one or two centimeters
but if you go further away it will be the average so you will not get the
proper value keep that in mind. and for longer distance you need to have a different type
of this which has a longer length which is very expensive but you can measure to
up to 25 centimeters or the references so you can find them online. and then on
the browsers you will see something like this when you press it it will give you
the temperature and if I press it quickly so this will measure my hand
temperature and this is the ambient temperature also you can get it in
Fahrenheit and the other values and very important to know that I'm implementing
this in two ways one is with Ajax what it means is that this page is now not
being loaded and when I when I press this it reads the temperature without
reloading the whole page. so it uses Ajax only this portion is being updated when
I click here. and when I click here only this portion is updated the rest stays
there and it looks more nice but here is a problem if you want to
use it then inside the code the server this web server must be able to access
this jQuery AJAX library and it needs Internet.
and if you don't have internet then do not use Ajax
I have another version that doesn't need anything the difference is that when you
click the whole page will be refreshed and it will display it as well so keep
that in mind. since some applications people do not have internet and the area
that they tested so it should work without internet. make sure to install
the library for this and use it so you can measure the temperature and display
it on the serial monitor before coming to this video. and this is a d1 mini the two types
that you select from the front name and this is a NodeMCU but both of these
these are all esp8266 chip we are using combination of the drivers for this and
the driver for this to make this project happen.
Preparing Arduino IDE to work with ESP8266
the first thing that you need to prepare is your Arduino for esp8266 a 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 drivers. then
click on Tools->Boards and then board manager once you are 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 select
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 generic esp8266 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 pour 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
serial 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 a COM11
you
Now your Arduino IDE is ready to work with ESP8266 microcontroller.
Wiring Explained
now let me explain the wiring for this module
this is labeled as VIN ground and this VIN is connected using this brown wire to 5
volts to destined now let me explain the wiring deston is labeled as VN ground VN
is connected using this brown wire to this 5 volts here the last thing is
labeled as 5 volts. and if you're using this module exactly the same we have
also 5 volts here. the next one is ground ground is connected using this red wire
this was just the order of wires otherwise I did not use red so that it
is connected to ground here and then we have SCL and SDA, SDA is the last
one yellow it has been connected to pin 2, SCL is connected to pin 1 and these
are the I2C pins for esp8266 and the same way we will connect the VIN to
3.3 volts to this pin because it works with 3.3 volts and 5 volts so
you don't worry you can connect it here ground will be connected to one of the G
and then we have D 1 and D 2, D 1 is SCL and D2 is SDA. so all of these
modules and modules that you have from esp8266 NodeMCU or D 1 mini it will
work because it's the same esp8266 chip either without the metallic case
like this or the metallic if they are exactly the same.
Code Explained
I've started this project by opening an example from ESP8266 repository. if
we click on File->Examples, under examples for Generic esp8266 module and
scroll down to esp8266 webServer and then select advancedSebServer. this is
example I've started and I heavily modified it for this project . we have
defined this is ESP8266 or the D1 mini whichever you use we have
defined them as a web server which prints this page every page that you go
on the internet having is generated by a web server in this case this is our web
server. now let me explain the code. we have defined here this object and
ambient text inside this array you see there is double quotation so that's a
text and each text is separated with a comma.
and this is a text that you see in here object and ambient. then you define your
Wi-Fi SSID in here and then your Wi-Fi password pay attention that Wi-Fi SSID
is case sensitive so uppercase and lowercase matters otherwise you might
get error. and in this section if you want to rename these texts get degree
Celsius get degree Fahrenheit and degrees Kelvin you can modify them from
these three lines these are three push buttons and here it says get and then
the degree symbol for HTML and Celsius ,Fahrenheit and Kelvin if you need to get
the full explanation of the code it is available as part of my course the link
is below the video you can purchase it.
Demonstration with NodeMCU on Desktop
And here is the demonstration. to start using the Wi-Fi I'm clicking on my Wi-Fi
logo at the bottom and make sure that you are connected to the same Wi-Fi
network that this module is connected so I am connected here at Robo Jack's
because this is connected to Robo Jack's that's the first thing then and Arduino
open the serial monitor either click here or click tools and then serial
monitor so I'm clicking on this icon to open it and bring the serial monitor so
you can see it now you don't see anything on the serial monitor yet we
have to press this reset button and you will be able to see that you will see
the IP address here 192.168.1.100 this IP
address will be different on your machine on your network and you can
access it using this IP address and you can access it using robojaxEsp8266.
let me try this one first I am just pressing ctrl C copying it and let me
open a new tab pasting it and enter and as you can see the page that is
generated by this is displayed in here and if we copy this one and then paste
it enter and we are getting the same but if you in your network as for some
reason this esp8266 doesn't work this IP for sure works with every network. so
the demonstration with the Ajax and for Ajax we need to have this file so your
Wi-Fi must be connected to the Internet in order for this to work (just wait we have it without internet as well) so now I'm
pressing the C and it is getting my temperature and the ambient is 27.9
and let's go or Fahrenheit the same way if I click it
will get the average of the surface that it is pointing to. and if I go to Kelvin.
this is my skin temperature and this is e without that so this is a ambient and
as object
Demonstration of NodeMCU on mobile phone
now that have a demonstration with accessing your mobile phone the same as
the browser you must be connected to the same Wi-Fi so my Wi-Fi is connected to
the Robojax and this board is also connected to the same SSID.Now open your
browser and enter the IP address that you read on the screen so this is one
192.168.1.100 and when I press ENTER this is
what I got now I have put my hand and then let's read it and that's the
temperature that we are reading let's read it again and let's read Fahrenheit
and Kelvin as you can see the page is not being refreshed because this is the
Ajax version it it looks nicer.
Demonstatation using D2 Mini On Desktop
just pressing this and opening the serial monitor
and now the IP address is 192.168.1.102 and here is a
demonstration with d1 mini either this module or that module doesn't matter and
I'm holding my finger let me click this is the Ajax version and we're reading
the temperature thirty three point nine nine degrees Celsius and in terms of
Fahrenheit ninety three point zero seven and Kelvin 307 and ambient temperature
also shows here as you can see it's responding perfectly.
Demonstration using D1 Mini on mobile phone
and here on my phone I'm going to 192.168.1.102 and pressing enter due to and this is a
screen that I'm getting let's read the temperatures in Celsius and 34.5 let's
get it in Fahrenheit 94.1 and Kelvin as well Celsius so this is my body
temperature the object and then the ambient and if I remove my finger it
goes and gets the average of the further distance so it perfectly responds.
I would like to thank my Patrons from Patreon.com
I have provided 2 codes for this project. 1 with Ajax and one without Ajax. you can choose whichever you like.
you
Subtitle typed and corrected on July 05, 2020 by Ahmad Shamshiri.
I did my part to help you learn and use this.
You can simply subscribe to my channel, thumb up 👍 the video and say simple "thank you".
the link to my Paypal account is below this video, if you want to send me cash. thank you.
thank you for watching this was how to use this ml x90 6 and 4 over Wi-Fi
either with your mobile device or your desktop with no the MCU and even mini to
measure the temperature if you learn something and found this useful please
thumb up 👍 the video as this will help my video in the search algorithm of youtube. if
comment or question please post it at the comment section below
I always try to answer and reply. if you want 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.