Sie sind auf Seite 1von 11

The NodeMCU (IoT) Guide

Advertisement

Home / The NodeMCU (IoT) Guide

The NodeMCU (IoT)


Guide
T.K. HAREENDRAN

The NodeMCU development board is a powerful solution to program microcontrollers and be part of the
Internet of Things (IoT). The NodeMCU development board, based on ESP8266EX , is a cute module with a
microcontroller, integrated Wi-Fi receiver, and transmitter. NodeMCU supports several programing languages;
This website
hence,uses
it iscookies
very to improve
easy your experience.
to upload programsWe'll
fromassume
any you're ok with
computer this,abut
over you can opt-out
micro-USB if you
port. wish.been Accept
I have playing Read More
with
the NodeMCU for quite a while now and, I have to say, it is a lot more fun than the other available IoT

https://www.electroschematics.com/13118/nodemcu-iot-guide/[09/07/2018 02:42:21 PM]


The NodeMCU (IoT) Guide

friendly minuscule magic module!

NodeMCU V1.0
The first generation of the NodeMCU Development Kit had the version number V0.9. The second generation
had the version number V1.0, and this newer version used ESP-12E (not ESP-12 ), which comes with 4 MB of
flash memory. The new version comes with the CP2102 serial chip (not CH340) and it works really well and
without a hassle. However, I noticed that, when it comes to many Chinese online vendors, there’s a blurring
mix-up of generation and version names. The common name used by them for version 1.0 is V2, and most of
those V2 boards are fabricated by or at least marked with “Amica.” Technically, it’s “NodeMCU V1.0 with
ESP-12E module!”

https://www.electroschematics.com/13118/nodemcu-iot-guide/[09/07/2018 02:42:21 PM]


The NodeMCU (IoT) Guide

NodeMCU First Run


NodeMCU is a complete environment of hardware and software for IoT prototyping based on the Lua
language. You can connect NodeMCU to your computer through a standard USB interface for power,
programming, and debugging. Before using NodeMCU V1.0 for the first time, install the requisite USB driver
(CP210x) on the operating system of your computer:
Download it from: http://www.silabs.com/products/mcu/

Now you can test your NodeMCU in Lua shell. As this calls for an appropriate terminal software, download
PuTTY onto your computer: http://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html

https://www.electroschematics.com/13118/nodemcu-iot-guide/[09/07/2018 02:42:21 PM]


The NodeMCU (IoT) Guide

Next, connect NodeMCU, run PuTTY to enter its Lua shell, and enter the test code to test the onboard LED in
NodeMCU (also see following images). If everything is okay, you should able to connect NodeMCU with
PuTTY, enter Lua shell, and test the on/off functions of the onboard blue indicator. If NodeMCU has no
response in the PuTTY terminal, try to press the RST button on NodeMCU.

> gpio.mode(0, gpio.OUTPUT)


> gpio.write(0, gpio.HIGH)
> print(gpio.read(0))
1
> gpio.write(0, gpio.LOW)
> print(gpio.read(0))
0
>

https://www.electroschematics.com/13118/nodemcu-iot-guide/[09/07/2018 02:42:21 PM]


The NodeMCU (IoT) Guide

This simple tutorial will show you how to use NodeMCU V1.0 for the first time. The steps are pretty simple to
follow and should get your NodeMCU board running in less than 15 minutes. In upcoming articles, I will adapt
new design ideas to implant NodeMCU at the heart of fascinating IoT systems. See you all in succeeding
projects.

https://www.electroschematics.com/13118/nodemcu-iot-guide/[09/07/2018 02:42:21 PM]


The NodeMCU (IoT) Guide

Wikipedia Article on NodeMCU: https://en.wikipedia.org/wiki/NodeMCU


Offical NodeMCU Website: http://www.nodemcu.com/index_en.html
Github Repository for NodeMCU Firmware: https://github.com/nodemcu/nodemcufirmware
Github Repository for NodeMCU Hardware: https://github.com/nodemcu/nodemcudevkit

NodeMCU & Arduino IDE


Did you know? It’s very easy to use the Arduino IDE to program your NodeMCU, a great starting point for
Arduino lovers to familiarize themselves with the technologies surrounding the IoT. Note that when you use
the NodeMCU board with the Arduino IDE, the Lua firmware will be deleted and replaced by the sketch
uploaded by you. If you want to use the Lua SDK again, it will become necessary to “flash” the firmware
again.

The NodeMCU programming can be as easy as in Arduino. The major difference is in the pin assignment of
the NodeMCU board. Ready? Then follow these steps:

Run the Arduno IDE


