Skip to the content
2 layers86.5 × 65.3 mmRccarcontrol, the printed circuit board in 3D

Lighting controller for a large-scale RC truck. An RP2040 board sits between the FlySky receiver and a MFC-03 multi-function unit, reads the receiver's iBUS stream directly, and drives the vehicle's LED lighting from it…

Size
86.5 × 65.3 mm
Copper layers
2
Thickness
1.6 mm
Parts
117
Nets
120
Pads
379
Tracks, vias
817, 69
Pours
7
Routed
Yes
KiCad
KiCad 9.0 (file 20241229)
Created
26 Jul 2026
Updated
31 Aug 2026

Overview

Rccarcontrol is an open-source printed circuit board by luckymuniza, from the luckymuniza/RC_lights_control_MFC-03 repository on GitHub. It is a 2-layer board of 86.5 × 65.3 mm with 117 parts on 120 nets, routed with 817 tracks and 69 vias.

It is built around the IRLML0030, 1N5819WS and MM3Z10. Its parts include 38 resistors, 30 connectors, 23 transistors, 9 ICs and 4 diodes. It belongs with the RP2040 boards of this library.

Main components

3

README

README.md

RC Car Lights Control

Lighting controller for a large-scale RC truck. An RP2040 board sits between the FlySky receiver and a MFC-03 multi-function unit, reads the receiver's iBUS stream directly, and drives the vehicle's LED lighting from it — while still letting the MFC-03 keep control of the things it does best (sound, engine start-up sequence, turn-signal timing, brake detection).

