Hi, welcome to an Arduino tutorial from Robojax. in this video we are going to
introduce the D1 Mini development board based on esp8266 Wi-Fi module. I'm going
to show you how to install the driver prepare your the Arduino so you can
start programming first we'll run a simple blink code to blink an LED then
we select different pin to blink an LED after that you will learn about pin
mapping so you can easily use the pin then we will use this module as
httpclient meaning that we will send a request to a web page and retrieve the
information from the web you can get the code librarian driver 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
with the introduction of esp8266 and 66 and the subsequent other versions of this
module the Internet of Things (IoT) have been revolutionized a lot of devices from
small to large they can be connected meaning that we can control devices over
the Wi-Fi from across the world or within the network and this module with
the price and size and capability makes it suitable for a lot of applications
the module is such that you can start using it with an Arduino IDE or Arduino
environment program with a familiar code that you write at the back end it will
be compiled using Python and other methods to be uploaded to the device but
without further ado here is a device
Hardware explained
and this is the D1 Min module when you receive it they ship it with three
types of headers one is this long one if you want to stack it on the other
devices so you have this long header with long pins and this side is female
so you can insert other item on top of it the other one is the a female
short without extended pin and the third one is the regular mail like this I'm
going to solder this because I might need to connect different devices and
this will make it easy for me you are selecting the side which side solder
make sure to select the side that has that much of this for example here when
I hold this I see here the 5V volts and TX is in
here so I have to see that 5V volts and TX is here I can put my header here
if you try it this way the 5V volts will not be here while the 5V volt is
on the other side and it will not work now this has been soldered
there are different variation of it do not worry about it
once you bought it, it has a four megabyte of RAM and these are the pin all the
specification operating voltage is 3.3 volts but we will feed in 5 volts to it
and it has a regulator belton the frequency is either it works 80 or 660
megahertz the software were selected and I'm using that data I've drawn this I
put all the data accordingly the pin have been labeled as 5 volts ground D 1
D 2 3 and are TX, RX these are for serial port communication and 3.3 volts the
eight seven six five zero A0 we have only one analog but I have
limitation of three point two volts maximum this is the reset and that if
you want to reset the software. and if you want to use I2C communication
these two pand D1, D2 are SCL and SDA and if you if you want to use a SPI
communication these pins are for spi communication the module has a micro USB
and reset button the USB is based on CH340C this is very famous and common I
have their driver for this in case if you have problem with this all also
provide you the link. your module looks like this or if it looks like doesn't
matter because this is the same chip that you see here and this is a crystal
oscillator for this 26 mega Hertz this has no shielding metal shielding and
here there is a metal shielding and by adding those variations they just change
the name so this is exactly the same module either on this one or on this one
or on this one you might have different amount of RAM and you might have
different amount of pin but for this purpose for basic applications
it's exactly the same
Preparing Arduino IDE (Arduino Program)
if you have not used esp8266 Wi-Fi module before first copy this
line here I will provide you in the description copy it by
Right-Click or press CTRL + C then in your Arduino click on File->Preferences and
this liner you can see open it and whatever you have before just enter and
control+V to paste it. so this is the line that I have already pasted then click OK
and click OK after that click on Tools-> Boards->Board manager wait until you can
type something here because it's reading all the data and then type esp8266 wait
in my case it shows installed in your case you will see an "INSTALL" here click
install and wait you will see the ball graph here until the installation is
finished and then close this.
Demonstration of pins control
and this is the blink program you can open it by clicking at the File->examples->esp8266
blink and what I've done is I have made this to be a little interesting it's a
blink multiple times shorter and then longer at the end the first one it says
low and this module this LED is LOW trigger which means when you send low it
is ON and when you send HIGH it turns OFF so I've set it for 300ms ON
and 300 milliseconds OFF then ON and OFF on and off at the end we have 1000
milliseconds on 1000 milliseconds off and and if you look here belton LED is
d4 pay attention here it says BUILTIN_LED not LED_BUILTIN let's try BUILI_LED
LED
now let's upload it
and as you can see is uploaded without any issue
so BILITIN_LED or LED_BUILTIN both of them are working the same way now here I've
connected an LED with a resistor (200Ω to 1000Ω) with two wires so this is the negative I'm
going to connect it to the ground and
and as you can see BUILTIN_LED is at 10 d4 I'm connecting this to d4 which is
the pin and pay attention here these two are the opposite of each other as I
mentioned this is low trigger with LOW this turns ON and with the LOW this turns OFF
as you can see when that is on this is off so the pin is proper low is low high
is high but this LED is the opposite so keep that in mind now let's turn on
the LED using the D0 as you can see the zero is pin 16 so we can work we can
replace this with 16
so I've replace them all with 16 let me upload it now this LED is running
with a d0 the pin D0
Demonstration of pin mapping
and here this is a mapping constants which I took it from github
website which is for this esp8266 I just copied and pasted it you can copy and
paste so in every program that you have it will be just easy to use they have
been all mapped properly you don't have to worry and this is how they have been
labeled on the pin and you just need to use the proper D and that for example D
1 min 5 you don't have to worry about 5 just put D 1 and connect your wire to D
1 now I'm going to d7 and LED pin and let's call it the 7 and upload it as you
can see it working so I will provide you with this code
Demonstration of connecting to WiFi
now let's test this as an HTTP client meaning we can request a page with this
device. go to File->Examples
a new HTTP client and basic HTTP client. you don't need to include
anything these are all included with the driver that I just shown you the only
thing that you need to pay attention is this baud rate when you open the serial
monitor it must match and SSID this is a Wi-Fi name and then this is a password
that you have to put so what this code does is it goes to this page and it
requests information from this page and now let me show you this is a text and
behind-the-scene actually this is the whole text up to here without this this
is my antivirus but the rest is the response the response from this page did
my own page here I've created this welcome to the gojaks comm this is a
test for D1 Mini and this is a code for this in HTML the browser shows it
that way and this is a code Arduino serial monitor will display it
like this I've replaced the code and I've uploaded it let me open it
so this is the text that we got and this is my code here and this is the text
that we receive from here from HTML up to here this is the exact code that my
website has responded so what is the beauty of this you can actually this is
a request which means it goes to this page and it says give me information but
you can send a data here for example you can have a page that accepts information
and you can have question mark temperature 1 equal eighty seven point
two or something so you can send the temperature from your or do we know from
this environment and put it here this will go to that server and it will be
recorded and server will respond back not the page that I shown you like this
and just reply okay or maybe it replied that record number or ID number
that the temperature have been recorded and you can find your own way to do many
other fancy things with it. I would like to sincerely thank the following people
who have supported me via Patreon.com
Typed and corrected on Mar 09, 2020 by Ahmad Shamshiri. Please subscribe. This is the least you can do for me.
you
thank you for watching the this was introduction to d1 mini development
board Wi-Fi module. if you learned something and like this video please
thumbs up 👍 as this will help 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 subscribe to my channel you get updates of my upcoming videos
you