Skip to the content
2 layers70 × 50 mmRadar lamp, the printed circuit board in 3D

ESP32-C3 Super Mini project that dims a lamp based on distance measured by an Acconeer XE121 radar sensor (A121 chip).

Size
70 × 50 mm
Copper layers
2
Thickness
1.6 mm
Parts
14
Nets
14
Pads
49
Tracks, vias
0, 0
Pours
2
Routed
Not yet
KiCad
KiCad 9.0 (file 20241229)
Created
23 May 2026
Updated
31 May 2026

Overview

Radar lamp is an open-source printed circuit board by Yaribar, from the Yaribar/radar_lamp repository on GitHub. It is a 2-layer board of 70 × 50 mm with 14 parts on 14 nets.

It is built around the IRLZ44N. Its parts include 3 ICs, 2 resistors, 2 connectors, 1 capacitor and 1 transistor. It belongs with the lEDs and displays boards and the ESP32 and RISC-V boards of this library.

Main components

1

README

README.md

Radar Lamp

ESP32-C3 Super Mini project that dims a lamp based on distance measured by an Acconeer XE121 radar sensor (A121 chip).

Hardware

  • MCU: ESP32-C3 Super Mini
  • Sensor: Acconeer XE121 (A121 radar)

Wiring

SignalESP32-C3 GPIO
ENABLE3
INTERRUPT5
SCLK6
MOSI7
MISO2
CS10
SEL01
SEL10
SEL24
LED8 (built-in)

Note: GPIO 9 (BOOT), 8 (LED), and 18/19 (USB) were intentionally avoided for sensor SEL pins.

Build

Requires ESP-IDF 6.1.

bash
# 1. Source IDF (required every new terminal session)
. ~/esp/esp-idf/export.sh

# 2. Go to project
cd ~/esp/radar_lamp

# 3. Set target (only needed once or after cleaning)
idf.py set-target esp32c3

# 4. Build
idf.py build

# 5. Find your port
ls /dev/cu.*

# 6. Flash and open monitor
idf.py -p /dev/cu.YOURPORT flash monitor

To exit the monitor press Ctrl + ]

How it works

Distance → brightness mapping

DistanceBrightness
≤ 0.5 m100%
1.15 m~50%
≥ 1.8 m0%

When multiple distances are detected (e.g. paper lamp shade + person), the furthest reading is always used. The sensor start range is set to 0.30 m to exclude the paper shade (~10 cm away).

Perceptual brightness (gamma correction)

A raw linear PWM sweep from 0→100% does not look linear to the human eye — it appears to jump quickly at low values and barely change at high values. This is because eyes perceive brightness logarithmically.

To fix this, a gamma curve (γ = 2.2) is applied to the PWM duty cycle:

text
PWM duty = (brightness%)^2.2

This makes the lamp appear to change evenly as you move toward or away from it.

LED state machine

text
valid reading               valid reading
      │                           │
 ┌────▼──────┐  no reading   ┌────▼─────┐
 │ TRACKING  │ ────────────► │ HOLDING  │
 │           │ ◄──────────── │          │
 └───────────┘  reading back └────┬─────┘
                                  │ 3 s timeout
                                  ▼
                            ┌──────────┐
                            │  FADING  │ → slowly → 0%
                            └──────────┘
  • TRACKING: smoothly follows distance (max 2%/50 ms tick ≈ 2.5 s full sweep)
  • HOLDING: no reading detected, holds current brightness for 3 s
  • FADING: slowly fades to off (0.5%/tick ≈ 16 s full sweep)

Key hardware notes

  • SPI speed is 10 MHz — 40 MHz causes calibration failures over breadboard wires
  • Sensor range: 0.30 m to 3.0 m (balanced preset)

PCB / Hardware design

Circuit overview

12V barrel jack → Mini 360 step-down → 3.3V for ESP32 + XE121 12V barrel jack → IRLZ44N MOSFET (controlled by GPIO 8 PWM) → 12V LED lamp

BOM

