

Radar lamp
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
1README
README.mdRadar 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
| Signal | ESP32-C3 GPIO |
|---|---|
| ENABLE | 3 |
| INTERRUPT | 5 |
| SCLK | 6 |
| MOSI | 7 |
| MISO | 2 |
| CS | 10 |
| SEL0 | 1 |
| SEL1 | 0 |
| SEL2 | 4 |
| LED | 8 (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.
# 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 monitorTo exit the monitor press Ctrl + ]
How it works
Distance → brightness mapping
| Distance | Brightness |
|---|---|
| ≤ 0.5 m | 100% |
| 1.15 m | ~50% |
| ≥ 1.8 m | 0% |
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:
PWM duty = (brightness%)^2.2This makes the lamp appear to change evenly as you move toward or away from it.
LED state machine
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
| Component | Value | Purpose |
|---|---|---|
| ESP32-C3 Super Mini | — | MCU |
| XE121 radar | — | distance sensor |
| IRLZ44N | — | MOSFET, switches 12V lamp via PWM |
| Mini 360 MP2307 | 12V → 3.3V | power regulation |
| Resistor | 100Ω | MOSFET gate series — limits inrush, prevents oscillation |
| Resistor | 10kΩ | MOSFET gate pull-down — keeps lamp off when GPIO floats on boot |
| Capacitor | 100nF ceramic | near ESP32 3.3V pin — absorbs high-freq switching noise |
| Barrel jack | 5.5/2.1mm | 12V input |
| Connector | SH1.0mm 8-pin vertical | XE121 radar |
| Connector | XH2.54 2-pin | 12V lamp output |
| Switch | SPST | power 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| Qty | Value | Footprint | References |
|---|---|---|---|
| 4 | MountingHole_2.5mm | MountingHole:MountingHole_2.5mm | H1, H2, H3, H4 |
| 1 | 100R | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_Horizontal | R1 |
| 1 | 100nF | Capacitor_THT:C_Disc_D5.0mm_W2.5mm_P5.00mm | C1 |
| 1 | 10k | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_Horizontal | R2 |
| 1 | Acconeer_XE121 | Connector_JST:JST_SH_SM08B-SRSS-TB_1x08-1MP_P1mm_Horizontal | U2 |
| 1 | Barrel_Jack_5.5/2.1mm | Connector_BarrelJack:BarrelJack_Horizontal_54-00166 | J1 |
| 1 | ESP32-C3-SuperMini | radar_lamp:ESP32-C3-SuperMini | U1 |
| 1 | IRLZ44N | Package_TO_SOT_THT:TO-220-3_Vertical | Q1 |
| 1 | LED_Lamp_12V | Connector_JST:JST_XH_B2B-XH-A_1x02_P2.50mm_Vertical | J2 |
| 1 | Mini360_3V3 | radar_lamp:Mini360 | U3 |
| 1 | SW_SPST | Button_Switch_THT:SW_Slide_1P2T_CK_OS102011MS2QN1 | SW1 |
Similar boards
- 2 layers304.8 × 170.8 mm

- 2 layers94 × 79 mm

- 2 layers

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 layers100 × 100 mm

- 2 layers157.5 × 97.8 mm

Esp32PrinterController
MitchBradley/Esp32PrinterController
PCB design for 3D printer controller using ESP32 processor
101 parts16MIT - 2 layers99.1 × 99.1 mm

- 2 layers64.8 × 109.2 mm

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 mm

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.