Arduino Alternative Development Cards: NodeMCU

This article is actually the first episode of a series, we start the first episode of this series with NodeMCU, where we will examine arduino alternatives.

What is ModeMCU?

NodeMCU; it is a tiny electronic circuit, slightly larger than a coin. It's open source, it's cheap, and it's talented. It works with low voltage energy. There are many ports on it. You can manage other electonic components that you connect by using these ports. Thanks to its hosted WiFi, it allows you to easily make devices known as IOT, internet things. With HTTP libraries, you can make web prompts or run web servers. In this way, you can contact this device over the internet. You can turn things on or off remotely. It uses the Lua script, i.e. script, as the programming language. And yet, despite this, it's not the first time that the U. Arduino can also be programmed in the language used by the IDE and Arduino. It can be easily connected to the computer via USB cable, programmable and data communication. nodeMCU It's like, "Oh, my God. nodeMCU, a microchip; Esp8266 is located on a microchip set. NodeMCU, which is about the size of a coin; software. Thanks to this software, it becomes smarter, that is, it becomes able to process. NodeMCU; It's kind of like a microcomputer. Of course, it does much simpler things than a computer, but it is imperative for an object to have the Internet, that is, to become intelligent by transferring data. The first time, NodeMCU usually connects to the computer via a micro USB port and software is installed in them. In this way, they are ready to meet the needs of our object. In fact, thanks to the NodeMCU controller, you can do many things you can think of, such as a remote-controlled car, doors that open and close automatically, curtains and windows. These technologies, called smart home systems and newly developed and spreading, also include a NodeMCU control unit. NodeMCU's are hardware that will allow data exchange between you and the object. These apparatus; you have the possibility to use it on all the smart objects that you have developed yourself. Thanks to the software contained in them, they make sense of your commands and act according to your wishes; they allow you to route the object you mounted on it. That's why using a NodeMCU controller; will help you with the projects you will develop.

Ardinuno-Like Hardware I/O (I/O)

Node MCU has an advanced hardware I/O interface that you can set up and edit. That is, it has a hardware input-output AP. You don't have to go to great lengths to use this API. The code spelling is the same as on Arduino devices. So it's very similar to the structure on those devices. However, NodeMCU is more interactive than Arduino devices and does so with Lua scripts.

So why NodeMCU and Not Arduino?

First of all, Arduinos that are equivalent to Node MCU do not have WiFi. In order to give such Arduinos WiFi capability, it is necessary to get an additional WiFi module. Then you need to communicate with the module by writing code. As you can see, you need to get modules and write extra code to communicate. This is a meaningless burden on the concept of IOT, the internet stuff. However, the newly released clone arduino cards have also been added a WiFi module, and in the second part of this series we will examine the card I mentioned.

NodeJS-Style Network Interface

Thanks to the Event-Based API, developers encode network applications in NodeJS style, which only works on the 5x5mm MCU microcontrolter. Let me turn on the Event-Based a little more. Those who use the JavaScript language and tools such as jQuery will understand it better. When an event occurs; The function that you define as "run this" is called and run. For example, running the following code when the HTML document is ready; jQuery(document).ready ( function(){ console.log ("circuit burner"); } );

Development Equipment/Kit

Esp8266 has a microcontrolter. In this way, Node MCU; It incorporates and delivers all technologies such as GPIO, PMW, IIC, 1-Wire and ADC in small sizes. In addition, Node MCU can add power to its power with firmware, i.e. built-in software. Here's how to open firmware, the built-in software. Those who want to make improvements with Node MCU write code with LUA scripts. In addition, this code works with firmware, i.e. built-in software, in the upper layer to make the Node MCU device do a number of things.

What is NodeMCU Flasher? What is it used for?

The tools used to update NodeMCU are called Flashers. To better understand it, I'd say it's like a BIOS update of a computer. In other words, the basic and tiny software in NodeMCU is updated with NodeMCU Flasher. If you want to download Flasher, download it here for the 32-bit system. For the 64-bit system, download it here.

