ESP8266 Arduino Tutorial 2 – Create the First Program

Driver Installation

In the previous tutorial, the Arduino IDE has been installed. In this tutorial, we will create the first program. This program uses the on-board LED on ESP-12E module. The LED will blink every 1 s. Before we go to the programming, we must install the NodeMCU USB driver. The step-by-step how to install the NodeMCU driver is described as the following:

  • Download NodeMCU driver from this link.
  • Connect NodeMCU board to the USB port.
  • Run the driver installer file: CH341SER.EXE, and install the driver.

NodeMCU Driver

Continue reading “ESP8266 Arduino Tutorial 2 – Create the First Program”

ESP8266 Arduino Tutorial 1 – IDE Installation


ESP8266 is a low-cost Wi-Fi System-on-Chip (SoC) produced by Espressif Systems, a Shanghai-based Chinese fabless semiconductor company. The ESP8266 chip is shown in the following figure. It consists of a Wi-Fi transceiver with full TCP/IP stack and a microcontroller. It uses IEEE 802.11 b/g/n Wi-Fi standard, which is generally used in our daily life. It has 32-bit Tensilica RISC processor that runs at 80 MHz. It has several peripherals such as GPIO, I2C, SPI, UART, ADC, etc.

ESP8266 chip

Continue reading “ESP8266 Arduino Tutorial 1 – IDE Installation”

STM32F103 SPL Tutorial 8 – Interfacing Unipolar Stepper Motor

Stepper Motor

Stepper motor is an electromechanical device that converts electrical pulses into discrete mechanical movements. In this tutorial, I will explain how to control a unipolar stepper motor using STM32F103 microcontroller. If you don’t know the basic of the stepper motor, I suggest you to read this post. To interface a stepper motor from a microcontroller, we can’t directly drive it with GPIO pins because GPIO pins have maximum current that can sink or source from it. To overcome this problem, we can use driver circuit. The driver circuit for unipolar stepper motor can be built by using 4 transistors to drive large current to the 4 wires of a stepper motor. It also can be built with ULN2003 IC. This is the circuit for driving a unipolar stepper motor from STM32F103 by using ULN2003 IC.

Stepper driver

Continue reading “STM32F103 SPL Tutorial 8 – Interfacing Unipolar Stepper Motor”

STM32F103 SPL Tutorial 7 – Interfacing LCD16x2


LCD16x2 is a popular display module and commonly used in various devices. In this tutorial, I will explain about how to use LCD16x2 with STM32F103 microcontroller. If you want to know the detail how LCD16x2 works, you can follow this tutorial. To interface the LCD with STM32F103, you need the library files (lcd16x2.h and lcd16x2.c). You can get the library files and from here.

STM32F103 LCD16x2

Continue reading “STM32F103 SPL Tutorial 7 – Interfacing LCD16x2”

STM32F103 SPL Tutorial 6 – I2C Interface

STM32F103 I2C

STM32F103 I2C (Inter-Integrated Circuit) or sometimes called TWI (Two Wire Interface) is a synchronous serial protocol that only needs 2 wires for communication. The wires are SCL for clock line and SDA for data line. With I2C, you can connect devices like temperature sensor, EEPROM, RTC, and etc (up to 112 devices) just using 2 wires (plus GND wire). For accessing these devices, I2C use 7-bit address. Theoretically, 7-bit address space allows 128 addresses, however some addresses are reserved for special purpose. Thus, only 112 addresses can be used.

I2C bus

Continue reading “STM32F103 SPL Tutorial 6 – I2C Interface”