Its kind of obvious that your day job is teaching. The fact that you prepare in advance and give on target information is so very much appreciated. Thank you
Wow. I never imagined Terry Silver from Karate Kid 3 would teach me so much about GPIO in ESP boards, but here we are. Thanks, Terry! This was super useful! 🙂
Boom! there you go. This is an awesome video . Thank you for taking the time to consolidate all this info down into a concise and well explained format. You saved me hours.
Very very handy. First time I came across your channel. Now subscribed. Won't be long before I'm switching my boiler on (or off) from my phone in bed on unexpected cold nights. 😉👍
Since this video was released, there have been far more libraries released for the ESP32. I have not wanted to do something and found that there isn't a library for it in the past year. I even found a nice ESPencoder library that uses... something inside that the other processors don't have (can you tell I've forgotten what!).
I feel the title of the video needs a change.It was hard for me find the video i was looking for,came to this video after a lot of browsing.Title must be something like "difference between esp32 and esp8266".Wonderful explanation.
Perfect! i wish this video was uploaded half year before..it would save me tons of time.. I think a very good add on to this, would be a video about available I2C and SPI channels to esp8266, esp32 and esp32-cam (which expose less pins)
Nice video, just one thing: on at least some models of the ESP8266 the ADC doesn't read beetween 0V and 3.3V but beetween 0V and 1V. If you need to read above 1V you need either a voltage divider or some sort of amplifier like a transistor or an opamp.
one can easily convert a pwm output to an analog output by adding a capacitor. In order to know what value the cap should be one will have to apply some knowledge of electronics or experimentation. What happens is that the square pulse will charge the cap to a level equivalent to the amount of current flowing out of the cap due to the amount of load. The greater the duty cycle (percent on time), the higher the voltage level that is provided. Think if it like filling a bucket with water with short pulses of water.. full on, full off.. The level of the water in the bucket (voltage) will depend on the size of the hole in the bottom of the bucket (load) as well as the amount of time the water bursts refilling the bucket are 'on'.. (greater duty cycle = higher voltage)
Great info! Thank you for this! One question though: you mention in the video that for the ESP8266, the compatible output pins are GPIO 4-5, 12-15 but on your diagram it says GPIO 0, 4, 12-15. Which one is right?
The ADC on the ESP8266 is 0-1volt input. However some boards have voltage dividers to accept the standard 3.3v. Something to point in all the various boards out there. Test with a smaller input voltage first to make sure your board has the proper divider.
Haven't seen it myself but I also use nodemcu and wemos style breakouts. I stil see it referenced by people and datasheets for the esp8266 and even the 12-e module.
Correct, you are using breakout boards like I said. Those have the voltage dividers onboard. I just wouldn't guarantee that every variant has the set of 100k and 200k resistors on board to drop the 3.3v signal down to 1v that the esp8266 is spec'd at. Simply a message to others to test before you assume you can pump in 3.3v and let that magical smoke out.
Gotcha, I didn't get that from your original comment. The ADC on the node-mcu which this video is focused on is able to handle 0-3.3 volts. The ESP8266 raw chip may not be able to handle those voltages.
Excellent and trully educational video! Would it be possible to combine esp8266 with I/O and analog expansion boards such as MCP23017, pf8574 and ADS1115 and copare it with esp32 native pins. Reliability, simplicity and power consumption would be an interesting comparison.....
The Hook Up. I am guessing here, that the memory (address) that you write the 8 bit value to is itself wider than 8 bits. Then if you use the DAC with the limited 8 bit resolution, only the low 8 bits are used. Those do not roll over because the register is wider. You can check if it rolls over at 16 bits or 32 bits.
The video shows a Pull up resistor Green, Blue, Orange = 56K. Is this the correct value to use? How many mA goes into a GPIO input on an ESP32. Thanks for a great video.
Does “pull-up” mean the input is set to high until the switch moves to ground then defaults back to high? Basically meaning the gpio pin is “pulled” up (high”) when not in use?
on the esp8266.. pins 0-14.. when you say pins high on boot... what is the pinMode of the pins at boot.. is this input high through the internal pullup resistor or output high.. because if they are digital outputs at boot and I connect a module or what not set as output also to those pins.. that would short the pins to ground/vcc vice versa when pins source or sink currents. which might burn the pins..
Hi Rob, I'm looking to use the ESP8266 with WLED in my permanent LED light setup and i wanted to know if there is a limit on how many IC(Integrated Circuit) Chips each Node MCU can handle? Thanks as always for all the great information!
so i need to use a NodeMCU ESP32 with an IC2 display for local reading and remote reading via web for a analog ph sensor and a DS18B20 Temperature Sensor and cannot for the life of me get it to work can you help?
I'm still confuse. The Module I have has GPIO22 as a sensor input but its not one of the predefined analogue pins. How do I set GPIO for analogue reading? Do I use dacRead(22, 256) ?
Just checked the digital pins on my NodeMCU and I'm getting 3.3V from most of the digital pins even when my code (digitalWrite) is set to low for that pin. Any reason I should be getting voltage from these pins whenever I power up the board?
I need to go back and check the code for pwm control of a PC fan. Never could get it to work w/ the 32S. Fan always ran 100%. Maybe you could do a short vid sometime?
Hello , Could some one please clarify what is the output voltage of ESP32 NodeMCU GPIO4,GPIO16 and GPIO36 ? is it 5v or 3.3 V? When doing LEDs projects , some people suggest we us logic level shifter to control 5V led ( 300 of them using WLED ) , Please help as I tested those pins and they are close to 5V
Sir, very well explained. I got confused... You have said for more output go for esp32 (in video at 4:55). In nut shell, how many pins are available for output in esp8266?
@@TheHookUp sir, I seek valuable suggestion from you. One of my project require to drive 100 plus relays using Arduino, preferably using WiFi module. What solution you can propose.
Hi, I am trying to connect 4 Relays and 4 Buttons to my Nodemcu esp8266 but unable to do so I have already tried to use your suggestions my PIN configurations are as under. Relay1 to D1, Relay2 to D6, Relay3 to D7 and Relay4 to D8 Button1 to D2, Button2 to D3, Button3 to D4 and Button4 to D5 can u guide me if possible which pins to be used for Relay and which for Buttons Thanks in advance,
Ever heard the water analogy for electricity? Resistors are like very small diameter pipes. If you connect your GPIO pin to 3.3V via a resistor a small amount of current is able to flow to the GPIO pin and "pull it up". If the GPIO pin is also connected to ground, the ground acts as a very large diameter drain that is able to divert the flow of current away from the GPIO pin and into the ground, causing the GPIO to be "pulled down".
I currently have an esp32 by NodeMCU. You state that only 6 pins are actually usable as ADC inputs. Would this still be the case with modules from other makers? Solved: I was able to use all ADC1 and ADC2 channels using the ESP IDF. P0 & P2 act strange due to them being connected to a button and LED respectively.
ESP32 Nodemcu is a development board that breaks out certain pins of the ESP32 module. Just like the ESP3266 NoceMCU is a development board that breaks out certain pins of the ESP8266 module.
@@TheHookUp really really few applications need that added voltage regulation stability. All in all a good D1 mini from a good manufacturer does not have bad regulation
connect to esp8266computer's USB ports, everything working fine. But, if I connect esp8266 to separate charger that has USB port, then esp 8266not running code
Pleas i make project 4 relay and 4 button inputs is 12. 13. 15. 16 And output is. 0. 4. 5. 15 And play ok in real with button an also by blynk but when turn off and turn on not work and D3 or 0 pin have output all time and any button not work and any blynk button not work
Can anybody tell me how will I then have to use GPIOs as when I connect my relay board with node mcu whenever power goes of or resets the Relay trips GPIO turns the relay on
Sounds like what you want is a normally open connection for your relay. That means that when no voltage is applied to the signal line the relay is open (device is off). You can then adjust your arduino code to use digitalWrite(pin, HIGH) to turn the relay on.
no no no no I am not using no nv relay I am using magnetic dual coil latching relay I have used ESP 12 then used a npn transistor config to turn relay latch unlatch . The high logic will turn on relay low logic will.not effect my relay . The problem is at the time of power reset or board reset the relay gets a high logic on its own from GpIO which trips my relay I have also pull down my GPIO's still its happening .i can share schematic if u want but plzz help me
Its kind of obvious that your day job is teaching. The fact that you prepare in advance and give on target information is so very much appreciated. Thank you
One of, if not the most complete video on ESP pins.
Had so much trouble with the ESP32 until I watched this
Thank you!
This is very good info, especially handy to have on-hand quickly for reference. You likely put a lot of work into these videos, thank you!
It's awesome, it explains a lot of failed projects! Thanks!!
Wow. I never imagined Terry Silver from Karate Kid 3 would teach me so much about GPIO in ESP boards, but here we are. Thanks, Terry! This was super useful! 🙂
Thank you so much! Lost so much time trying to figure out how they work but your video explained everything!!!!!
Wow Rob, I cannot believe this was 4 years ago! Still useful as a reference.
Time flies!
Boom! there you go. This is an awesome video . Thank you for taking the time to consolidate all this info down into a concise and well explained format. You saved me hours.
Well spoken, well explained and showing a ton of enthusiasm about sharing knowledge and helping people. You, sir, are awesome.
This video explains why I failed in many of my projects, Thanks from Colombia.
Thanks for this video. Great to know about the esp32!
Very very handy. First time I came across your channel. Now subscribed. Won't be long before I'm switching my boiler on (or off) from my phone in bed on unexpected cold nights. 😉👍
Since this video was released, there have been far more libraries released for the ESP32. I have not wanted to do something and found that there isn't a library for it in the past year. I even found a nice ESPencoder library that uses... something inside that the other processors don't have (can you tell I've forgotten what!).
Thanks Rob. Great video. I really like the detail and getting into the nitty-gritty on the pins / code.
Great intfo! This video summarized me hours of google searchs!.
You are absolutely a hero - Thanks for figuring this out!
Best device comparison for the ‘32 and ‘8266 devices. Thx for sharing!
Thank you for this. I have referred to these lists a bunch of times already.
Excelent summary, thank you very much!
Again, the most useful video for esp I have seen. Thanks for this quality content.
Thanks by the way for the explanation
That are some nice diagrams, very useful!
I feel the title of the video needs a change.It was hard for me find the video i was looking for,came to this video after a lot of browsing.Title must be something like "difference between esp32 and esp8266".Wonderful explanation.
Great video man. Keep on.
Thank you from Croatia.
Perfect! i wish this video was uploaded half year before..it would save me tons of time..
I think a very good add on to this, would be a video about available I2C and SPI channels to esp8266, esp32 and esp32-cam (which expose less pins)
Nice video, just one thing: on at least some models of the ESP8266 the ADC doesn't read beetween 0V and 3.3V but beetween 0V and 1V. If you need to read above 1V you need either a voltage divider or some sort of amplifier like a transistor or an opamp.
Correct, but the nodeMCU has the circuitry built in for 3.3v ADC
@@TheHookUp Didn't know about this, this is a great advantage over the bare ESP8266, thanks!
Second one of your videos I've watched. Both excellent. Nice work
Most useful video I'v seen today
Wonderful video, thank you very much for the information. Exactly what I was looking for.
Thanks for the great video. I found it very informative. You explained it very well.
Great vid....answered a lot of questions..
The best explanation, thank you
Awesome explanations. Because of that, I have just subscribed your channel. Thank you.
collection of useful information. Thank you.
Very nice information this will be useful for my tinkering!
very helpful thank you sir
Excellent!! Thanks for this upload.
Excellent video! Much appreciated.
nice presentation
one can easily convert a pwm output to an analog output by adding a capacitor. In order to know what value the cap should be one will have to apply some knowledge of electronics or experimentation. What happens is that the square pulse will charge the cap to a level equivalent to the amount of current flowing out of the cap due to the amount of load. The greater the duty cycle (percent on time), the higher the voltage level that is provided. Think if it like filling a bucket with water with short pulses of water.. full on, full off.. The level of the water in the bucket (voltage) will depend on the size of the hole in the bottom of the bucket (load) as well as the amount of time the water bursts refilling the bucket are 'on'.. (greater duty cycle = higher voltage)
Awesome info!
Awesome video and super informative!
Thank you for this video you got a new follower
Useful cheat sheet, thanks!
Fantastic video!
Great info! Thank you for this! One question though: you mention in the video that for the ESP8266, the compatible output pins are GPIO 4-5, 12-15 but on your diagram it says GPIO 0, 4, 12-15. Which one is right?
Oh wow, you're right. Pins mentioned in the video are right, diagram is wrong. I'll fix.
@@TheHookUp Many thanks!
Thanks!
Your videos make more sense to me than most. I have used many. Including the UniFi series. Thank you!
Cheers Nathan!
you're the best! great video my friend!! thanks (y)
Hi, Great video, Is it possible to add a normal on off switch to the board to turn the output on/off? Many Thanks
Very helpful, thanks
Great film thank you
The ADC on the ESP8266 is 0-1volt input. However some boards have voltage dividers to accept the standard 3.3v. Something to point in all the various boards out there. Test with a smaller input voltage first to make sure your board has the proper divider.
I think the 0-1 volt ADC was only on the really early ESP8266 versions. If you get a nodeMCU V3 it should be 0-3.3 volt.
Haven't seen it myself but I also use nodemcu and wemos style breakouts. I stil see it referenced by people and datasheets for the esp8266 and even the 12-e module.
I can test it tonight, but I have a couple of projects that wouldn't work if it was only 0-1V, and they don't have any issues.
Correct, you are using breakout boards like I said. Those have the voltage dividers onboard. I just wouldn't guarantee that every variant has the set of 100k and 200k resistors on board to drop the 3.3v signal down to 1v that the esp8266 is spec'd at. Simply a message to others to test before you assume you can pump in 3.3v and let that magical smoke out.
Gotcha, I didn't get that from your original comment. The ADC on the node-mcu which this video is focused on is able to handle 0-3.3 volts. The ESP8266 raw chip may not be able to handle those voltages.
esp32 has tons of useful functions that cannot be used with Arduino f.ex hardware support for rotary encoder and ulp
I use rtos and idf
Yeah, I'd like to eventually do a video on lua so I can cover some of that stuff. It's low on the list though.
I strongly prefer lua for the 8266, but it's not really mature enough yet for the 32 imo.
Excellent and trully educational video! Would it be possible to combine esp8266 with I/O and analog expansion boards such as MCP23017, pf8574 and ADS1115 and copare it with esp32 native pins. Reliability, simplicity and power consumption would be an interesting comparison.....
fantastic
Thanks
5:58 ten bit resolution return value between 0-1023 not 0-1024.
Same with 12 bit resolution at 6:59. Range is 0-4095 not 0-4096.
Ack, yep, gotta account for 0.
And again with 8 bits.
Range of 256 ( 0..255)
Highest number MUST be odd, because least significant bit is 1.
Oddly enough, it doesn't loop back if you put in 256. You'd normally expect 256 to return 0, but it returns the same as 255.
The Hook Up. I am guessing here, that the memory (address) that you write the 8 bit value to is itself wider than 8 bits.
Then if you use the DAC with the limited 8 bit resolution, only the low 8 bits are used. Those do not roll over because the register is wider.
You can check if it rolls over at 16 bits or 32 bits.
Big help
Wonderfull
Thank you very much man. I have problem while dealing GPIO
Can you please make a video how to read digital inputs using ESP8266-01 module.
The video shows a Pull up resistor Green, Blue, Orange = 56K. Is this the correct value to use? How many mA goes into a GPIO input on an ESP32. Thanks for a great video.
56K will certainly work, the built in ones are usually between 20K-50K depending on the specific board.
Does “pull-up” mean the input is set to high until the switch moves to ground then defaults back to high? Basically meaning the gpio pin is “pulled” up (high”) when not in use?
exactly.
on the esp8266.. pins 0-14.. when you say pins high on boot... what is the pinMode of the pins at boot.. is this input high through the internal pullup resistor or output high.. because if they are digital outputs at boot and I connect a module or what not set as output also to those pins.. that would short the pins to ground/vcc vice versa when pins source or sink currents. which might burn the pins..
Hello you cane make a video for analog sensor to start some output in diferent value ????
In tasmota
Can the vibration motor be connected to the NODEMCU ESP32?
Hi Rob, I'm looking to use the ESP8266 with WLED in my permanent LED light setup and i wanted to know if there is a limit on how many IC(Integrated Circuit) Chips each Node MCU can handle? Thanks as always for all the great information!
so i need to use a NodeMCU ESP32 with an IC2 display for local reading and remote reading via web for a analog ph sensor and a DS18B20 Temperature Sensor and cannot for the life of me get it to work can you help?
How to use gpio15 for relay in esp8266
hi sir, How can i put a constant Hz for the PWM, i need 60Hz , what is the code ill put to make a constant PWM?
I'm still confuse.
The Module I have has GPIO22 as a sensor input but its not one of the predefined analogue pins.
How do I set GPIO for analogue reading?
Do I use dacRead(22, 256) ?
Just checked the digital pins on my NodeMCU and I'm getting 3.3V from most of the digital pins even when my code (digitalWrite) is set to low for that pin. Any reason I should be getting voltage from these pins whenever I power up the board?
thanks for your help but the gpio9 and gpio10 not working with my nodemcu v3 can you help me ?
When I’m trying adding a second bindery sensor in ESPhome. I getting the error “duplicate key” from the Yamagata file. What have I mist?
I need to go back and check the code for pwm control of a PC fan. Never could get it to work w/ the 32S. Fan always ran 100%. Maybe you could do a short vid sometime?
I used the LEDC function in my ceiling light video, and there's an example sketch there if you want to look over my code.
Hello , Could some one please clarify what is the output voltage of ESP32 NodeMCU GPIO4,GPIO16 and GPIO36 ? is it 5v or 3.3 V? When doing LEDs projects , some people suggest we us logic level shifter to control 5V led ( 300 of them using WLED ) , Please help as I tested those pins and they are close to 5V
Sir, very well explained. I got confused... You have said for more output go for esp32 (in video at 4:55). In nut shell, how many pins are available for output in esp8266?
6 pins are well suited for output that don't have any potential problems. You can use others as outputs but they have small issues like HIGH on boot.
@@TheHookUp Thanks, you mean others pin go high on boot, right? I can control in program. Isn't it?
@@nitinjoshi239 Yes, you can set them to low once the program initializes, but they will always be HIGH for a few milliseconds on power-on.
@@TheHookUp got thanks and loving your videos....
@@TheHookUp sir, I seek valuable suggestion from you. One of my project require to drive 100 plus relays using Arduino, preferably using WiFi module. What solution you can propose.
Do you knkow if analogwrite has been implimented into the arduino IDE yet?
Hi,
I am trying to connect 4 Relays and 4 Buttons to my Nodemcu esp8266 but unable to do so I have already tried to use your suggestions my PIN configurations are as under.
Relay1 to D1, Relay2 to D6, Relay3 to D7 and Relay4 to D8
Button1 to D2, Button2 to D3, Button3 to D4 and Button4 to D5
can u guide me if possible which pins to be used for Relay and which for Buttons Thanks in advance,
What are usual resistor values for pull-up or pull-down resistors?
The built in ones are 20kOhm, but you can use anything over 220.
HI.
Really well explained! Thanks.
According to the ESP32 documentaiton it has 16 ADC. Not only 8.
Or, am I missing something?
Only 8 are usable with arduino ide. You can use the rest with LUA
Understood!
I didn't know that..... Cheers!
Hopefully, It will be possible to use them soon with arduino ide.....
Thanks again.
Still a little confused on the pull-up and pull down resistors. How do they avoid floating voltages?
Ever heard the water analogy for electricity? Resistors are like very small diameter pipes. If you connect your GPIO pin to 3.3V via a resistor a small amount of current is able to flow to the GPIO pin and "pull it up". If the GPIO pin is also connected to ground, the ground acts as a very large diameter drain that is able to divert the flow of current away from the GPIO pin and into the ground, causing the GPIO to be "pulled down".
I currently have an esp32 by NodeMCU. You state that only 6 pins are actually usable as ADC inputs. Would this still be the case with modules from other makers?
Solved:
I was able to use all ADC1 and ADC2 channels using the ESP IDF. P0 & P2 act strange due to them being connected to a button and LED respectively.
The ADC on esp8266 reads between 0 and 1v not 3.3v
Not on the nodeMCU, it has s voltage divider.
Oh. Values are incorrect.
10 bits are 0 - 1023 (You said 1024) and the 12 bit from the ESP32 is 0-4095 not 4096.
Just saying. Nice video still :)
he also said 0 to 256, but compared to me this guy is an iot genius so i'll let him have that slip of the tongue. learning a lot from this channel
@@WereReallyRelayCamping yes you are right :) he is a genius
Esp8266 actually has a sigma-delta dac just like the 32
Really? That would be awesome, do you have any good links for it? Is it implemented in arduino yet or only micropython?
@@TheHookUp It's for sure implemented in the lua firmware (which I use). Just #include sigma_delta.h (usage is in comments of header file)
esp 32 and esp 32 nodemcu are different right?
ESP32 Nodemcu is a development board that breaks out certain pins of the ESP32 module. Just like the ESP3266 NoceMCU is a development board that breaks out certain pins of the ESP8266 module.
I use esp32 and can't pull down pin no 5.
Why do you prefer nodemcu while there is D1 mini board that is pretty equivalent but a lot smaller?
Voltage regulation and tolerance are much better on the nodeMCU in my experience.
@@TheHookUp really really few applications need that added voltage regulation stability. All in all a good D1 mini from a good manufacturer does not have bad regulation
using mqtt and tasmotized nodemcu gpio pins, i would like to control
motor (forward/reverse/stop) is it doable ? any help appreciated
Tasmota does not natively support motors, if you got it to work through a motor controller it would be clunky at best.
connect to esp8266computer's USB ports, everything working fine. But, if I connect esp8266 to separate charger that has USB port, then esp 8266not running code
That's pretty strange, no code runs at all?
Code works only when it is connected to the computer.. But when I connect it to a mobile charger it does not run
what about off wemos d1 mini
Pretty much the same as the ESP8266 Node-MCU. Most of these characteristics are a result of the ESP8266, not the development board configuration.
Pleas i make project 4 relay and 4 button inputs is 12. 13. 15. 16
And output is. 0. 4. 5. 15
And play ok in real with button an also by blynk but when turn off and turn on not work and D3 or 0 pin have output all time and any button not work and any blynk button not work
There are a lot of tools you could use to make a project like this easily. I'd recommend you take a look at ESPHomeLib, Tasmota, ESPeasy, and ESPerna.
Hi man please can we tasmotise the esp32 chip
Tasmota is not currently compatible with ESP32, there are a few forks that are attempting to support it, but not the main branch.
Think you very much
I like the new year song by BenSound. I want to put on my sequence. What is the song title so I can find it?
That one actually isn't by bensound, it's called "dubstep christmas" on soundcloud.
@@TheHookUp Cannot find your particular Happy New Year song. What is the title or link? Thanks!
soundcloud.com/djdeepdrama/best-christmas-mix-part-2-xmas-dubstep-edm-christmas-songs-music
Your dimmer light video has gone off line?
I don't think so: DIY Smart LED Ceiling Light: 8 Individually Dimmable Channelsczcams.com/video/PVQhGzo-Dtg/video.html
It is possible to use tasmota on esp32
No.
@@TheHookUp thanx for relay... great video content.. keep it up
so is it right that the pins only take 3.3 Volts? is the pin dead when I put 5 volts on it?
PS: cool Chanel sub and like!
It depends on how long it had 5v on it. They are not 5v tolerant long term, but can take a second or two
The Hook Up cool thanks! So normale the Pins are not 5 Volt useable?
Correct, you can use a simple voltage divider though
The Hook Up Ok! Thanks man!!!
esp 32 will work as a broker?
I've seen a few projects proposing this... The answer is "not well".
Can anybody tell me how will I then have to use GPIOs as when I connect my relay board with node mcu whenever power goes of or resets the Relay trips GPIO turns the relay on
Sounds like what you want is a normally open connection for your relay. That means that when no voltage is applied to the signal line the relay is open (device is off). You can then adjust your arduino code to use digitalWrite(pin, HIGH) to turn the relay on.
no no no no I am not using no nv relay
I am using magnetic dual coil latching relay I have used ESP 12 then used a npn transistor config to turn relay latch unlatch .
The high logic will turn on relay low logic will.not effect my relay .
The problem is at the time of power reset or board reset the relay gets a high logic on its own from GpIO which trips my relay I have also pull down my GPIO's still its happening .i can share schematic if u want but plzz help me
Same problem with me.. Any solution for preventing the relays to go high when I restarts my nodemcu??