What is NodeMCU Firmware? What is it used for?

This tool updates the basic and tiny software in the Node MCU. This little updated software is NodeMCU Firmware. This means flasher can contact Node MCU and write firmware in it so that the firmware within NodeMCU is updated, so it has changed. You can download Node MCU Firmware here. It used to be downloaded on GitHub. Now it can be personalized and downloaded through another site. For example, if you're never going to do WebSocket on your NodeMCU, you can reduce the firmware size by canceling the tile on the Firmware creation page and not adding WebSocket to your firmware at all. Thus, there is more space left for your own code to be written in NodeMCU.

How to Update NodeMCU?

1. Download Flasher under flasher title first

2. Download Firmware under the Firmware header.

3. Connect NodeMCU to your computer via USB cable

4. Run Flasher and select the COM port with NodeMCU connected on the first tab named Operation

5. On the second tab named Config, click the gear/wheel icon next to the first line that says INTERNAL://NODEMCU and locate and select the firmware file you downloaded

6. Go back to the first tab, Operation, and press the Flash button, and don't do anything until it's done, don't disconnect NodeMCU. He'll warn you when the process is over, and he'll still be ready to use it.

Coding NodeMCU with Arduino IDE Without Using Lua Language

I'll tell you why such a priority is needed. We are more familiar with C/C++ and derivative languages and such language structures. Ok, lua scripting is also a widely used language, but C/C++ derivatives are more dominant. Therefore, it would be wiser to develop Node MCU using C/C++ and Arduino IDE instead of wasting time learning Lua and learning the language structure from the beginning. Lua, if you know, this title may not be so much of a nod.

• Run the Arduino IDE. I continue assuming that you are not necessarily using a Turkish interface;

• Click on the main menu respectively; File > Preferences

• The Incoming window has Additional Circuit Boards Manager URLs on the Settings tab, as well as the tile and icon to the far right. Click the icon

• Another window will open. If there is no text in the type area in this window, paste the following URL immediately http://arduino.esp8266.com/stable/package_esp8266com_index.json, if there are other URLs, create it on the new line, i.e. enter.

• Click ok buttons on all windows to reach the main window of the Arduino IDE

• Click on the main menu respectively; Tools > Card:… > Card Manager

• Search with esp8266 in the pop-up window and set up esp8266 by ESP8266 Community among the results and wait for strokes.

• Close the Card Manager window when the process is complete

• Arduino IDE now ready for NodeMCU

Connecting NodeMCU to the computer and installing code;

  • Connect NodeMCU to your computer via USB cable
  • Click on the main menu, respectively; Tools > Card:… > NodeMCU 0.9 (ESP-12 Module) – Note: If you are using NodeMCU in a different version, make a choice that suits it
  • Click on the main menu, respectively; Tools > Port > COM X – Note: Select nodeMCU in the list which Com port you connected to
  • Now ready, you can write your codes and send them to NodeMCU. After this stage, Arduino acquires the ability to use IDE and requires a completely different type.

After typing the code, the upload speed can be increased step by step to speed up the installation process. To do this, click on the main menu, respectively; Tools > Upload Speed > XXX Sample Code: void setup() { pinMode(LED_PIN, OUTPUT); } // called forever until the electrical connection is disconnected void loop() { digitalWrite(LED_PIN, HIGH);   Turn on the LED, i.e. give 5 volts to pin 1(1000);              wait a while digitalWrite(LED_PIN, LOW);    Turn off the LED, i.e. give pin 0 volts to pin 1(1000);              wait a little bit }

What are LoLin and Amica. Are There Differences?

In fact, these names are manufacturer names. In fact, we can say that there are three main manufacturers. These are, respectively; Amica, DOIT/SmartArduino and LoLin/WeMos. The first generation, plus v0.9 and v1 version NodeMCU devices, expanded in size and was manufactured by Amica. Subsequent versions were produced by different manufacturers. In fact, the size of NodeMCU devices in the same version may be different due to different manufacturers.