

MPU6050.kicad pcbFINAL
Raspberry Pi Pico Dual-Core PCB Hat with MPU-6050 and WS2812B LED Strip
- Size
- 40.1 × 64.4 mm
- Copper layers
- 2
- Thickness
- 1.6 mm
- Parts
- 9
- Nets
- 80
- Pads
- 123
- Tracks, vias
- 162, 11
- Pours
- 1
- Routed
- Yes
- KiCad
- KiCad 9.0 (file 20241229)
- Created
- 19 Nov 2025
- Updated
- 20 Nov 2025
Overview
MPU6050.kicad pcbFINAL is an open-source printed circuit board by varolkan, from the varolkan/Yens-Yens-internship-assignment repository on GitHub, published under the MIT licence. It is a 2-layer board of 40.1 × 64.4 mm with 9 parts on 80 nets, routed with 162 tracks and 11 vias.
It is built around the MPU-6050. Its parts include 4 capacitors, 2 resistors, 1 IC and 1 connector. It belongs with the RP2040 boards of this library.
Main components
1README
README.mdMotion-Driven Light System
Raspberry Pi Pico Dual-Core PCB Hat with MPU-6050 and WS2812B LED Strip
Project Overview
Motion-Driven Light is a dual-core embedded system for the Raspberry Pi Pico featuring:
- Real-time motion sensing via MPU-6050 6-axis accelerometer/gyroscope module
- Physics-based water flow LED animation with smooth gradient falloff on WS2812B addressable RGB LED strip
- Custom PCB Hat design with complete KiCad project files and production-ready Gerber manufacturing outputs
- Hardware-agnostic robustness: Automatic simulation mode when sensor is not detected, enabling code testing without physical hardware
- Dual-core architecture: Core 0 handles sensor I/O and data acquisition, Core 1 manages LED rendering and real-time serial visualization
Technical Assignment for: Yens & Yens
Author: M. Salih BEKTUR
Testing Without Hardware (Simulation Mode)
This project includes automatic robustness for testing without physical hardware.
Quick Start (No Sensor Required)
- Flash the code to any Raspberry Pi Pico (even without MPU-6050 connected)
- Open Serial Monitor at 115200 baud
- System auto-detects missing sensor and engages SIMULATION MODE
- Watch the animation: A smooth sine wave generates virtual tilt data (-45° to +45°)
Expected Output
The system will output real-time ASCII visualization showing the liquid moving:
STATUS: SIM | TILT: 37.6 | WATER: [~~~~~~~~~~~~~~~~~|O~~~]
STATUS: SIM | TILT: 44.6 | WATER: [~~~~~~~~~~~~~~~~~|~~~O]
STATUS: SIM | TILT: 37.2 | WATER: [~~~~~~~~~~~~~~~~~|O~~~]
STATUS: SIM | TILT: 28.4 | WATER: [~~~~~~~~~~~~~~~~O|~~~~]
STATUS: SIM | TILT: -0.9 | WATER: [~~~~~~~~O~~~~~~~~|~~~~]
STATUS: SIM | TILT: -10.5 | WATER: [~~~~~~O~~~~~~~~~~|~~~~]
STATUS: SIM | TILT: -20.0 | WATER: [~~~~O~~~~~~~~~~~~|~~~~]
STATUS: SIM | TILT: -29.1 | WATER: [~~~O~~~~~~~~~~~~~|~~~~]
STATUS: SIM | TILT: -38.0 | WATER: [~O~~~~~~~~~~~~~~~~~~~~]Legend:
- O = Current bubble position (liquid center)
- ~ = Water surface
- | = Center reference marker (0° tilt)
- Status shows SIMULATED or LIVE depending on sensor detection
With Real Hardware
When MPU-6050 is connected:
- System automatically detects sensor at boot
- Display changes to STATUS: LIVE
- Tilt the board left/right to control the LED liquid
- LED color shifts: Blue (flat) to Purple (left) to Cyan (right)
Architecture: Dual-Core Design
The Raspberry Pi Pico's RP2040 chip features two ARM Cortex-M0+ cores. This project leverages both for parallel task execution:
Core 0: Sensor Data Acquisition
File: setup() and loop() functions
- Initializes I2C communication (GPIO4=SDA, GPIO5=SCL)
- Continuously polls MPU-6050 for 6-axis motion data (50 Hz)
- Calculates roll angle (tilt) from accelerometer readings and stores it in sharedAngle
- Fallback Logic: If sensor fails, generates smooth sine wave simulation
- Updates shared variable sharedAngle (thread-safe volatile)
Core 1: Visual Output and Rendering
File: setup1() and loop1() functions
- Initializes WS2812B LED strip (GPIO15, 10 LEDs)
- Reads sharedAngle and maps to LED position (0-9)
- LED Physics Animation:
- Water blob centered at tilt position
- Smooth gradient falloff using Gaussian distribution
- Dynamic color shifting based on tilt direction
- ASCII Serial Output: Real-time visualization at 20 FPS
- Rendering rate: ~8ms per frame (125Hz refresh)
Thread Safety
- volatile float sharedAngle ensures atomic reads/writes between cores
- volatile bool sensorConnected indicates sensor status
- No mutex required due to single-variable communication pattern
Hardware Configuration
Pin Mapping (Custom PCB Hat)
| Component | GPIO | Function | PCB Connector |
|---|---|---|---|
| MPU-6050 SDA | GPIO4 | I2C Data | J2 Pin 1 |
| MPU-6050 SCL | GPIO5 | I2C Clock | J2 Pin 2 |
| WS2812B Data In | GPIO15 | LED Strip Control | J2 Pin 3 |
| Power (5V) | VBUS | LED Strip Power | J2 Pin 4 |
| Ground | GND | Common Ground | J2 Pin 5 |
Bill of Materials (PCB)
- Microcontroller: Raspberry Pi Pico (RP2040)
- Sensor: MPU-6050 6-DOF IMU Module
- LEDs: WS2812B Addressable RGB Strip (10 LEDs minimum)
- PCB: Custom 2-layer board (see Final PCB Files/)
- Connectors: JST headers for modular connections
Installation and Setup
1. Software Requirements
- Arduino IDE (v1.8.19+ or v2.x)
- Board Support: Raspberry Pi Pico by Earle F. Philhower, III
- Add to Board Manager URL: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
- Libraries (Install via Library Manager):
- Adafruit NeoPixel by Adafruit
- MPU6050 by Electronic Cats
2. Upload Instructions
# 1. Clone this repository
git clone https://github.com/varolkan/Yens-Yens-internship-assignment
cd Yens-Yens-internship-assignment/Yens-Yens-internship-assignment-main
# 2. Open Motion-DrivenLight.ino in Arduino IDE
# 3. Configure Board Settings:
# - Board: "Raspberry Pi Pico"
# - Port: (Select your Pico's COM port)
# - Upload Speed: 921600
# 4. Click Upload (Ctrl+U)
# 5. Open Serial Monitor (Ctrl+Shift+M)
# - Set baud rate: 1152003. Hardware Assembly (Optional)
-
Solder Raspberry Pi Pico to custom PCB
-
Connect MPU-6050 module and WS2812B strip to J2 header (observe polarity)
J2 Header Pinout:
Pin Signal Connects to 1 3V3 MPU-6050 VCC 2 GND MPU-6050 GND, WS2812B GND 3 SDA (I2C) MPU-6050 SDA 4 SCL (I2C) MPU-6050 SCL 5 5V WS2812B VCC 6 GPIO (LED Data) WS2812B DIN Double-check your PCB silkscreen and schematic for exact pin order and orientation.
-
Power via USB-C on Pico
Note: System will auto-detect and run in simulation mode without sensor.
PCB Design Files
Included Resources
| Folder | Contents | Purpose |
|---|---|---|
| Final PCB Files/ | KiCad project files (.kicad_pcb, .kicad_sch, .kicad_pro) | Source design files |
| Final GERBER FILES/ | Manufacturing outputs (.gbr, .drl, .gbrjob) | Send to PCB fabricator |
Manufacturing Specifications
- Layers: 2 (Top + Bottom copper)
- Dimensions: Matches Raspberry Pi Pico footprint
- Thickness: 1.6mm standard FR-4
- Minimum Trace/Space: 0.15mm / 0.15mm
- Finish: HASL or ENIG recommended
Ready to Order: Upload the entire Final GERBER FILES/ folder to JLCPCB, PCBWay, or similar service.
Testing and Validation
Functional Tests
-
Sensor Detection Test
- Boot with/without MPU-6050 connected
- Verify correct mode displayed in serial output
-
Simulation Mode Test
- Boot without sensor
- Confirm smooth sine wave animation (no crashes)
-
Live Mode Test
- Connect MPU-6050 to I2C pins
- Tilt board and verify LED responds to physical motion
- Check color transitions (Blue to Purple/Cyan)
-
Serial Visualization Test
- Monitor ASCII output for proper formatting
- Verify 'O' marker moves across 25-character width
Expected Serial Output Format
=== BOOTING SYSTEM ===
Core 0: Initializing Sensor... [FAILED]
WARNING: Sensor missing. Switching to ROBUSTNESS MODE (Simulation).
STATUS: SIM | TILT: 00.0 | WATER: [~~~~~~~~~~~~O~~~~~~~~~~~~|]Test Results
The code has been validated 3 times using comprehensive test suite covering:
- Simulation mode functionality (no hardware required)
- Live sensor mode with Kalman filtering
- Physics engine stability at all angles
- Boundary conditions and edge cases
- ASCII visualization rendering
All tests passed successfully. See TEST_RESULTS.md for detailed test results and COMPATIBILITY_TEST.md for platform compatibility analysis.
Key Features
Technical Highlights
- Zero-Configuration Robustness: Works immediately on any Pico board
- Professional PCB Design: Production-ready Gerber files included
- Efficient Dual-Core Usage: Sensor I/O never blocks LED rendering
- Smooth Physics Animation: Sub-pixel interpolation for fluid motion
- Low Latency: 20ms sensor polling, 60ms render cycle
- Universal Compatibility: Standard Arduino libraries, no custom dependencies
Customization Options
Modify these constants in Motion-DrivenLight.ino:
#define NUM_LEDS 10 // LED strip length (1-100)
#define ASCII_WIDTH 25 // Serial monitor widthNote: Brightness is set via strip.setBrightness(255) in the code.
Code Structure
The implementation consists of the following key components:
Main Arduino File: Motion-DrivenLight.ino
- KalmanFilter class: Advanced sensor fusion to remove jitter from MPU-6050
- Core 0 functions (setup/loop): Sensor acquisition and simulation
- Core 1 functions (setup1/loop1): Physics engine and rendering
- Verlet Integration: Physics-based motion simulation
- Gamma Correction: CIE 1931 lookup table for linear brightness perception
Physics Constants
- GRAVITY: 0.55 (controls liquid responsiveness)
- DRAG_COEFF: 0.04 (air resistance simulation)
- ELASTICITY: 0.50 (bounce behavior at boundaries)
- BLOB_WIDTH: 1.8 (Gaussian sigma for smooth LED glow)
Documentation
- Code Comments: Inline documentation throughout source
- Pin Diagram: See Hardware Configuration section above
- Schematic: Available in Final PCB Files/MPU6050.kicad_schFINAL.kicad_sch
- Compatibility Analysis: See COMPATIBILITY_TEST.md
License
This project is open-source under the MIT License. See LICENSE file for details.
Acknowledgments
Libraries Used:
- Adafruit NeoPixel Library
- MPU6050 Library by Electronic Cats (based on Jeff Rowberg's I2Cdevlib)
Board Support: Raspberry Pi Pico Arduino Core by Earle F. Philhower, III
Assignment: Yens & Yens Technical Test
Contact
Author: M. Salih BEKTUR
Repository: https://github.com/varolkan/Yens-Yens-internship-assignment
For questions regarding this technical assignment submission, please open an issue in the repository.
Parts
9| Qty | Value | Footprint | References |
|---|---|---|---|
| 2 | 0.1µF | Capacitor_SMD:C_0402_1005Metric | C1, C2 |
| 2 | 4.7k | Resistor_SMD:R_0402_1005Metric | R1, R2 |
| 1 | 10nF | Capacitor_SMD:C_0402_1005Metric | C4 |
| 1 | 2.2nF | Capacitor_SMD:C_0402_1005Metric | C3 |
| 1 | Conn_01x03_Pin | Connector:FanPinHeader_1x03_P2.54mm_Vertical | J2 |
| 1 | MPU-6050 | Sensor_Motion:InvenSense_QFN-24_4x4mm_P0.5mm | U1 |
| 1 | RaspberryPi_Pico | Module:RaspberryPi_Pico_Common_Unspecified | A1 |
Similar boards
- 2 layers23 × 120 mm

- 4 layers95 × 50 mm

Control board
ZhuYanzhen1/MM32_CLion
本项目是全国大学生智能车竞赛GDUT 2022年极速越野组的项目文件。采用了LQR控制器和多速率卡尔曼融合算法,并在单片机上实现。This project is the project document for the GDUT 2022 Extreme Off-Road Category of the National Student Intelligent Vehicle Competition.
129 parts58AGPL-3.0 - 2 layers50 × 66 mm

- 2 layers36 × 43 mm

Asac fc rev a
victorhook/asac-fc
asac fc is an rp2040 based flight controller made for FPV drone flying
119 parts52GPL-3.0 - 4 layers305 × 208.3 mm

- 2 layers98.5 × 17.8 mm

- 2 layers36.2 × 36.2 mm

- 2 layers26 × 21.3 mm

PModBoard
pms67/PModlet
PMOD PCB with USB-to-UART converter and IMU (MPU-6050, I2C) for FPGAs.
19 parts15MIT
Questions
How big is the MPU6050.kicad pcbFINAL PCB?
It measures 40.1 × 64.4 mm and has 2 copper layers, 1.6 mm thick.
What parts does the MPU6050.kicad pcbFINAL use?
9 parts, built around the MPU-6050. 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 MPU6050.kicad pcbFINAL KiCad files?
From the varolkan/Yens-Yens-internship-assignment repository on GitHub, at the commit this page was made from: the board is Final PCB Files/MPU6050.kicad_pcbFINAL.kicad_pcb and its schematic Final PCB Files/MPU6050.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Can I use the MPU6050.kicad pcbFINAL design in my own project?
Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).