Skip to the content
2 layers60 × 60 mmIOS MoonLamp, the printed circuit board in 3D

A Moon Lamp based on an ESP32 controlled using the iOS Home app.

Size
60 × 60 mm
Copper layers
2
Thickness
1.6 mm
Parts
33
Nets
69
Pads
193
Tracks, vias
0, 0
Routed
Yes
KiCad
KiCad 10.0 (file 20260206)
Created
31 May 2026
Updated
13 Jun 2026

Overview

IOS MoonLamp is an open-source printed circuit board by mkhairyx, from the mkhairyx/iOS-MoonLamp repository on GitHub. It is a 2-layer board of 60 × 60 mm with 33 parts on 69 nets.

It is built around the ESP32-WROOM-32, AMS1117-3.3 and WS2812B. Its parts include 11 capacitors, 10 resistors, 5 ICs, 3 diodes and 3 switches. It belongs with the lEDs and displays boards and the ESP32 boards of this library.

Main components

3

README

README.md

iOS Moon Lamp

3D Moon Lamp

Bought a battery powered Moon lamp a few years ago, and it was cool back then but now it’s boring that I have to turn it on and off manually every night. So I removed the insides of it and made it powered with an ESP32 controlled by the iOS Home app.

Moon Lamp

The Poster

High resolution poster available here.

Poster

The Design

The PCB:

Here's how the PCB looks like: 3D PCB And here's the gerber view for it: KiCad PCB

The Schematics:

Schematic

The case:

The case is held together with four M5 screws. Case

Assembly

Step Files

Check Step_Files to see step files.

Exploded View:

Exploded

Assembly video:

This video shows how to assemble and disassemble the case:

https://github.com/user-attachments/assets/3fa87b10-48f1-4240-b7dd-df9781dbfde8

Firmware

Compile and flash using the Arduino IDE

If you want to edit the code, compile it yourself, then flash it; you can download the arduino sketch and the required libraries here.

Flash the firmware as is

If you want to flash the firmware as is, you can download it here.
You can use ESPWebTool to flash the firmware directly to the ESP32 using your browser.

Operating the device

Power

The device is powered by a USB-C and does not have a battery, so please make sure that it's connected to a stable USB-C power source. The device shows wether it's powered on or not through the Red LED on the back near the USB-C port.

Blue Status LED

The device shows it's status through the Blue Status LED on the back near the USB-C port. Refer to HomeSpan's documentation on HomeSpan Device Status to be able to identify different states.

CLI

The CLI can be used to setup the device, change the WI-FI credentials, or factory reset the system.1 You can use the CLI through the onboard USB-C port on the back. Use a baud rate of 9600 for serial communication.

Control Button

The Control Button can be used to put the device in Command Mode and select different actions. Refer to HomeSpan's documentation on Device Command Mode to know how to use it

BOM

Available as a .csv file here

BOM Table (components only)

(Pricing for the enclosure and the PCB will depend on where the stuff are made)

