Skip to the content
2 layers61.5 × 57 mmARviewer, the printed circuit board in 3D

If you stumble across this project feel free to use it for educational purposes. If you find errors or have questions about the circuit design or code feel free to reach out.

Size
61.5 × 57 mm
Copper layers
2
Thickness
1.6 mm
Parts
61
Nets
110
Pads
305
Tracks, vias
460, 54
Pours
1
Routed
Yes
KiCad
KiCad 9.0 (file 20241229)
Created
4 Dec 2025
Updated
6 May 2026

Overview

ARviewer is an open-source printed circuit board by mcbearfish, from the mcbearfish/Mini-3D-Window-Viewer repository on GitHub. It is a 2-layer board of 61.5 × 57 mm with 61 parts on 110 nets, routed with 460 tracks and 54 vias.

It is built around the STM32F429VIT6 and USBLC6-2SC6. Its parts include 25 capacitors, 15 resistors, 6 diodes, 4 connectors and 3 ICs. It belongs with the STM32 boards of this library.

Main components

2

README

README.md

3D Window Project

About

This is a developmental project intended to refresh my skills on designing and programming an STM32 microcontroller board. I chose a project scope that I believed would provide difficult circuit and programming challenges. I will document the development process in this README.

If you stumble across this project feel free to use it for educational purposes. If you find errors or have questions about the circuit design or code feel free to reach out. Please cite this repository as a source if you plan to use it.

Table of Contents

Project Description

This project is the 3D Window Viewer.

When placed on a flat surface, the device on startup will create a window into a 3D scene of a hammer (Boiler Up and Hail Purdue!). After startup, tilting and rotating the device updates the view of a 3D hammer while the virtual position remains anchored.

This project uses I2C accelerometer, gyroscope, and magnetometer sensors to estimate device orientation in C. The original goal was IMU-only position tracking, but drift made that impractical, so I redesigned the demo around constrained motion.

I designed my own custom STM32 development board and sensor board using KiCad Schematic and PCB Design Software.

Demo Video

Everything Is AWESOME

Hardware / Software Used

  • STM32 microcontroller
  • Custom STM32 main PCB
  • Custom sensor PCB
  • Accelerometer, gyroscope, and magnetometer over I2C
  • LCD display
  • KiCad for schematic and PCB design
  • CLion IDE
  • C firmware

Circuit Design

STM32 Circuit

image
This STM32 chip was chosen for its large number of GPIO pins and processing capabilities.

Button

image
Simple button circuit to test user inputs.

LEDs

image
Used for initial testing and debugging.

Crystal Oscillator

image
Provides a highly stable, accurate, and precise frequency reference.

USB-C Connector

image
Provides power to the board.

Boot Switch

image
Reset switch.

Mounting Holes

image
Grounded pads to use for mounting and probe testing.

Pin Connectors

image

Buck Converter

image
Chosen to smooth 5V to 3.3V for STM32 chip and sensors.

Accelerometer and Gyroscope

image
Chosen to estimate device orientation and motion. IMU-only position tracking was tested, but drift made it impractical for this version.

Magnetometer

image
Chosen to improve heading estimation and help correct gyro drift over time.

Pin Connector

image

Mounting Holes

image

Notes

I found Google's Gemini AI tool to be extremely helpful during this design process. Especially with mapping the pinout of the display to STM32. I used a cheap knockoff with no documentation and poor pinout labels. In the future may need to remap pins if display fails to work. See ARSensors project for second Board meant to connect sensors to this main board.

Manufacturing files can be found for each board in this repository.

Main PCB

image

image

image

image

Sensors PCB

image

image

image

image

Design Process

Designing my first board in almost 4 years was a great experience. In the workspace I have been living in a more software heavy environment. I found this project to be a great refresher of my skills.

I found the initial research phase to be quite enjoyable and straightforward. I easily identified the types of sensors, display, and STM32 chip I thought would be capable for the performance I wanted. Now that I identified the key components it was time to begin creating the schematic.

