2017/11/28

ESP32 - Working with NodeMCU board

This post is about how to work with ESP32 NodeMCU Module.

ESP-32S NodeMCU V1.1 Pinout


Source: https://www.shenzhen2u.com/NodeMCU-32S

Schematic

Wire up the ESP32 NodeMCU Module, the LED and the Resistor as shown below. The resistor and LED are connected to GPIO 0. The module will be powered via the USB cable connected to the USB port of the computer running the Arduino IDE.


The 5V running on the breadboard is from the USB port.


Arduino Sketch

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(0, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(0, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);                       // wait for a second
  digitalWrite(0, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);                       // wait for a second
}

Upload the sketch to the module

In Arduino IDE, set the parameters in the red square as shown below then click the upload botton.


Below is the compiling and uploading message.

Archiving built core (caching) in: C:\Users\WEIHSI~1\AppData\Local\Temp\arduino_cache_217417\core\core_espressif_esp32_nodemcu-32s_FlashFreq_80,UploadSpeed_921600_e58c705d8dee69dcd7f97d151faf727b.a
Sketch uses 135894 bytes (10%) of program storage space. Maximum is 1310720 bytes.
Global variables use 10992 bytes (3%) of dynamic memory, leaving 283920 bytes for local variables. Maximum is 294912 bytes.
esptool.py v2.1
Connecting........___
Chip is ESP32D0WDQ6 (revision 1)
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 8192 bytes to 47...

Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.0 seconds (effective 5957.7 kbit/s)...
Hash of data verified.
Flash params set to 0x022f
Compressed 11120 bytes to 7467...

Writing at 0x00001000... (100 %)
Wrote 11120 bytes (7467 compressed) at 0x00001000 in 0.7 seconds (effective 134.2 kbit/s)...
Hash of data verified.
Compressed 202560 bytes to 76983...

Writing at 0x00010000... (20 %)
Writing at 0x00014000... (40 %)
Writing at 0x00018000... (60 %)
Writing at 0x0001c000... (80 %)
Writing at 0x00020000... (100 %)
Wrote 202560 bytes (76983 compressed) at 0x00010000 in 6.8 seconds (effective 238.2 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 122...

Writing at 0x00008000... (100 %)
Wrote 3072 bytes (122 compressed) at 0x00008000 in 0.0 seconds (effective 1365.3 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting...

Result

The LED is blinking steadily at 1 second interval.

--------------------------------------------------------------------------------------------------------------------------

Power the NodeMCU module via external 5V source

- Remove the USB cable.
- Connect an external DC 5V source to the VIN 5V pin of the module and the GND of the external source to the GND pin of the module.
- The LED should blink steadily at 1 second interval.

Note, Be sure to measure the voltage level of the external power source before connecting it to the module.

Alternatively, the module could be powered by external 3.3V source by feeding it to the VIN 3.3V pin.

No comments:

Post a Comment