STEP 1 / 6ESP + IOT

Power ESP8266 with Mains Voltage using Hi-Link HLK-PM03 Converter

430.Power ESP8266 with Mains Voltage using Hi-Link HLK-PM03 Converter Using the Hi-Link HLK-PM03 converter, you will learn how to power the ESP8266 (or ESP32) using mains voltage in this…

Circuit Atlas themed schematic for Power ESP8266 with Mains Voltage using Hi-Link HLK-PM03 Converter
PROJECT#430
TRACKIoT
PARTS05
STAGES06
STEP 1 / 6 · Overview

Know the mission before touching a wire.

Understand what you are making, prepare the right tools, and make the workbench safe.

01

Project details

Power ESP8266 with Mains Voltage using Hi-Link HLK-PM03 Converter is a iot project. 430.Power ESP8266 with Mains Voltage using Hi-Link HLK-PM03 Converter Using the Hi-Link HLK-PM03 converter, you will learn how to power the ESP8266 (or ESP32) using mains voltage in this…

Source pages
1040-1044
Named parts
5
Build goal
Working, tested prototype
02

Tools you need

  • Digital multimeter
  • Wire stripper and side cutters
  • Soldering iron with a fine tip
  • Current-limited bench supply
  • Computer with a data-capable USB cable

Use eye protection, good lighting, and a clean insulated surface throughout the build.

03

Safety precautions

  • Disconnect every power source before changing a connection.
  • Check component polarity, pinout, and supply voltage twice.
  • Use a current limit for the first power-up.
  • This project may involve hazardous voltage. Work only with qualified supervision and proper isolation.
Ready to continue?
STEP 2 / 6 · Parts library

Gather, identify, and understand every part.

Use the standardized inventory, then open What's this? to learn each part's role, advantages, limitations, handling, and specifications.

NAMED PROJECT INVENTORY5 PART LINES
PARTTYPEQTYREADY
MESP8266MODULE1
What's this?Image, role, pros, cons, handling & specifications
Circuit Atlas themed schematic for Power ESP8266 with Mains Voltage using Hi-Link HLK-PM03 ConverterMODULE LEARNING VIEW

ESP8266

A programmable controller that reads inputs, makes decisions, and drives the project's outputs.

What it does here

It is the control centre and must use the documented board, pin map, supply, and logic level.

Buy / compare this part

Advantages

  • Reprogrammable and reusable
  • Large learning ecosystem
  • Complex behaviour remains changeable

Limitations

  • GPIO voltage and current are limited
  • Some pins affect boot or communication
  • Loads normally need a driver

Handling

  • Disconnect power before rewiring
  • Avoid static discharge
  • Never power motors, relays, or pumps directly from GPIO

Specifications to verify

  • Use the exact model, value, package, and rating listed for ESP8266; similar-looking parts are not always interchangeable.
  • Confirm operating voltage, logic level, pinout, memory, USB interface, and maximum GPIO current.
MESP32MODULE1
What's this?Image, role, pros, cons, handling & specifications
Circuit Atlas themed schematic for Power ESP8266 with Mains Voltage using Hi-Link HLK-PM03 ConverterMODULE LEARNING VIEW

ESP32

A programmable controller that reads inputs, makes decisions, and drives the project's outputs.

What it does here

It is the control centre and must use the documented board, pin map, supply, and logic level.

Buy / compare this part

Advantages

  • Reprogrammable and reusable
  • Large learning ecosystem
  • Complex behaviour remains changeable

Limitations

  • GPIO voltage and current are limited
  • Some pins affect boot or communication
  • Loads normally need a driver

Handling

  • Disconnect power before rewiring
  • Avoid static discharge
  • Never power motors, relays, or pumps directly from GPIO

Specifications to verify

  • Use the exact model, value, package, and rating listed for ESP32; similar-looking parts are not always interchangeable.
  • Confirm operating voltage, logic level, pinout, memory, USB interface, and maximum GPIO current.
PRelay modulePART1
What's this?Image, role, pros, cons, handling & specifications
Circuit Atlas themed schematic for Power ESP8266 with Mains Voltage using Hi-Link HLK-PM03 ConverterPART LEARNING VIEW

Relay module

An output component turns an electrical control signal into light, sound, motion, switching, or displayed information.

What it does here

It presents the circuit result or acts on the physical world.

Buy / compare this part

Advantages

  • Makes system state visible
  • Can be tested separately
  • Supports clear troubleshooting

Limitations

  • Loads may exceed controller current
  • Polarity or driver direction can matter
  • Inductive loads create voltage spikes