Open the “Preferences” window and type the indicated address in the “Additional Board Manager
URLs:” http://arduino.esp8266.com/stable/package_esp8266com_index.json
In the “Tools” menu, configure your board “NodeMCU 1.0 (ESP-12E Module)”
Now just proceed as the Arduino: Start your sketching!

https://www.electroschematics.com/13118/nodemcu-iot-guide/[09/07/2018 02:42:21 PM]


The NodeMCU (IoT) Guide

Shown next is an example code to realize a “breathing LED” on NodeMCU, taken from Arduining.com:

#define LED D0 // Blue LED in NodeMCU at pin GPIO16 (D0).


#define BRIGHT 350 //max LED intensity (1‐500)
#define INHALE 1250 //Inhalation time in milliseconds.
#define PULSE INHALE*1000/BRIGHT
#define REST 1000 //Rest Between Inhalations.
void setup() {
pinMode(LED, OUTPUT); // LED pin as output.
}
void loop() {
//ramp increasing intensity, Inhalation:
for (int i=1;i0;i‐‐){
digitalWrite(LED, LOW); // turn the LED on.
delayMicroseconds(i*10); // wait
digitalWrite(LED, HIGH); // turn the LED off.
delayMicroseconds(PULSE‐i*10); // wait
i‐‐;
delay(0); //to prevent watchdog firing.
}
delay(REST); //take a rest...

https://www.electroschematics.com/13118/nodemcu-iot-guide/[09/07/2018 02:42:21 PM]


The NodeMCU (IoT) Guide

Previous Next
Simple Contact Learn To Use Digital
Microphone Potentiometers

Related Tutorials

No related posts.

Multiple RTL 2832U dongles in one radio

ripple voltage

i need to interface r c circuit with the internal ADC pin of pic controller

systematic diagram is needed

systematic diagram is needed

Recent Posts

The Tiny Tesla Coil – DIY


MP2307 Digital Power Supply Module: Teardown Analysis Part 1
The Mighty Miniature Electromagnetic Levitation System
The Best Way to Add Sound FX to Your Projects – From EEWeb
PWM Automatic Heater Controller

No Comments

Join the conversation!

https://www.electroschematics.com/13118/nodemcu-iot-guide/[09/07/2018 02:42:21 PM]


The NodeMCU (IoT) Guide

You must be logged in to post a comment.

Login
Email

Password

Remember Me

Log In

Register | Lost your password?

Latest Article Comments

Simple Code Lock...


"hi,
i have this as my project and i have some questions on this ciruit...do i need a keypad for"

Arduino Water Level Indicator +...


"doitabagmail-
I tried it using the same setup without the resistors. I ended up using the"

MP2307 Digital Power Supply Module: Teardown Analysis Part...


"I think this power supply induces disturbance in AM radios, as the AM band starts at 500 kHz and"

MP2307 Digital Power Supply Module: Teardown Analysis Part...


"Hi there! I am inquisitive how quiet this beasty would be on Medium and Short Wave radios? I went"

MP2307 Digital Power Supply Module: Teardown Analysis Part...


"As stated above, the display looked like a common LCD with an integrated controller. But it’s a"

View More

https://www.electroschematics.com/13118/nodemcu-iot-guide/[09/07/2018 02:42:21 PM]


The NodeMCU (IoT) Guide

New Projects Recent Q&A

The Tiny Tesla Coil – DIY

MP2307 Digital Power Supply Module: Teardown Analysis Part 1

The Mighty Miniature Electromagnetic Levitation System

The Best Way to Add Sound FX to Your Projects – From EEWeb

PWM Automatic Heater Controller

https://www.electroschematics.com/13118/nodemcu-iot-guide/[09/07/2018 02:42:21 PM]


The NodeMCU (IoT) Guide

THE BASICS FOR ADVERTISERS


About Us Contact Sales

Contact Us Media Guide Request

Participate

Privacy Policy

Terms of Use

Feedback

ASPENCORE NETWORK

EBN
EDN

EE Times
EEWeb

Electronic Products
Electronics-Tutorials

Embedded
Planet Analog

Power Electronics News


TechOnline

Datasheets.com
Embedded Know How

Embedded Know How


Embedded News

IOT Design Zone


Motor Control Design

Electronics Know How


IoT Times

GLOBAL NETWORK
EE Times Asia
EE Times China

EE Times India
EE Times Japan

EE Times Taiwan
EDN Asia

EDN China
EDN Taiwan

EDN Japan
ESM China

CONNECT WITH US
Facebook

Youtube

All contents are Copyright © 2018 by AspenCore, Inc. All Rights Reserved.

https://www.electroschematics.com/13118/nodemcu-iot-guide/[09/07/2018 02:42:21 PM]

Das könnte Ihnen auch gefallen