NameValueLinkCost (EGP) per oneCost (USD)Total Cost (EGP)Total Cost (USD)QtyDescription
Capacitor22uFhttps://lampatronics.com/product/smd-multilayer-ceramic-capacitor-1210-22uf-16v-1pcsEGP 2.00$0.038EGP 6.00$0.123
Capacitor100nfhttps://lampatronics.com/product/smd-multilayer-ceramic-capacitor-1206-100nf-50v-1pcsEGP 1.50$0.029EGP 10.50$0.037
Capacitor4.7uFhttps://lampatronics.com/product/smd-multilayer-ceramic-capacitor-1206-4-7uf-16v-1pcsEGP 1.50$0.029EGP 1.50$0.031
Main LEDWS2812B LEDhttps://uge-one.com/product/f5-5mm-ws2812b-rgb-smart-led-5v/EGP 17.10$0.329EGP 17.10$0.331
Power LEDRED LEDhttps://lampatronics.com/product/smd-led-0603-red-10pcsEGP 6.00$0.115EGP 6.00$0.121
Status LEDBLUE LEDhttps://lampatronics.com/product/smd-led-0603-blue-10pcsEGP 6.00$0.115EGP 6.00$0.121
USB-C16Phttps://www.ram-e-shop.com/shop/usb9-c-type-pcb-usb-connector-on-pcb-c-type-type-female-16-pin-sku-usb9-8125EGP 5.00$0.096EGP 5.00$0.101
Resistor5.1k ohmhttps://lampatronics.com/product/resistor-5-1k-ohm-1-4w-2pcsEGP 0.30$0.006EGP 0.30$0.0111 pack of 2 resistors
Resistor2khttps://lampatronics.com/product/smd-resistor-2kohm-202-0805-10pcsEGP 2.00$0.038EGP 2.00$0.0411 pack of 10 resistors
Resistor22khttps://lampatronics.com/product/smd-resistor-22kohm-223-0805-10pcsEGP 2.00$0.038EGP 2.00$0.0411 pack of 10 resistors
Resistor47khttps://lampatronics.com/product/smd-resistor-47k-473-ohm-0805-10pcsEGP 2.00$0.038EGP 2.00$0.0411 pack of 10 resistors
Resistor10khttps://lampatronics.com/product/smd-resistor-10kohm-103-0805-10pcsEGP 2.00$0.038EGP 2.00$0.0411 pack of 10 resistors
Resistor220https://lampatronics.com/product/smd-resistor-220ohm-221-0805-10pcsEGP 2.00$0.038EGP 2.00$0.0411 pack of 10 resistors
Switchhttps://lampatronics.com/product/push-button-long-right-angle-2pin2base-7x7-5x6mmEGP 1.50$0.029EGP 3.00$0.032Boot and Enable
Switchhttps://lampatronics.com/product/push-button-4pin-long-6x6x13mmEGP 1.50$0.029EGP 1.50$0.031Control
Voltage RegulatorAMS1117-3.3https://lampatronics.com/product/ams1117-adj-sot-223-adj-linear-voltage-regulatorEGP 2.00$0.038EGP 2.00$0.041
Programmer chipCP2102Nhttps://uge-one.com/product/cp2102-gmr-usb-to-uart-bridge-controller-qfn-28/EGP 250.00$4.810EGP 250.00$4.811
Main MCUESP32-WROOM-32https://uge-one.com/product/espressif-esp32-wroom-32-dual-core-wi-fi-bluetooth-iot-module/EGP 290.00$5.579EGP 290.00$5.581
OptocouplerPC817https://www.ram-e-shop.com/shop/pc817-pc817-el817c-f-5866EGP 2.00$0.038EGP 2.00$0.041
Touch sensorTTP223https://lampatronics.com/product/ttp223-touch-button-moduleEGP 10.00$0.192EGP 10.00$0.191
EGP 620.90$11.74

Orders from different manufacturers

In Egypt:

Nori (PCB only): $19.05

image

metanoia (Case only): $5.77

image
Out of Egypt (international shipping):

JLCPCB (both PCB and Case): $32.42

image

Notes

The TTP 223 module is connected to the main PCB using three wires.
The 3D printed case, the PCB, and the Moon itself (the lamp) are not included in the BOM, but their costs are shown in Orders from different manufacturers. The Moon Lamp it self was salvaged from an old lamp, so it costs nothing, therefore it wasn't included in the BOM.

Made and designed by @mkhairyx.
Supported by Fallout and Hack Club.
Powered by HomeSpan


Footnotes

  1. Check the The HomeSpan Command-Line Interface (CLI) to be able to use the device's CLI through the onboard USB-C port. ↩

Parts