I quickly realized this was a larger challenge than my senior design project. Although I took a significant part in the circuit design, I realized how beneficial it was having a team of 4 people in multiple disciplines. The components I selected for this project were much more sophisticated than what was chosen for the senior design project. I was honestly a little overwhelmed at the start. I had to take my time and started to break components down. I started with the most important part, the STM32 chip.

For the STM32 I first connected any power related pins and decoupling capacitors. Then I used the STM32CubeMX tool to assign pinouts. I knew between the display and other peripherals I needed a lot of pins, so I started by making sure the chip was capable of supporting them all. Once I verified the chip was capable I began connecting components. The most critical was the USB-C connector, which flashes code onto the chip. The USB-C will also provide power to the whole system. I spent quite a bit of time researching possible power designs. The USB-C provides 5V and I need 3.3V for the STM32 and sensors. I eventually decided on a synchronous buck converter because it would provide an efficient and stable step down from 5V to 3.3V. The display needs 5V, so I decided on a simple low-pass filter because it would provide a clean signal and I have experience with designing those on circuit boards in the past.

Next I added the sensors. I found the datasheets to be extremely helpful. The design process was made much easier by following the typical application circuits that they detailed. Then I added the display, button, and some LEDs. The extra LEDs and button will be useful at the start of programming to make sure the board can properly run code and debug. Lastly I added a connector for debug pins.

Now that I had a schematic to follow I moved onto the PCB layout. This portion was much more difficult than expected. It was at this point I had to take into account physical and cost restrictions. JLCPCB was my choice of board manufacturer. To minimize costs I decided on a 2 layer board, which gave me a lot of physical trace constraints. Also, since the sensors are a bit costly, I decided to move them to a second circuit board to save on future costs. With these new challenges I had to go back to my schematic and STM32CubeMX. Unfortunately I was not able to place my STM32 pinouts more conveniently to minimize trace crossovers. At this point I decided to go with a more generic pin layout that I can wire with some 2.54mm connectors to minimize my trace lengths and crossovers. In the future I will look at more layered boards or other STM32 chips as potential solutions.

To minimize costs on JLCPCB I tried to identify basic parts in the JLCPCB library. Not all parts selected were in that and drove up the cost (~$3 per part not in the basic library). In the future I will place more emphasis on this to lower my costs.

Major credit to Phil's Lab PCB Design video: https://www.youtube.com/watch?v=aVUqaB0IMh4. This was a great refresher on circuit board design and I highly recommend his channel.

Soldering and Assembly

When ordering the board I decided that to save on costs to I would hand solder some of the components. This involved things the STM32 chip, USB-C connector, asynchronous buck converter, buttons, and pins. I felt this was a great skill refresher. I took it slow and steady. I started with easier items like the pins and buttons to get back into the flow of things. The picture below is from right before I went to solder the STM chip.
image

I bought a cheap soldering station and found it pretty useful when adding the smaller components. In the picture below you can see a cheaper soldering iron. I found this ok for the larger components but, I decided it was safer to spend the money and get a proper iron for the delicate items like the USB-C and STM32 chip.
image

Box Design

I bought a simple project box and placed the main board inside the box. I left the sensor board on top along with the display to keep them on the same level. image

Code Design

Initial Project Scope

The initial goal of the project was to use the IMU sensors to track the 3D coordinates of the device so that it could act as a camera. The camera would then be able to view a 3D object fixed in space from all angles and get closer or farther away.

Limitations of IMU Sensors

While prototyping I found that it was not feasible to use the IMU sensors alone for positional tracking. The significant position drift was too much to overcome, even with adjusting bias in the Kalman filter parameters. I also tested the individual sensors to check for noise and bias. Surprisingly, these cheaper sensors performed quite well. The accelerometer did display the most noise. I believe this was due to environmental sensitivities. Testing was performed on my desk and away from any electronics, this however does not guarantee a perfectly still environment.

Since position is calculated by integrating acceleration twice, even with tiny errors, the positional data errors grew massive. The estimated position drifted so quickly that the 3D object would only remain visible for a split second. I determined this was unusable and decided to change scope.

