The proper way to connect an ESP8266 NodeMCU to a micro:bit image 21 1

The proper way to connect an ESP8266 NodeMCU to a micro:bit

 

Discover how to link an ESP8266 NodeMCU to the ARM-based embedded system micro:bit!

What is ESP8266 NodeMCU?

The ESP8266 NodeMCU board can be used to program and develop projects with the micro bit. It is easy to connect to the micro bit and can be used to control motors, lights, and other electronic devices, The ESP8266 NodeMCU board is a great tool for learning about programming and electronics

Numerous monitoring and control applications, such as electronic temperature measures, sound level detection, gesture detection, and motor driver controls, can be implemented using the ESP8266 Wi-Fi microcontroller-based NodeMCU.

ESP8266  NodeMCU
nodemcu esp8266

 

 

A conventional discrete LED indicator used for the “hello world” code demonstration can be modified with a micro:bit to increase the capabilities of the ESP8266 control application.

A 5×5 matrix of individually programmable LEDs on the micro:bit enables the creation and display of a wide range of messages and artwork. This practical guide demonstrates how to connect a micro:bit with an ESP8266 WiFi microcontroller using three cables.

The proper way to connect an ESP8266 NodeMCU to a micro:bit image 20
Image 1. Block diagram of the fundamental 3-wire interaction between micro:bit and an ESP8266 NodeMCU

With this three-wire scheme, you can create a programmable emoji device that we’ll cover in this tutorial as well.

Hardware Requirements

The Principal Power Distribution Plan

Utilizing a single power source is the main goal of the connecting of the ESP8266 NodeMCU to the micro:bit.

A USB cable-derived voltage source of 3.3VDC powers both the NodeMCU and the micro:bit. The embedded boards receive +5VDC from the USB cable, stepping down the primary source voltage to +3.3VDC. In order to enable the NodeMCU to actively power the micro:bit, this is the main power distribution mechanism. We need to set up a power rail in order to carry out this power distribution plan.

 

The proper way to connect an ESP8266 NodeMCU to a micro:bit image 22
Image 2. creating a rail for electricity delivery.

A +5VDC voltage supply is provided by the USB cable, as shown in Figure 2. The voltage regulator in the NodeMCU steps down the +5VDC voltage from the USB cable to +3.3VDC. The micro:bit gadget can be powered by this +3.3VDC supply.

An electrical component from the ON Semiconductor NCP1117 series serves as the voltage regulator for the NodeMCU. The NCP1117 offers a +3.3VDC constant voltage with a 1A maximum source current. At 3+3VDC, the working sourcing current is 800mA. The micro:bit can be successfully operated by this sourcing current.

Figure 3 displays the incomplete circuit schematic diagram from the NodeMCU documentation.

The proper way to connect an ESP8266 NodeMCU to a micro:bit image 23
Image 3. The ESP8266 NodeMCU +3.3VDC voltage regulator.

After programmability based on the wiring arrangement, you are ready to wire the ESP8266-based NodeMCU to the micro bit.

How to Wire the NodeMCU to a micro:bit

Wiring a Node.js MCU to a micro bit requires a solderless breadboard and three alligator clips. Insert the NodeMCU into the solderless breadboard. Insert the alligator clips using the following color code scheme.

  • The +3V3 pin hole on the solderless breadboard was inserted with a red alligator clip.
  • The GND pin hole on the solderless breadboard was inserted using a black alligator clip.
  • The D1 pin hole on the solderless breadboard was plugged with a blue alligator clip.
  • The following electrical connections table should be used to join the micro:bit to the colored alligator clips on the solderless breadboard.
The proper way to connect an ESP8266 NodeMCU to a micro:bit image 24
Table 1. Alligator Clip Electrical Connections

The complete Fritzing diagram of the electrical connections between the NodeMCU and the micro:bit is shown in Figure 4.

The proper way to connect an ESP8266 NodeMCU to a micro:bit image 25
Figure 4. The electrical wiring diagram for the ESP8266 to micro:bit pin connections.

In addition to the reference from Figure 5, you may also use the electronic circuit schematic diagram to wire the two embedded platform devices together.

The proper way to connect an ESP8266 NodeMCU to a micro:bit image 26
Figure 5. The ESP8266 based NodeMCU to micro:bit electronic circuit schematic diagram.

We can program the NodeMCU and the micro bit following the two embedded devices being wired together.

Software for the ESP8266 and the micro:bit

The creation of a programmable emoji is the tutorial’s main learning objective. The programmable emoji’s idea is to have two images—happy and sad faces—displayed on the micro:bit. When the micro:bit receives a binary 1 value from the NodeMCU, the smiling face appears. When the micro:bit receives a binary 0 value, a sad face appears. The idea of programmable emoji is shown in Figure 6.

 ESP8266 and the micro:bit
ESP8266 and the micro:bit

Emoji programming in MicroPython

# A Programmable Emoji import time from machine import Pin led=Pin(5, Pin.OUT) while True: led.value(1) # Display a happy face time.sleep(0.2) led.value(0) # Display a sad face time.sleep(0.2)

You can write the code using Google’s Blockly Code as shown in Figure 7, or you can use the Microsoft Makecode IDE, which is how the micro:bit code was generated.

The proper way to connect an ESP8266 NodeMCU to a micro:bit image 28
Figure 7. The micro:bit Programmable emoji Blockly code.

The MicroPython program uploaded through the Blockly lightweight visual programming platform and the NodeMCU development board enabled the Blockly code to make the face automatically change between the happy and sad expressions. Figure 8 contains the code currently running on the micro bit.

The proper way to connect an ESP8266 NodeMCU to a micro:bit microbit esp8266 1
Figure 8. A functional programmable emoji.