33
QtyValueFootprintReferences
70.1uF/50V(10%)Capacitor_SMD:C_1206_3216Metric_Pad1.33x1.80mm_HandSolderC3, C6, C7, C8, C9, C10, C11
322uF/10V(20%)Capacitor_SMD:C_1210_3225Metric_Pad1.33x2.70mm_HandSolderC1, C2, C5
210KResistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolderR7, R8
22kResistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolderR3, R10
25.1kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR1, R2
1(BOOT)Button_Switch_THT:SW_Tactile_SPST_Angled_PTS645Vx58-2LFSSW1
1(CTRL)Button_Switch_THT:SW_PUSH_6mm_H13mmSW3
1(EN)Button_Switch_THT:SW_Tactile_SPST_Angled_PTS645Vx58-2LFSSW2
1220Resistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolderR9
122K(5%)Resistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolderR4
12KResistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolderR6
14.7uF/6.3V(10%)Capacitor_SMD:C_1206_3216Metric_Pad1.33x1.80mm_HandSolderC4
147KResistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolderR5
1AMS1117-3.3Package_TO_SOT_SMD:SOT-223-3_TabPin2U1
1BLUE LEDLED_SMD:LED_0603_1608Metric_Pad1.05x0.95mm_HandSolderD3
1CP2102N-Axx-xQFN28Package_DFN_QFN:QFN-28-1EP_5x5mm_P0.5mm_EP3.35x3.35mmU2
1ESP32-WROOM-32RF_Module:ESP32-WROOM-32U3
1PC817Package_DIP:DIP-4_W7.62mmU4
1RED LEDLED_SMD:LED_0603_1608Metric_Pad1.05x0.95mm_HandSolderD2
1USB_C_Receptacle_USB2.0_16PConnector_USB:USB_C_Receptacle_GCT_USB4105-xx-A_16P_TopMnt_HorizontalJ1
1WS2812BLED_THT:LED_D5.0mm-4_RGB_Wide_PinsD1
1~Custom:UntitledU5

Similar boards

  • 2 layers38 × 56 mmRaven TX L1, the printed circuit board in 3D

    Raven TX L1

    RavenLRS/raven-hardware

    Hardware designs for Raven

    37 parts12
  • 2 layers159 × 140.1 mmPhazor, the printed circuit board in 3D

    Phazor

    skrmsh/skirmish-hardware

    Skirmish Hardware © 2022-2023 by Ole Lange is licensed under CC BY-NC-SA 4.0. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/4.0/

    123 parts10
  • 2 layers50 × 50 mmRfid uhf wifi reader, the printed circuit board in 3D

    Rfid uhf wifi reader

    OpenLaundry/wifi-rfid-uhf-reader

    Portable long range RFID uhf reader with WIFI based on esp32

    23 parts8
  • 4 layers85.1 × 53.3 mmEsp32-faerfly V2.0, the printed circuit board in 3D

    Esp32-faerfly V2.0

    low-poly-studio/esp32-faerfly

    Imogen Wren Business Card Light Show PCB

    103 parts5
  • 2 layers290 × 210 mmT8-Sequencer, the printed circuit board in 3D

    T8-Sequencer

    lluisestape-upc/T8-Sequencer

    16-step ESP32 groovebox: two-layer 290x210 mm KiCad board, DRC-clean and fabrication-ready, with the Python scripts that generated and repaired it

    104 parts2MIT
  • 4 layers28.5 × 52.7 mmTiny led esp32, the printed circuit board in 3D

    Tiny led esp32

    brushknight/tiny-led-esp32

    Tiny 3x4 WiFi esp32 ws2812b based matrix

    41 parts1
  • 2 layers100 × 100 mmBlommor, the printed circuit board in 3D

    Blommor

    Ostpopcorn/FlowerMonitorPCB

    83 parts
  • 2 layers100 × 100 mmDesktop light, the printed circuit board in 3D

    Desktop light

    rmingon/desktop-light

    Desktop light ws2812b with warm setting and text writing

    95 parts

Questions

How big is the IOS MoonLamp PCB?

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

What parts does the IOS MoonLamp use?

33 parts, built around the ESP32-WROOM-32, AMS1117-3.3 and WS2812B. 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 IOS MoonLamp KiCad files?

From the mkhairyx/iOS-MoonLamp repository on GitHub, at the commit this page was made from: the board is source/KiCad - PCB/iOS_MoonLamp/_restore_backup_2026-05-30T03-58-17-070/iOS_MoonLamp.kicad_pcb and its schematic source/KiCad - PCB/iOS_MoonLamp/_restore_backup_2026-05-30T03-58-17-070/iOS_MoonLamp.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the IOS MoonLamp design in my own project?

Its repository states no licence, so its author keeps all rights: ask mkhairyx before reusing the design.