Skip to the content
PCBKitNew board
2 layers55.9 × 45.7 mmMotor esp32h2, the printed circuit board in 3D

Outdoor roller window covering using ESP32-H2 and Zigbee Home Assistant integration

Size
55.9 × 45.7 mm
Copper layers
2
Thickness
1.6 mm
Parts
24
Nets
32
Pads
109
Tracks, vias
162, 3
Pours
1
Routed
Yes
KiCad
KiCad 8.0 (file 20240108)
Created
3 Jul 2025
Updated
11 Jul 2026

Overview

Motor esp32h2 is an open-source printed circuit board by David-EIPI, from the David-EIPI/esp32-zigbee-shade repository on GitHub, published under the BSD-2-Clause licence. It is a 2-layer board of 55.9 × 45.7 mm with 24 parts on 32 nets, routed with 162 tracks and 3 vias.

It is built around the R-78E5.0-1.0, DRV8871DDA and 0.1UF 50V 5*11. Its parts include 6 resistors, 6 connectors, 3 capacitors and 3 ICs. It belongs with the radio and wireless and home automation and IoT boards and the ESP32 and RISC-V boards of this library.

Main components

3

README

README.md

esp32-zigbee-shade

Overview

This external window shade is designed to shield the room from sunlight, reducing the load on the air conditioner. I upgraded a basic corded roller shade by integrating a small DC motor and a Zigbee controller compatible with my Home Assistant network.

Firmware

The firmware is written in C and built using idf.py. It exposes 2 endpoints with 3 clusters:

  • Window covering (shade control)
  • OTA (remote firmware upgrade)
  • Temperature measurement (on-chip temperature sensor)

The temperature sensor reports via Zigbee to monitor the temperature inside the control box, as summer ambient temperatures often exceed 35°C, and the enclosure tightly houses both the ESP32 and the motor driver.

See here instructions on building the firmware using idf.py on Linux.

Hardware

Mechanical

This window cover is based on the VICLLAX 5×6 ft corded roll-up shade, which uses an aluminum tube with a 1 1/8" (28 mm) inner diameter.

Several inexpensive DC motors with pre-assembled gearheads are available online, commonly found as clones of the Bringsmart High Torque Worm Gear DC motor. Most of these motors use gearheads with D-shaped shafts, predominantly 8 mm but occasionally 6 mm.

These motors and gearboxes come in various voltages and torque ratings. I used a 12 V motor equipped with a 200× ratio gearbox rated for 4 kg·cm torque. This choice turned out to be excessive, as a gearbox with a 60× or 80× ratio would have been sufficient.

To couple the motor to the roller tube, I repurposed Zemismart’s replacement 28 mm nylon gears, removing one tooth from each side and filing the D-shaped channel to match the motor shaft.

OriginalGear ModifiedGear
The original gear compared to the modified gear (two teeth removed, D-shape filed).

GearMotor
Gear mounted on the motor shaft.

GearTube
Gear inserted into the shade tube.

For motor mounting, I modified the original bracket supplied with the shade. I broke off the support lip, drilled two additional holes, and added a countersunk hole at the existing cut. The modified bracket is shown below:

Bracket

The image below shows the fully assembled motor with the coupling gear:

Assembly

Electronics

The control system uses an ESP32-H2 chip on Tenstar’s Supermini board (or a clone). This board sometimes exhibits startup issues when powered from a standalone DC-DC converter. Although the board already has an RC circuit on its reset line, it is apparently insufficient, as intermittent boot failures occur on power-up. I resolved this issue by soldering an additional 0.22 µF capacitor in parallel with the existing one.

The ESP32-H2 Supermini clones available on Aliexpress vary. The most notable difference is component placement: some boards have all components mounted on the top side, while other (usually cheaper) versions have components on both sides. For the double-sided boards, the additional capacitor should be soldered on the bottom side, as shown in the photo. Although I only had 0603-sized capacitors at hand, it fit comfortably next to the existing one.

Bottom side cap

Due to bottom-side components, the ESP32-H2 board must be mounted above the mainboard:

Elevated board

The motor driver uses a DRV8871 chip from Texas Instruments. It accepts a PWM control signal, easily generated using the standard ESP32 ledc controller.

The motor features a rotary encoder interfaced to the ESP32’s standard pulse-counter controller. This encoder maintains consistent upper and lower travel limits and allows precise partially-open positioning of the shade.

A notable drawback of this motor is its hardwired, non-weatherproof cable. Its durability in summer humidity remains uncertain, and some corrosion is likely inevitable. To minimize electrochemical corrosion, I designed the control circuit to disconnect power from the motor and encoder when the shade is stationary.

The final assembly fits neatly into the Serpac 110i BK enclosure. I only needed to cut openings for the 6-pin motor connector (on the left) and the power jack (on the right):

Controller assembly

Since the motor connector is not polarized it may be a good idea to mark the connector orientation on the enclosure side.

ZHA quirk

Although ZHA supports window coverings, additional configuration using a quirk is required. The quirk provides coverage percentage display, lift velocity settings, and essential calibration buttons for setting upper and lower limits.