Handling

  • Use the documented driver stage
  • Check polarity and load current
  • Add flyback protection for inductive loads

Specifications to verify

  • Use the exact model, value, package, and rating listed for Relay module; similar-looking parts are not always interchangeable.
  • Confirm voltage, current, polarity, interface, driver requirements, and duty cycle.
PNETWORKPART1
What's this?Image, role, pros, cons, handling & specifications
Circuit Atlas themed schematic for Power ESP8266 with Mains Voltage using Hi-Link HLK-PM03 ConverterPART LEARNING VIEW

NETWORK

A named project component whose exact role is defined by the source circuit and build guide.

What it does here

It performs a documented electrical, control, interface, or construction function in this project.

Buy / compare this part

Advantages

  • Selected for this project
  • Can be checked independently
  • Supports modular troubleshooting

Limitations

  • Substitutes may differ
  • Generic names can hide variants
  • Pinouts and ratings vary

Handling

  • Compare the received part with the source
  • Keep it labelled
  • Do not force connectors or adjusters

Specifications to verify

  • Use the exact model, value, package, and rating listed for NETWORK; similar-looking parts are not always interchangeable.
  • Confirm dimensions, ratings, connection method, polarity, and environmental limits.
MESP8266-01 - controller board / ICMODULE1
What's this?Image, role, pros, cons, handling & specifications
Circuit Atlas themed schematic for Power ESP8266 with Mains Voltage using Hi-Link HLK-PM03 ConverterMODULE LEARNING VIEW

ESP8266-01 - controller board / IC

A programmable controller that reads inputs, makes decisions, and drives the project's outputs.

What it does here

It is the control centre and must use the documented board, pin map, supply, and logic level.

Buy / compare this part

Advantages

  • Reprogrammable and reusable
  • Large learning ecosystem
  • Complex behaviour remains changeable

Limitations

  • GPIO voltage and current are limited
  • Some pins affect boot or communication
  • Loads normally need a driver

Handling

  • Disconnect power before rewiring
  • Avoid static discharge
  • Never power motors, relays, or pumps directly from GPIO

Specifications to verify

  • Use the exact model, value, package, and rating listed for ESP8266-01 - controller board / IC; similar-looking parts are not always interchangeable.
  • Confirm operating voltage, logic level, pinout, memory, USB interface, and maximum GPIO current.
Ready to continue?
STEP 4 / 6 · Source code

Confirm the hardware-only control path.

This project does not include firmware in the source. The circuit itself provides the required behaviour.

01

How to connect

  1. Match every controller label to the circuit view and source pin map.
  2. Join grounds before signal wires when separate low-voltage supplies are used.
  3. Keep motors, relays, pumps, and other loads on a suitable driver and external supply.

Common mistakes

Reversed VCC/GND, board-label versus GPIO-number confusion, missing common ground, and charge-only USB cables.

Troubleshoot

Disconnect loads, continuity-test one path at a time, then test with a current limit.

02

Software preparation

No IDE, board package, library, or firmware upload is required for this project.

If you add a programmable controller as an extension, document its pin map separately.

03

How to upload code

The original design is implemented entirely in hardware, so proceed after verifying the circuit and supply.

Ready to continue?
STEP 5 / 6 · Build

Assemble, deploy, test, and troubleshoot.

Use the complete source notes in build order, then pass the final checks before calling the project finished.

ASSEMBLY

Build in functional stages

  • Power and regulation
  • Controller or processing stage
  • Inputs and sensors
  • Outputs and loads
  • Enclosure and strain relief
TEST

Power up safely

  • Inspect unpowered continuity first
  • Apply the lowest safe current limit
  • Measure supply rails before signals
  • Add one load at a time
  • Record expected and actual results
TROUBLESHOOT

Work from simple to complex

  • Confirm power, ground, polarity, and orientation
  • Compare each pin with the source
  • Test inputs separately from outputs
  • Replace only one variable at a time
  • Power off before every correction
PROJECT-SPECIFIC BUILD NOTES

Follow the documented instructions.

These notes come from this project's source and remain in their original order.

01

Project overview

Project build note

430.Power ESP8266 with Mains Voltage using Hi-Link HLK-PM03 Converter Using the Hi-Link HLK-PM03 converter, you will learn how to power the ESP8266 (or ESP32) using mains voltage in this tutorial. We'll demonstrate how the ESP8266-01 may be used to control a relay by connecting it to a web server. Both the ESP32 and ESP8266 are inexpensive Wi-Fi modules that are excellent choices for Do It Yourself (DIY) projects involving the Internet of Things (IoT) and Home Automation. When combined with a relay, an ESP32 or ESP8266 gives you the ability to remotely control any AC electronic appliance using Wi-Fi (using a web-server, for example).