The MCU is both a consumer of the MFC-03 (it watches the MFC's own light and turn-signal outputs) and a producer for it (it synthesises a servo signal into the MFC's light channel so the MFC's internal "lights on" state stays in sync).

text
FlySky FS-i6X  ──2.4GHz──►  FS-iA6B RX ──┬── iBUS (UART, 115200) ──► RP2040 ──► LED outputs
                                          │                            ▲  │
                                          └── (channels) ──► MFC-03 ───┘  │
                                                                ▲          │
                                                                └──────────┘
                                                            synthesised servo signal

Repository layout

PathContents
FW/Firmware — C, Raspberry Pi Pico SDK ≥ 2.1.0
HW/rccarcontrol/KiCad 9 project: schematic, PCB, gerbers, DRC report
doc/MFC-03 manual, FS-i6X manual, output mapping spreadsheet, wiring manual
sim/Multisim analog simulation (Design1.ms14)

Hardware

The board is built around a USB-C RP2040 "Pico C" module (HW/.../rccarcontrol.kicad_sch, symbol Pico_type_c). Note this is not pin-compatible with a genuine Raspberry Pi Pico: the module breaks out GPIO29 on pad 35 and GPIO23 on pad 37, where a stock Pico has ADC_VREF and 3V3_EN. The firmware drives both of those pins, so it will not run correctly on a stock Pico without remapping FRONT_RAMP_LIGHT_OUT_PIN and TURN_R_FRONT_OUT_PIN.

Interfacing:

  • Inputs from the MFC-03 go through EL3H7 optocouplers (U2–U8), so they are active-low and the firmware enables internal pull-ups on all of them.
  • Outputs drive IRLML0030 N-MOSFETs. Solder jumpers JP3–JP7 select +7V2_LED or +5V_LED per LED group; JP1/JP2 bring the receiver / external supply onto +5V.
  • Reverse light (REVERSE_LIGHT_IN, opto U1) is wired straight to Q1/Q2 in hardware and never reaches the MCU — there is intentionally no firmware for it.

Pin map

Verified against the PCB netlist. "Pad" is the module pad number.

Outputs

GPIOPadNetFirmwareType
01LED_POWERlights.cdigital — master LED supply gate
12LOW_BEAM_OUTlights.cdigital
24HIGH_BEAM_OUTlights.cdigital
35FOG_LIGHT_OUTlights.cdigital
46AUX_1_OUTaux1.cPWM slice 2A, 50 Hz servo, inverted polarity
57AUX_2_OUTmain.cdigital — toggled every loop pass (loop-rate test point)
69TURN_R_PWM_OUTturn_light.cPWM slice 3A, 2 kHz
710TURN_L_PWM_OUTturn_light.cPWM slice 3B, 2 kHz
811TURN_L_FRONT_OUTturn_light.cdigital — short front-indicator pulse
912SEARCH_LIGHT_OUTlights.cdigital
1014REAR_LIGHT_PWM_OUTrear_light.cPWM slice 5A, 500 Hz
1115SIDE_LIGHT_1_OUTlights.cdigital
1216SIDE_LIGHT_2_OUTlights.cdigital
1317RX_PWM_OUTto_mfc.cPWM slice 6B, 50 Hz servo → MFC light channel
1419BEACON_SMALL_PWM_OUTbeacons.cPWM slice 7A, 50 Hz servo
1520BEACON_BIG_PWM_OUTbeacons.cPWM slice 7B, 50 Hz servo
2337TURN_R_FRONT_OUTturn_light.cdigital
25—on-board LEDmain.cboot-blink only
2732DAY_LIGHT_OUTlights.cdigital — on permanently after init
2834POSITION_LIGHT_OUTlights.cdigital
2935FRONT_RAMP_OUTlights.cdigital

Inputs (all pulled up, active low)

GPIOPadNetFirmwarePurpose
1621TURN_R_INturn_light.cMFC right indicator
1722LIGHT_0_INlights.cconfigured, not read
1824LIGHT_1_INlights.cMFC light state + start-up flash pattern
1925LIGHT_2_INlights.cconfigured, not read
2026LIGHT_3_INlights.cconfigured, not read
2127RX_SBUS_INibus.cUART1 RX — iBUS, 115200 8N1
2229TURN_L_INturn_light.cMFC left indicator
2631REAR_BRAKE_INrear_light.cADC0 — MFC rear/brake light level

Transmitter channel map

From FW/ibus.h (ibus_channel), 1-based as shown on the FS-i6X:

ChNameUsed by
1Steering— (passes to MFC directly)
2MFC light channelto_mfc.c, aux1.c
3Throttle—
4Throttle X—
5Mode switchaux1.c
6Beacon switchbeacons.c
7Gear switch—
8Light switchlights.c
9 / 10Pot A / Pot B—

Channels 1, 3, 4, 7 and the pots are declared but not consumed by the firmware.

Firmware

Structure

Cooperative, non-blocking super-loop. Every module exposes *_init() (called once) and *_service() (called every pass, returns immediately). No RTOS, no blocking delays after start-up, no dynamic allocation. All timing uses time_us_32() deadlines compared as signed differences, so 32-bit wrap is handled correctly.

ModuleResponsibility
main.cBoot blink, init order, super-loop
ibus.ciBUS frame decoding — the only interrupt-driven part
lights.cLight-state machine, side lights, MFC light-state sync, start-up flash replay
turn_light.cIndicator soft fade-in / fade-out driven by MFC edges
rear_light.cTail / brake light PWM, ADC brake detection
beacons.cRotating beacons, fog + search light, beacon configuration mode
to_mfc.cSynthesised servo output back into the MFC light channel
aux1.cDiverts the light channel to an auxiliary servo output (crane)
switch.hShared 3-position-switch state machine constants

iBUS decoder

ibus.c decodes the standard 32-byte FlySky iBUS servo frame:

text
0x20 0x40 <14 × uint16 LE channel values> <uint16 LE checksum>

The checksum is validated by summing all 32 bytes and requiring 0xFFFF. Frame synchronisation is done by inter-byte gap, not by header alone: a byte arriving more than SBUS_NEXT_FRAME_TIMEGAP (3 ms) after the previous one is treated as a frame start. Frames arrive roughly every 7 ms and each takes ~2.7 ms, so the gap is unambiguous.

The ISR writes into channel_data; ibus_service() copies it to channel_data_saved with interrupts disabled, and ibus_get_channel() reads only the snapshot.

Light state machine (lights.c)

Channel 8 acts as a momentary 3-position switch. Short pull up steps forward, holding up for >1 s steps back:

text
OFF ──► POSITION ──► LOW_BEAM ──► HIGH_BEAM ──► RAMP
    ◄──          ◄──          ◄──           ◄──          (hold >1 s)

Pushing down flashes the front ramp light for as long as it is held.

Side lights (SIDE_LIGHT_1/2) have their own state: off, on with the position lights, a double-flash alternating beacon pattern (when the rotating beacons are on), or a slow 0.5 s blink to indicate beacon-configuration mode.

MFC light-state sync

The MFC-03 beeps when the engine is switched off with its lights still on, so its internal state must track the real one. update_lights_in_mfc() compares l_state against LIGHT_1_IN and, when they disagree, asks to_mfc.c to emit one 100 ms pulse train on the synthesised light channel — the equivalent of one stick flick. It repeats every 0.5 s until the states match.

Start-up flash replay

On engine start the MFC-03 flashes its light output rapidly. detect_starting_seq() detects this (edges closer than 25 ms apart), records the on/off durations into a 64-entry ring buffer — duration in bits 0–14, level in bit 15 — and replays them onto LED_POWER so the real headlights flicker in step with the MFC's simulated start-up. While the replay is active, MFC light-state sync is suspended.

Turn signals

The MFC drives the blink timing; the firmware only reshapes it. On each falling edge of TURN_L_IN / TURN_R_IN it pulses the front indicator hard for 100 ms and simultaneously ramps the PWM channel up (100 counts / 10 ms), holds at full for 100 ms, then ramps down (50 counts / 7.5 ms) — roughly a 600 ms incandescent-style fade. Re-triggering is ignored while a fade is still running.

Rear / brake light

REAR_BRAKE_IN is sampled on ADC0 through a 32-sample moving average. Below REAR_LIGHT_BRAKE_LEVEL the tail light PWM goes to full (brake); otherwise it follows the main light state at 25 % duty, or off.

Beacons

Two servo-protocol beacon outputs, driven as if by a stick:

  • Short pull up — both beacons on, side lights switch to the alternating flash pattern.
  • Hold up >1 s — both off. The small beacon has to be cycled through all four of its internal modes to reach off, which beacon_small_off() does with eight 50 ms pulses.
  • Hold up >5 s — enter configuration mode: big beacon on, side lights blink slowly. In config, short up = next mode, short down = next brightness, hold up >5 s = exit.
  • Short pull down — cycles the rear search light and the fog light. Hold down >1 s turns both off. The fog light only comes on if the main lights are on.

Auxiliary output

When channel 5 is above 1800, aux1.c mirrors the channel-2 value onto AUX_1_OUT (inverted polarity) for a crane servo, and tells to_mfc.c to park the MFC light channel at centre so the MFC ignores it.

Building

Requires the Raspberry Pi Pico SDK 2.1.0 or later, arm-none-eabi-gcc, CMake ≥ 3.12 and picotool.

sh
export PICO_SDK_PATH=/path/to/pico-sdk
cd FW
cmake -B build -DCMAKE_BUILD_TYPE=Debug
cmake --build build

Output is build/car_lighting.uf2 (plus .elf, .bin, .hex, .map). The build prints memory usage and a section size summary.

CMakeLists.txt hardcodes picotool_DIR to a local absolute path; override it with -Dpicotool_DIR=... or edit it if picotool lives elsewhere. stdio over both USB and UART is disabled — GPIO0/GPIO1 are used as light outputs, so UART0 is unavailable. To get printf debugging you must free those pins first.

Flashing

Hold BOOTSEL while plugging the board in and copy the .uf2 to the RPI-RP2 drive.

FW/up.bat automates this on Windows: it pokes the USB CDC port at 1200 baud to force the board into BOOTSEL, finds the RPI-RP2 volume and copies the image. It references helper tools under f:\_Work\_Programing\rpi\ and expects the artefact in cmake-build-debug-system-arm\, so the paths need adjusting for the current build directory before it will work.

Known limitations

  • No receiver failsafe. ibus_get_channel() returns the last valid frame forever. If the link drops, the lighting freezes in its last state and the synthesised MFC channel keeps repeating a stale value.
  • Boot blocks on iBUS. main() spins in while (!ibus_data_valid()) before any outputs are initialised, so with no receiver signal the board never leaves start-up.
  • No watchdog.
  • LIGHT_0_IN, LIGHT_2_IN, LIGHT_3_IN are wired and configured but unused.

Parts

117
QtyValueFootprintReferences
21IRLML0030Package_TO_SOT_SMD:SOT-23-3Q1, Q2, Q10, Q11, Q12, Q13, Q14, Q15, Q16, Q17, Q18, Q19, Q20, Q21, Q22, Q23 +5
1910RResistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolderR13, R19, R20, R21, R22, R23, R24, R25, R26, R27, R28, R29, R30, R31, R32, R34 +3
19Conn_01x02Connector_JST:JST_PH_B2B-PH-K_1x02_P2.00mm_VerticalJ1, J3, J10, J11, J12, J13, J14, J15, J16, J17, J25, J26, J27, J28, J29, J30 +3
1310kResistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolderR1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R14, R15
8EL3H7Package_SO:SOP-4_4.4x2.6mm_P1.27mmU1, U2, U3, U4, U5, U6, U7, U8
5Conn_01x03Connector_JST:JST_PH_B3B-PH-K_1x03_P2.00mm_VerticalJ5, J8, J18, J19, J20
5SolderJumper_3_OpenJumper:SolderJumper-3_P1.3mm_Open_RoundedPad1.0x1.5mm_NumberLabelsJP3, JP4, JP5, JP6, JP7
4MountingHoleMountingHole:MountingHole_2mmH1, H2, H3, H4
356RResistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolderR16, R17, R18
3Conn_01x04Connector_JST:JST_PH_B4B-PH-K_1x04_P2.00mm_VerticalJ4, J21, J22
2180RResistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolderR33, R36
21N5819WSDiode_SMD:D_SOD-123D2, D4
2Conn_01x06Connector_JST:JST_PH_B6B-PH-K_1x06_P2.00mm_VerticalJ23, J24
2MM3Z10Diode_SMD:D_SOD-323FD1, D3
2YJL3407ALPackage_TO_SOT_SMD:SOT-23-3Q4, Q6
1100uCapacitor_SMD:C_1206_3216Metric_Pad1.33x1.80mm_HandSolderC2
175RResistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolderR12
1CCapacitor_SMD:C_1206_3216Metric_Pad1.33x1.80mm_HandSolderC1
1Conn_01x08Connector_JST:JST_PH_B8B-PH-K_1x08_P2.00mm_VerticalJ2
1EX->5VJumper:SolderJumper-2_P1.3mm_Open_RoundedPad1.0x1.5mmJP2
1Pico C_my_RPI_pico:RPi_Pico_type_c_SMD_THU9
1RX->5VJumper:SolderJumper-2_P1.3mm_Open_RoundedPad1.0x1.5mmJP1

Similar boards

  • 4 layers85 × 56 mmBratwurstPower, the printed circuit board in 3D

    BratwurstPower

    Qeteshpony/BratwurstPower

    A power supply for a complete, Raspberry Pi based ADS-B Receiver Setup with independent power rails for the different components.

    143 parts1BSD-2-Clause
  • 6 layers80 × 80 mmEps, the printed circuit board in 3D

    Eps

    OSUSat/cubesat

    Open Source Earth Imaging Satellite Hardware + Firmware

    413 parts8MIT
  • 4 layers358 × 40 mmLongboi, the printed circuit board in 3D

    Longboi

    KungfuPancake/longboi

    Possibly the longest controller board to control the BoxTurtle AFC

    297 parts7Apache-2.0
  • 2 layers22.1 × 18 mmHelena base sd, the printed circuit board in 3D

    Helena base sd

    Reisi/Helena

    Helena is an alternative driver for the Yinding or KD2 Headlight Cycling Lamp.

    59 parts5BSD-2-Clause
  • 4 layers100 × 100 mmPS BPSLeader, the printed circuit board in 3D

    PS BPSLeader

    lhr-solar/PS-BPSLeader

    Reads voltage, temperature, and current of the main battery pack from the Segment Monitoring Board and HV Carrier boards to ensure the battery remains in a safe state.

    388 parts3MIT
  • 2 layers59.1 × 75.7 mmPS MotorControllerInterfacePCB, the printed circuit board in 3D

    PS MotorControllerInterfacePCB

    lhr-solar/PS-MotorControllerInterfacePCB

    Provides power conversion/protection and fan control for the Prohelion WaveSculptor 22 motor controller

    127 parts3
  • 2 layers86.6 × 71.8 mmVehicleControlUnit, the printed circuit board in 3D

    VehicleControlUnit

    lhr-solar/VCAT-VehicleControlUnit

    Vehicle Control Unit (VCU) for the 2026 Longhorn Racing Solar car

    142 parts2MIT
  • 2 layers45 × 72 mmRelay, the printed circuit board in 3D

    Relay

    adarwoo/modbus_relay

    A modbus RTU relay board with 3 relays for the CNC. This uses the ASX framework

    43 parts1

Questions

How big is the Rccarcontrol PCB?

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

What parts does the Rccarcontrol use?

117 parts, built around the IRLML0030, 1N5819WS and MM3Z10. 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 Rccarcontrol KiCad files?

From the luckymuniza/RC_lights_control_MFC-03 repository on GitHub, at the commit this page was made from: the board is HW/rccarcontrol/rccarcontrol.kicad_pcb and its schematic HW/rccarcontrol/rccarcontrol.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Rccarcontrol design in my own project?

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