Redesign

I decided to pivot the project and try to get the most out of the current setup. I decided to simulate the camera view of the 3D object where moving and tilting the box changes camera view direction realistically, but position is anchored.

Code Flow

The main program initializes the board, sensors, sensor fusion, and 3D engine before entering the main loop. In the loop, new sensor data is read and passed into the sensor fusion algorithm. This project uses an Extended Kalman Filter, which fuses gyroscope, accelerometer, and magnetometer data into a stable orientation estimate. That orientation estimate is then used to update the rendered 3D object and draw the pose overlay.

text
main()
|
+-- HAL_Init()
+-- SystemClock_Config()
+-- MX_GPIO_Init()
+-- MX_FMC_Init()
+-- I2C_Bus_Reset()
+-- MX_I2C1_Init()
|
+-- Engine3D_Init()
|   \-- GPU_Init()
|
+-- Sensors_Init()
+-- Sensors_ShowStartupCountdown()
+-- Sensors_Calibrate()
+-- Sensors_ShowInstructionScreen()
+-- Sensors_GetReferenceFrame()
+-- EKF_Init()
+-- EKF_SetReference()
|
\-- while (1)
    +-- Sensors_Read()
    +-- EKF_Predict()
    +-- EKF_Update()

Notes on AI Assistance

Portions of the firmware were developed with assistance from AI tools, including OpenAI Codex and Google's Gemini. I used these tools to help generate code structure, debug embedded issues and tune parts of the sensor-fusion pipeline. All AI-assisted code was reviewed, tested, and modified by me before being included in the final project.

I found Codex especially useful for working through embedded C issues and code organization. Gemini was useful during early design exploration, especially for brainstorming and pin-mapping support, but I had to review its output carefully because it sometimes suggested larger code changes than intended.

Final Result

The final device renders a wireframe 3D hammer on the LCD. After startup calibration, tilting or rotating the physical box updates the rendered view in real time. The device uses IMU sensor fusion for orientation estimation while keeping virtual position constrained to avoid IMU drift.

This project was great for refreshing my bare-metal embedded skills. Making a device and writing code that brings it to life is always a joy. The next project should hopefully move faster now that I have regained familiarity with the whole process.

Parts

61
QtyValueFootprintReferences
13100nCapacitor_SMD:C_0402_1005MetricC2, C3, C4, C5, C6, C8, C10, C11, C15, C17, C20, C22, C23
61k5Resistor_SMD:R_0603_1608MetricR4, R5, R6, R8, R9, R15
210uCapacitor_SMD:C_0603_1608MetricC1, C19
2120RInductor_SMD:L_0603_1608MetricFB1, FB2
214pFCapacitor_SMD:C_0402_1005MetricC16, C18
21uCapacitor_SMD:C_0402_1005MetricC13, C14
222uCapacitor_SMD:C_0805_2012MetricC24, C25
22u2Capacitor_SMD:C_0402_1005MetricC7, C9
25k1Resistor_SMD:R_0603_1608MetricR11, R12
2GREENLED_SMD:LED_0603_1608MetricD1, D6
2MountingHole_PadMountingHole:MountingHole_4.3mm_M4_Pad_ViaH1, H2
1100kResistor_SMD:R_0805_2012MetricR1
110kResistor_SMD:R_0805_2012MetricR14
110kResistor_SMD:R_0402_1005MetricR7
110nCapacitor_SMD:C_0402_1005MetricC12
110pCapacitor_SMD:C_0402_1005MetricC21
11kResistor_SMD:R_0603_1608MetricR2
122Resistor_SMD:R_0603_1608MetricR10
125MHzCrystal:Crystal_SMD_3225-4Pin_3.2x2.5mmY1
13.3uInductor_SMD:L_6.3x6.3_H3L1
133k2Resistor_SMD:R_0805_2012MetricR13
1450Resistor_SMD:R_0402_1005MetricR3
1AP62300TWU-7Package_TO_SOT_SMD:TSOT-23-6U2
1BLUELED_SMD:LED_0603_1608MetricD3
1Conn_01x05Connector_PinHeader_2.54mm:PinHeader_1x05_P2.54mm_VerticalJ4
1Conn_01x14Connector_PinHeader_2.54mm:PinHeader_1x14_P2.54mm_VerticalJ1
1Conn_01x19Connector_PinHeader_2.54mm:PinHeader_1x19_P2.54mm_VerticalJ3
1ORANGELED_SMD:LED_0603_1608MetricD2
1REDLED_SMD:LED_0603_1608MetricD5
1STM32F429VIT6Package_QFP:LQFP-100_14x14mm_P0.5mmU1
1SW_PushButton_Switch_THT:SW_PUSH_6mmSW1
1SW_SPDTButton_Switch_SMD:SW_SPDT_PCM12SW2
1USBLC6-2SC6Package_TO_SOT_SMD:SOT-23-6U3
1USB_C_Receptacle_USB2.0_16PConnector_USB:USB_C_Receptacle_GCT_USB4105-xx-A_16P_TopMnt_HorizontalJ2
1YELLOWLED_SMD:LED_0603_1608MetricD4