The screenshot below shows the device page (quirk applied):

Device info

Calibration of limits must be completed before using the shade for the first time. The calibration procedure is as follows:

  • Press "↓" to start lowering the shade, stopping roughly halfway. This step isn't strictly required, but it reduces the likelihood of pulse counter overflow, as the pulse counter range is limited to 16 bits.
  • Press "reset limits".
  • Press "↑" to raise the shade, stopping at the desired upper position. Then press "Set upper limit" to record this position.
  • Press "↓" again, stopping at the desired lower position. Then press "Set lower limit" to record this position.

Depending on Zigbee network topology, commands may take about a second to process. Thus, if the motor rolls quickly, reducing the lift velocity before calibration may improve accuracy.

Over-the-air (OTA) upgrade

The firmware supports OTA upgrades. ESP's Zigbee library handles most tasks, leaving only four essential esp_ota_* function calls (begin, data, write, and end) for firmware implementation, aside from cluster allocation and error checking. The SDK provides an image builder tool (image_builder_tool.py) to convert compiled firmware into OTA format (see the ota_image.sh script for a usage example).

On the Home Assistant side, the Zigpy configuration should be added to configuration.yaml under the zha: section, as illustrated below:

text
zha:
  zigpy_config:
    ota:
      extra_providers:
        - type: zigpy_local
          index_file: /config/zha_ota/local_index.json
        - type: advanced
          warning: I understand I can *destroy* my devices by enabling OTA
              updates from files. Some OTA updates can be mistakenly applied to the
              wrong device, breaking it. I am consciously using this at my own risk.
          path: /config/zha_ota

OTA update files (JSON and BIN) should be uploaded to the specified directory (/config/zha_ota in this example). When using the JSON OTA provider, Home Assistant will display firmware version and release notes from the provided JSON file.

Parts

24
QtyValueFootprintReferences
5Conn_01x03_PinConnector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ1, J2, J3, J5, J6
4MountingHoleMountingHole:MountingHole_2.7mm_M2.5H1, H2, H3, H4
20.1uF/50VCapacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolderC2, C3
2100RResistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolderR4, R5
21RResistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolderR1, R2
11KResistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolderR3
122uF/63VCapacitor_THT:CP_Radial_D6.3mm_P2.50mmC1
164KResistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolderR6
1Conn_01x02Connector_TE-Connectivity:TE_826576-2_1x02_P3.96mm_VerticalDC-12
1Conn_01x06Connector_PinHeader_2.54mm:PinHeader_1x06_P2.54mm_VerticalJ4
1DRV5055A4xLPGxQ1Package_TO_SOT_THT:TO-92_InlineU3
1DRV8871Package_SO:Texas_HTSOP-8-1EP_3.9x4.9mm_P1.27mm_EP2.95x4.9mm_Mask2.4x3.1mm_ThermalViasU2
1R-78E5.0-1.0Converter_DCDC:Converter_DCDC_RECOM_R-78E-0.5_THTDCDC1
1~my_rfmodule:ESP32-H2-SuperMiniU1

Questions

How big is the Motor esp32h2 PCB?

It measures 55.9 × 45.7 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Motor esp32h2 use?

24 parts, built around the R-78E5.0-1.0, DRV8871DDA and 0.1UF 50V 5*11. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Motor esp32h2 KiCad files?

From the David-EIPI/esp32-zigbee-shade repository on GitHub, at the commit this page was made from: the board is sch/motor-esp32h2.kicad_pcb and its schematic sch/motor-esp32h2.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Motor esp32h2 design in my own project?

Its repository publishes it under the BSD-2-Clause licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).

Similar boards

  • 2 layers50 × 60 mmZiggy, the printed circuit board in 3D

    Ziggy

    alaza252/senior_design

    28 parts1
  • 2 layers102.9 × 99.1 mmDCC Booster, the printed circuit board in 3D

    DCC Booster

    DavidMFlynn/DCC-Booster

    DCC Booster

    130 partsGPL-3.0
  • 2 layers20.3 × 24.1 mmAdafruit DRV8871, the printed circuit board in 3D

    Adafruit DRV8871

    Nithin1777/PCB_DESIGNS

    These are the PCB designs that I made for the robotics club and the department of electronics.

    14 parts
  • 2 layers171.5 × 106.7 mmSequencer, the printed circuit board in 3D

    Sequencer

    westlicht/performer-hardware

    PER|FORMER Eurorack Sequencer - Hardware Design Files

    435 parts110
  • 2 layers200 × 81 mmPSU-30W, the printed circuit board in 3D

    PSU-30W

    ctag-fh-kiel/PSU-30W

    Eurorack power supply unit DCDC

    43 parts24
  • 4 layers122.2 × 115.1 mmScan controller kicad, the printed circuit board in 3D

    Scan controller kicad

    fwachsmuth/Filmkorn-Raw-Scanner

    The Filmkorn Raw Scanner, turning 8mm and 16mm films into lossless 12-bit CinemaDNG

    170 parts13MIT