ComponentValuePurpose
ESP32-C3 Super Mini—MCU
XE121 radar—distance sensor
IRLZ44N—MOSFET, switches 12V lamp via PWM
Mini 360 MP230712V → 3.3Vpower regulation
Resistor100ΩMOSFET gate series — limits inrush, prevents oscillation
Resistor10kΩMOSFET gate pull-down — keeps lamp off when GPIO floats on boot
Capacitor100nF ceramicnear ESP32 3.3V pin — absorbs high-freq switching noise
Barrel jack5.5/2.1mm12V input
ConnectorSH1.0mm 8-pin verticalXE121 radar
ConnectorXH2.54 2-pin12V lamp output
SwitchSPSTpower on/off

Notes

  • No flyback diode needed — lamp is a resistive LED load, no inductive spike
  • No fuse on board — power supply has built-in protection
  • 100µF on 12V input not needed — Mini 360 + regulated PSU covers it
  • IRLZ44N is rated 47A/55V, far above what a 12V LED lamp needs — chosen for logic-level gate compatibility with 3.3V GPIO
  • Lamp connector XH2.54 is rated for up to ~3A — verify lamp wattage stays within that (W/12V < 3A, so under 36W)

License

Acconeer source files are licensed under BSD 3-Clause. See LICENSES/license_acconeer.txt.

Parts

14
QtyValueFootprintReferences
4MountingHole_2.5mmMountingHole:MountingHole_2.5mmH1, H2, H3, H4
1100RResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR1
1100nFCapacitor_THT:C_Disc_D5.0mm_W2.5mm_P5.00mmC1
110kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR2
1Acconeer_XE121Connector_JST:JST_SH_SM08B-SRSS-TB_1x08-1MP_P1mm_HorizontalU2
1Barrel_Jack_5.5/2.1mmConnector_BarrelJack:BarrelJack_Horizontal_54-00166J1
1ESP32-C3-SuperMiniradar_lamp:ESP32-C3-SuperMiniU1
1IRLZ44NPackage_TO_SOT_THT:TO-220-3_VerticalQ1
1LED_Lamp_12VConnector_JST:JST_XH_B2B-XH-A_1x02_P2.50mm_VerticalJ2
1Mini360_3V3radar_lamp:Mini360U3
1SW_SPSTButton_Switch_THT:SW_Slide_1P2T_CK_OS102011MS2QN1SW1

Similar boards

  • 2 layers304.8 × 170.8 mm00Key, the printed circuit board in 3D

    00Key

    ZeroZeroOne-dev/00Key

    00Key a 75% keyboard

    268 parts241GPL-3.0
  • 2 layers94 × 79 mm5 - Lizard Car, the printed circuit board in 3D

    5 - Lizard Car

    TRD-B/Lizard

    3D printed RC race car with custom electronics

    54 parts129CC-BY-4.0
  • 2 layersMorpheus kicad, the printed circuit board in 3D

    Morpheus kicad

    pscrespo/Morpheus-STM32

    A small 3D printer controller board for use with a "blue pill" STM32F1 generic board. Inspired on http://reprap.org/wiki/SinapTec

    66 parts80GPL-3.0
  • 2 layers157.5 × 97.8 mmEsp32PrinterController, the printed circuit board in 3D

    Esp32PrinterController

    MitchBradley/Esp32PrinterController

    PCB design for 3D printer controller using ESP32 processor

    101 parts16MIT
  • 2 layers99.1 × 99.1 mmFlipDotDriver, the printed circuit board in 3D

    FlipDotDriver

    bitluni/FlippyFlip

    49 parts14
  • 2 layers64.8 × 109.2 mmDmx ledstrip dimmer-32ch, the printed circuit board in 3D

    Dmx ledstrip dimmer-32ch

    robinolejnik/dmx-ledstrip-dimmer-32ch

    Arduino Mini and TLC5940 based 32 channel 12V PWM dimmer with DMX512 and RDM support.

    105 parts14MIT
  • 2 layers101.6 × 53.3 mmBatteryAnalyzer MkII, the printed circuit board in 3D

    BatteryAnalyzer MkII

    Moragor/BatteryAnalyzer_MkII

    Updated Version of the battery analyzer, now with constant current

    25 parts12MIT

Questions

How big is the Radar lamp PCB?

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

What parts does the Radar lamp use?

14 parts, built around the IRLZ44N. 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 Radar lamp KiCad files?

From the Yaribar/radar_lamp repository on GitHub, at the commit this page was made from: the board is hardware/kicad/radar_lamp/radar_lamp.kicad_pcb and its schematic hardware/kicad/radar_lamp/radar_lamp.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Radar lamp design in my own project?

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