More from mcbearfish/Mini-3D-Window-Viewer

1
  • 2 layers29 × 30.8 mmARSensors, the printed circuit board in 3D

    ARSensors

    mcbearfish/Mini-3D-Window-Viewer

    If you stumble across this project feel free to use it for educational purposes. If you find errors or have questions about the circuit design or code feel free to reach out.

    12 parts

Similar boards

  • 4 layers16.9 × 119.4 mmOrbit, the printed circuit board in 3D

    Orbit

    earthtojake/text-to-cad

    Design physical products with AI

    182 parts26kMIT
  • 2 layers290.1 × 130 mmPro V2, the printed circuit board in 3D

    Pro V2

    kata0510/Lily58

    6×4+4keys column-staggered split keyboard.

    312 parts2.3k
  • 4 layers95 × 55.5 mmEinkPDA keyboard, the printed circuit board in 3D

    EinkPDA keyboard

    TalismanDesign/PocketMage_PDA

    An E-Ink PDA device using the ESP32 S3.

    137 parts2kApache-2.0
  • 4 layers299 × 127 mmLaunch, the printed circuit board in 3D

    Launch

    system76/launch

    System76 Launch Configurable Keyboard

    385 parts1.4kGPL-3.0
  • 2 layers42 × 67 mmLalboard, the printed circuit board in 3D

    Lalboard

    JesusFreke/lalboard

    A 3D-printed keyboard inspired by the DataHand

    65 parts993
  • 2 layers134 × 88 mmTulipcc, the printed circuit board in 3D

    Tulipcc

    shorepine/tulipcc

    The Tulip Creative Computer and AMYboard - portable Python synthesizers

    103 parts978
  • 4 layers70.8 × 108 mmCastor and Pollux, the printed circuit board in 3D

    Castor and Pollux

    wntrblm/Castor_and_Pollux

    A Juno-inspired dual oscillator

    235 parts587
  • 4 layers28.2 × 26.1 mmDongleHiderPlus PCB, the printed circuit board in 3D

    DongleHiderPlus PCB

    LeoDJ/FW-EC-DongleHiderPlus

    Framework Expansion Card that includes a USB hub to hide a bare dongle inside and still have a USB-A port externally

    23 parts497CERN-OHL-W-2.0

Questions

How big is the ARviewer PCB?

It measures 61.5 × 57 mm and has 2 copper layers, 1.6 mm thick.

What parts does the ARviewer use?

61 parts, built around the STM32F429VIT6 and USBLC6-2SC6. 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 ARviewer KiCad files?

From the mcbearfish/Mini-3D-Window-Viewer repository on GitHub, at the commit this page was made from: the board is ARviewer/ARviewer.kicad_pcb and its schematic ARSensors/ARSensors.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the ARviewer design in my own project?

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