Finding an appropriate power source for the ESP32/ESP8266 that has a tiny form factor at the same time is one of the most challenging aspects of these projects (in a final application, you do not want to power the relay and the ESP32/ESP8266 using two different power supplies). Using the AC/DC converter Hi-Link HLK-PM03 to draw power from the mains voltage in order to power the ESP8266 or ESP32 is one method (or HLK-PM01 model). Introducing the Hi-Link HLK-PM03/01 Converter Modules The Hi-Link HLK-PM03 is an AC/DC converter module that is quite compact. The HLK-PM03 AC/DC converter can obtain 3.3V from either 110VAC or 220VAC, depending on which input voltage is used. Because of this, it is ideal for use in modest applications that require a supply of 3.3V from the mains voltage. The HLK-PM01 is another option for achieving the desired output of 5V. We will be utilizing the HLK-PM03 to supply 3.3V to the VCC pin of the ESP8266-01 so that it can be powered by the mains voltage. If you need to power other ESP8266 models or an ESP32 through the VIN pin with 5V, you can use the HLK-PM01 model, which has a 5V output and functions in a manner that is analogous to that of the original. Safety Warning: This project deals with voltage that comes from the mains. Check that you have a firm grasp on the activities at hand. Please make sure you give the safety warning a thorough read. Powering the ESP8266 with AC using the Hi-Link HLK-PM03 module You don't need any additional circuitry to utilize the HLK-PM03; simply connect it straight to the VCC pin on the ESP8266. Having said that, I don't think that's a good idea. It is highly recommended that a protective circuit consisting of a thermal fuse and fast-acting fuses be added. When powering an ESP8266 device, it is a good idea to add capacitors to the output of the

HLK-PM03 so that the voltage peaks are smoothed out and unexpected resets or unstable behavior are avoided. In addition, we have installed a varistor across the mains input in order to shield the circuit from sudden spikes in voltage.

02

Parts Required

Project build note

The following is a list of all of the components that are need to construct the

03

circuit for the project that we will build

Project build note

HLK-PM03\ESP8266-01\ESP8266-01 Programmer Relay Module Compatible with FTDI Serial Adapter (3.3V) Terminal blocks consisting of two connections each Terminal blocks consisting of three connectors each Electrolytic capacitor 10uF Electrolytic capacitor 22uF Slowly Blow the Fuse (200mA) Thermal Fuse (72 degrees Celsius) Blow the Fuse Quickly (630mA) Varistor Stripboard (Prototyping Circuit Board) Connecting Wires

04

Circuit Diagram

Project build note

The connection to the mains voltage should be made at the J1 terminal block. The ESP8266-01 will be powered by the 3.3V and GND that are provided after the capacitors. A three-terminal block that is attached to the ESP8266 has also been added in order to gain access to 3.3V, GND, and GPIO 2 in order to operate an output (relay module). Due to the fact that we are working with 3.3V, you should make use of a 3.3V relay module similar to this one.

05

Demonstration

Project build note

After you have uploaded the code to the ESP8266 and obtained the IP address, you will need to insert it into the circuit and then provide power to the circuit. Caution: the circuit should not be touched while it is still linked to the mains voltage! Launch your web browser, enter the IP address of the ESP, and the page that you see here should load. On your local network, you have to have the capability of controlling the relay remotely. Both the HLK-PM01 and the HLK-PM03 are examples of converter modules. They take the mains voltage and convert it into either 5V or 3.3V. This makes it simple for you to supply electricity to your ESP8266 or ESP32 when working on Internet of Things and Home Automation projects. We sincerely hope that you have found this effort to be beneficial.

Ready to continue?
PROJECT ACHIEVED

You built Power ESP8266 with Mains Voltage using Hi-Link HLK-PM03 Converter.

You followed the full workflow from understanding the mission to testing the finished project. That is a real engineering achievement - well done.

ESP8266 Multisensor Shield with Node-RED project thumbnail featuring ESP8266 Wemos D1 Mini - see Highest-Rated ESP8266 Wi-Fi, Development Board, x 5mm LED, 1x 330 Ohm resistor
NEXT IOT ADVENTURE

ESP8266 Multisensor Shield with Node-RED

Ready to reuse what you learned in another project from the same track?

Start this project
Browse all 500 projects