proj_w6100_rp2350
https://github.com/Jaremekgw/proj_w6100_rp2350
Radar Presence Detection + Ethernet Control + RGBW PWM Dimming
Why Build This?
Reaching for a light switch with wet hands or while carrying something in the kitchen is more annoying than it sounds. PIR-based auto lighting already exists, but it has a well-known flaw — stay still for a moment, and the lights go off.
This project tries to solve that with three things on a single board:
- Millimeter-wave radar to detect stationary occupants accurately
- RGBW PWM for smooth color temperature and brightness control
- Ethernet (W6100) for network integration and remote control
Hardware Overview
Components
| Component | Role | Interface |
|---|---|---|
| W6100-EVB-PICO2 | Integrated board with RP2350 MCU + W6100 Ethernet | — |
| RD03D | 24GHz radar (presence detection) | UART0 |
| RGBW LED | Lighting output | PWM (GP4~7) |
| VL53L8CX (optional) | ToF distance sensor | SPI1 / I2C1 |
Pin Map
W6100-EVB-PICO2 (RP2350 + W6100 integrated)
│
├── SPI0 ──────────────────► W6100 (Ethernet)
│ (board default pins)
│
├── SPI1 / I2C1 ────────────► VL53L8CX (ToF, optional)
│ GP7 → MISO
│ GP8 → SCK
│ GP9 → MOSI
│ GP10 → CS
│ GP11 → LPn
│
├── UART0 ──────────────────► RD03D (Radar)
│ GP14 → TX
│ GP15 → RX
│ 256000 baud
│
└── PWM ────────────────────► RGBW LED
GP4 → White
GP5 → Blue
GP6 → Red
GP7 → Green
2kHz, 10-bit resolutionKey Features
1. Radar Presence Detection (RD03D)
Unlike a simple PIR, this detects stationary occupants — someone sitting still or standing quietly. Up to 3 targets are tracked simultaneously, with X/Y coordinates, speed, and distance per target.
Frame Format
AA FF 03 00 | [Target 1: 8 bytes] [Target 2: 8 bytes] [Target 3: 8 bytes] | 55 CC
(header 4B) (payload 24B) (tail 2B)Confidence-Based Filter (rd03d_api.c)
To avoid flickering, a confidence score is accumulated per track:
// Confidence increases on each detection
uint16_t c = (uint16_t)tr->confidence + s_cfg.conf_inc; // +35
tr->confidence = (c > 255u) ? 255u : (uint8_t)c;
// Confidence decays when not detected
if (tr->confidence > s_cfg.conf_dec)
tr->confidence -= s_cfg.conf_dec; // -15
// Presence: ON threshold = 120, OFF threshold = 60 (hysteresis)
s_state.presence = (confidence >= conf_on);Default parameters:
rd03d_filter_cfg_t def = {
.max_match_dist_mm = 600, // max jump between frames
.conf_inc = 35, // confidence gain per detection
.conf_dec = 15, // confidence loss per miss
.conf_on = 120, // presence ON threshold
.conf_off = 60, // presence OFF threshold (hysteresis)
.stale_ms = 1500, // invalidate track after 1.5s without detection
};2. RGBW PWM Lighting Control
Gamma Correction LUT
The human eye responds to brightness non-linearly. A 512-entry LUT converts 10-bit linear input into gamma 2.2 corrected PWM output, processed as: linear input → gamma LUT (×2.2) → PWM output. This ensures natural-looking dimming even at low brightness levels.
Fade Engine
Smooth transitions are handled using linear interpolation based on absolute_time_t — no hardware timer needed. Simply calling pwm_api_poll() from the main loop is all it takes.
3. Ethernet Remote Control (W6100)
Telnet CLI
Connect via TCP port 5000 for real-time control:
$ nc 192.168.14.228 5000
$ telnet 192.168.14.228 5000Supported commands:
rgbw <r> <g> <b> <w> → Set RGBW immediately (0~1023)
led <w> → Set white channel only
fade <r> <g> <b> <w> <ms> → Fade transition
freq <hz> → Change PWM frequency (50~20000)
pwm status → Show current state
config ip <a.b.c.d> → Set IP address
config save → Save to flashExample:
> fade 0 0 0 800 3000
Fade set to 0 0 0 800
> pwm status
PWM Status:
Current RGBW: 0 0 0 800
Target RGBW: 0 0 0 800
Brightness : 1023
Fading : NoDDP (UDP Streaming)
DDP protocol is supported on port 4048. Lighting software like Jinx! or xLights can stream data directly to this controller. Three formats are supported: 8-bit RGBW, 8-bit RGB, and 16-bit LE per channel.
Flash Partition Layout
An A/B partition scheme supports OTA (over-the-air) firmware updates. Once installed, firmware can be updated over the network without physical access.
Flash (2MB)
┌─────────────────┐
│ Main A (1MB) │ ← currently running partition
├─────────────────┤
│ Main B (1MB) │ ← OTA receive partition (alternates)
├─────────────────┤
│ Config (32KB) │ ← IP and settings (CRC32 verified)
└─────────────────┘Settings are CRC32-verified on load and automatically fall back to defaults on mismatch.
Where Can This Be Used?
Direct Applications
- Kitchen, bathroom, hallway: Auto lighting for hands-free environments
- Warehouse, office: Occupancy-based energy saving
- Exhibition spaces: Automated lighting scenes via DDP streaming
Scalability
This isn't just a one-off demo.
- More channels: Add PWM slices for additional outputs
- Sensor swap: Add VL53L8CX ToF for precision zone-based control
- Protocol expansion: Add HTTP/MQTT for Home Assistant or Node-RED integration
- ODM/OEM ready: RP2350 + W6100 is cost-effective and straightforward to move to a production PCB
Why W6100 Matters Here
The W6100 isn't just a communication chip in this design. It acts as the hub that ties sensor data, lighting control, and configuration together over the network. Its hardware TCP/IP stack keeps the connection stable without burdening the MCU.
What's Next
- Full VL53L8CX ToF integration (zone-based distance → automated lighting patterns)
- MQTT support (Home Assistant, Node-RED)
- Web UI (browser-based control over HTTP)
GitHub Repository: https://github.com/Jaremekgw/proj_w6100_rp2350

