Custom 4-Layer PCB Powers Reliable ESP32 Pocket Motion Tracker
Key Moment
- 0:00 Introduction & Project Overview
- 1:57 AIVON PCB Sponsorship
- 2:23 BNO085 Motion Sensor Explained
- 3:24 Schematic Design
- 4:26 PCB Layout & 3D View
- 5:00 Ordering the Custom PCB
- 5:24 Assembling the Hardware
- 6:41 Programming & Libraries
- 7:59 Web Dashboard Features
- 8:18 Uploading the Code
- 9:05 Real-Life Testing & Demo
- 10:21 Outro & Resources
Project Background
In the fast-moving world of wearable IoT and personal fitness devices, makers and engineers increasingly demand compact, battery-powered boards that deliver accurate real-time motion data without sacrificing reliability. The project featured in this video starts from a clear need: transform an ESP32-S3 and a high-performance 9-axis IMU into a complete, self-contained activity tracker that measures steps, cadence, distance, calories, active time, motion intensity, and full roll-pitch-yaw orientation. The finished device must fit in a pocket, run from a single Li-ion cell, display live data on a crisp OLED, and stream metrics to a responsive web dashboard over Wi-Fi.
Market pressure for such devices is high. Consumers and developers expect polished prototypes that survive outdoor walking tests, maintain sensor accuracy despite battery voltage swings, and avoid the classic noise and power-integrity problems that plague dense single-sided layouts. Two-layer boards often fall short when continuous sensor fusion and RF sections share the same limited copper real estate. That is why the creator chose a deliberate 4-layer design with a solid internal ground plane and partnered with a manufacturer capable of turning a carefully engineered schematic into production-ready boards quickly and cleanly.
What This Video Covers
This video walks through the complete development arc of the custom 4-layer ESP32 activity tracker. Viewers see the system architecture that fuses BNO085-class IMU data with ESP32-S3 processing, the four OLED information pages that provide instant local feedback, and the live web dashboard that visualizes goal progress, active-time percentages, cadence trends, and motion levels. The video examines the power architecture—USB-C charging via BQ24092, regulation through a TPS63020 buck-boost that holds 3.3 V steady across the full battery range, and tidy layout that keeps noise away from the sensitive IMU. It then moves into the PCB stackup and layout decisions that made reliable performance possible, the practical manufacturing challenges that appeared during board fabrication, and the DFM practices that protected first-article quality. Real outdoor pocket tests close the loop, demonstrating that the hardware, firmware, and manufacturing choices work together under actual use conditions.
Project Highlights and Key Features
- Compact single-sided 4-layer FR-4 board with top-signal-and-components, solid L2 ground plane, L3 signal, and bottom signal layers for superior noise performance.
- BNO085-class 9-axis IMU delivering fused linear acceleration, gyroscope, magnetometer, and rotation-vector data that the ESP32-S3 converts into accurate step count, cadence, estimated distance (with separate walking and running step lengths), calorie estimate, motion-level percentage, and activity-mode state machine (STILL / MOVE / WALK / RUN).
- Four dedicated OLED pages: summary with step count, mode, cadence and goal progress bar; distance/calories/active-time/peak-g page; live motion page; and roll-pitch-yaw page complete with sensor accuracy ratings. Single-button navigation (short press for page change, long press for statistics reset).
- Modern responsive web dashboard accessible via the board's IP address once Wi-Fi is joined, featuring live doughnut charts, metric bar charts, and scrolling trend graphs for cadence and motion intensity.
- Robust power path: 3.7 V Li-ion cell, BQ24092 charger, TPS63020 buck-boost regulator that maintains rock-solid 3.3 V from full charge down to near-empty, CP2104 USB programming interface with auto boot/reset, and careful decoupling that keeps switching noise away from the IMU.
- Clean manufacturing details—consistent via treatment, legible silkscreen kept clear of pads, and single-sided component placement—that simplify both hand assembly and future SMT production.
Challenges Encountered During Development
Several classic obstacles surfaced while moving from schematic to a reliable pocket device. Noise on the I²C bus and power rails was the first major concern. Continuous sensor fusion on the BNO080-class IMU is highly sensitive to ground bounce and supply ripple; any disturbance appears as orientation jitter or false step counts. Early layouts that treated ground as a collection of traces rather than a continuous sheet amplified the problem.
Power integrity across the full battery voltage range presented the second challenge. A simple LDO would drop out near the end of discharge. The chosen TPS63020 buck-boost solves the dropout issue but introduces its own switching noise, requiring careful inductor selection, layout, and decoupling so that ripple never reaches the IMU or the ESP32 RF section.
Mechanical and manufacturing practicality formed the third set of hurdles. With every component on one side of a compact outline, silkscreen clearance from pads becomes critical, via tenting must be consistent to prevent solder wicking during HASL, and panel breakaway features must be strong enough to survive handling yet clean enough for final edges. Inconsistent via-tenting notes versus actual Gerber data, or stamp-hole spacing that is too tight, can invite reliability problems or premature panel separation. These are the same issues that appear repeatedly on dense 4-layer IoT boards; catching them early is essential.
How AIVON PCB Helps
AIVON PCB addressed each of these challenges through rapid prototyping, expert DFM review, and disciplined manufacturing execution. The creator ordered the 4-layer boards from AIVON. Within a week a clean package arrived showing excellent registration, solid copper, consistent solder mask, and a ground plane that truly behaved as a continuous sheet. That physical quality allowed the project to move from "works on the bench with flying wires" to "drop it in a pocket and walk outdoors."
AIVON's pre-production DFM process specifically flagged the kinds of risks that commonly appear on compact 4-layer activity-tracker boards: mixed via-tenting instructions that could leave vias open and invite solder wicking, silkscreen placed too close to pads, and inadequate breakaway geometry. Clear communication on full via tenting, silkscreen clearance (≥0.15 mm), and panel features protected yield and long-term reliability. The solid L2 ground plane was preserved without signal cuts under the IMU or RF section, and decoupling capacitors were placed correctly at the ESP32 and BNO085 pins.
The result is a prototype whose sensor data remains clean, whose 3.3 V rail stays stable under real battery discharge, and whose assembly is straightforward because every component lives on one side with clean silkscreen and consistent via treatment. These are exactly the manufacturing advantages that turn an ambitious motion-tracking concept into a polished, pocketable product.
Conclusion
The ESP32 activity tracker demonstrates what becomes possible when thoughtful circuit design meets a properly manufactured 4-layer PCB. A continuous ground plane, careful power integrity, and unambiguous manufacturing notes combine to deliver accurate step and orientation data, stable battery operation, and a device small enough for real outdoor use. The custom boards from AIVON were never merely a carrier—they formed the foundation that made reliable performance achievable.
If you are developing a similar motion-tracking, wearable, or compact IoT product, the path is clear: design with a solid ground plane, keep manufacturing documentation unambiguous, and partner with a factory that reviews the details before production begins. Request a free DFM analysis or start your next rapid-prototyping project with AIVON PCB today and turn your next sketch into a pocket-ready prototype that performs under real conditions. Watch the full build story in the KOL video at https://www.youtube.com/watch?v=-dSfYmXX7oE and explore the complete engineering write-up at From Sketch to Pocket: The Custom 4-Layer PCB That Powered ESP32 Activity Tracker.
FAQ
Q1: Why choose a 4-layer board instead of 2-layer for an ESP32 + BNO080 activity tracker?
A1: A continuous internal ground plane dramatically reduces noise coupling into the IMU and keeps the ESP32 RF section cleaner. For a pocket device that relies on accurate step counting and orientation data, the extra layers are almost always worth the investment.
Q2: How critical is ground-plane integrity under the BNO080-class IMU?
A2: Extremely critical. Any large cuts or long return paths appear as orientation jitter or false steps. Treat L2 as a solid sheet and stitch vias generously around the sensor and power pins.
Q3: What surface finish and via-tenting practices work best for single-sided dense 4-layer boards?
A3: Lead-free HASL or ENIG both perform well. The more important factors are consistent full via tenting that matches the Gerbers and silkscreen kept clear of pads so paste and reflow remain predictable.
Q4: Can the same 4-layer design support both hand assembly and later SMT production?
A4: Yes—provided all components are on one side, footprints are standard, silkscreen and fiducials are clean, and manufacturing notes (especially via tenting) are unambiguous. The AIVON boards in this project already demonstrated that path.
Q5: What is the most common DFM surprise on compact 4-layer IoT boards like this tracker?
A5: Inconsistent via-tenting notes versus Gerber data and silkscreen placed too close to pads. Both are easy to catch in a proper pre-production review and costly if they reach the assembly line.
Hi everyone, it's me Ha from How to Electronics. Today I am going to show you how I design an activity tracker using an ESP32 and accelerometer gyroscope module.
This is a PCB board with all the assembled components. Here we have the ESP32 S3 module, the BNO085 motion sensor, and the 0.96 in OLED display.
By using the BNO085 accelerometer, gyroscope and magnetometer with ESP32 processing, we will make a device called the IoT activity tracker. Using this device, we can monitor human activity and movement in real time. The tracker can measure steps, cadence, motion level, distance, calories, active time, and orientation.
The OLED display shows important activity parameters such as step count, activity mode, cadence, motion level, distance, calories, active time, and roll pitch, yaw orientation. In addition, the system features a Wi-Fi enabled web interface allowing users to monitor activity data in real time from a smartphone. The web dashboard displays live statistics, progress bars, donut charts, bar graphs, and trend graphs for better visualization.
In this video, I will show you the basics of the BNO085 motion sensor and how it works with the ESP32. I will explain each section of the schematic used for designing this project. Then, I will show you how to make a custom PCB with a 3D view and finally assemble the hardware. Finally, we will write an Arduino code to make this IoT activity tracker project. So, without wasting any further time, let's get started.
The PCB used in this project is sponsored by Aivon, a global leader in PCB manufacturing and assembly. Aivon produces high quality PCBs with fast production and delivery times. For new users, there is currently a special campaign that includes free shipping and generous discounts, making PCB prototyping far more affordable.
Welcome back again. Let us take a look at the BNO085 motion sensor. First, the BNO085 is a 9-axis motion sensor that combines a three-axis accelerometer, three-axis gyroscope, and a three-axis magnetometer in a single module. The accelerometer measures motion and acceleration. The gyroscope measures angular rotation, and the magnetometer helps detect direction and orientation. This sensor also includes an internal sensor fusion engine, which provides stable orientation data such as roll, pitch, and yaw.
In this project, the BNO085 is used to track human movement. It provides step count, linear acceleration, gyroscope data, and orientation information to the ESP32. Based on this data, the ESP32 calculates activity parameters such as cadence, motion level, active time, distance, calories, and activity mode.
Let us take a look at the schematic for this project. Starting from the power supply section, we are using a battery charging IC for charging and a single cell lithium ion battery. The battery is connected to this battery terminal and is charged through this type-C USB port. The same port is also used for programming and USB serial communication. The device operates at a stable 3.3 voltage supply. So a voltage regulation section is used to power the ESP32 and sensors.
For the ESP32 section, we are using an ESP32S3 module. A USB to TTL converter is used for programming and serial communication. The OLED display is connected through the I2C interface. The BNO085 sensor is also connected to the ESP32 through I2C lines using SDA and SCL with pull-up resistors. A push button is connected to GPIO 39 and is used for changing OLED pages and resetting the activity statistics.
Now moving on to the PCB part. I converted the schematic to PCB and placed all the components as per the layout guidelines. The BNO085 sensor is placed carefully on the PCB to capture motion properly. The OLED display is positioned where the user can easily view the activity data. The routing is done based on single requirements and component placement.
Here is a 2D view of the board from the front side and also from the back side. Similarly, here is a 3D view of the board. The 3D view looks awesome.
So, the next step is to order the PCB. The Gerber files were generated and uploaded to Aivon. Uploading the Gerber file is simple. You just select the board parameters like material, thickness, solder mask, color, and quantity. And here you can see the total quote of just $1 and shipping is also free. If you want to order PCB at just $1, check the first link in the description.
I placed the order and within a few days I received these high quality PCBs. The finish, silk screen, and through-hole plating were excellent.
Next, I soldered all the SMD components, which included resistors, capacitors, ICs, LEDs, USB port, ESP32 module, slide switch, JST battery connector, header pins, OLED display, and the BNO085 sensor section. The assembly was smooth and the board looked professional after completion.
Here is the ESP32S3 module. This is the 0.96 in I2C OLED display. This is the type-C USB port for uploading code and serial communication. This is the battery connector. The slide switch is used to turn the device on and off. The BNO085 sensor is placed here for motion and activity tracking.
To test this device, I first connected a 3.7 volt lithium ion battery and slid the switch to power on. If the code is already uploaded to the board, the device immediately starts operation and the OLED display shows a startup screen. You can also power the device through the USB type-C port during programming or testing.
Now let's move to the programming part of this project. We are using multiple libraries here. For the BNO085 sensor, we are using the SparkFun BNO080 Arduino library. For the OLED display, we are using the Adafruit GFX and Adafruit SSD1306 libraries.
The ESP32 reads motion data from the BNO085 sensor, including step count, linear acceleration, gyroscope values, and roll pitch yaw orientation. The program calculates important activity parameters such as cadence, motion level, active time, distance, calories, and peak motion. Based on cadence and motion intensity, the system classifies the activity mode as still, walking, or running.
The push button connected to GPIO 39 is used to control the OLED pages. A short press changes the page and a long press resets the activity statistics. This makes the device easy to use without needing any external controls.
From the web server section, the ESP32 sends live activity data in the JSON format. The web page is designed using HTML, CSS, and JavaScript. It displays the activity tracker data on a beautiful dashboard with cards, charts, progress bars, donut charts, and live trend graphs.
To upload the code, you just connect a type-C cable to the device. From the Arduino IDE tools menu, choose the ESP32S3 development board and select the correct COM port. Then click the upload button and upload the code.
Once the code is uploaded, the OLED display initializes and the BNO085 sensor starts sending data to the ESP32. During startup, the OLED shows activity tracker and the Wi-Fi connection status. If Wi-Fi is connected, the ESP32 IP address is displayed on the OLED for a few seconds. If Wi-Fi is not connected, the device skips the IP display and continues running locally with the OLED display.
For your web monitoring, connect your phone to the same Wi-Fi network or phone hotspot used by the ESP32. Open the IP address shown on the OLED in a single mobile browser. This will open the web dashboard where you can view live activity data such as steps, cadence, distance, calories, active motion time, motion level, peak motion, roll, pitch, yaw, and sensor quality values.
For testing the device in real life conditions, go outdoors and keep the device in your pocket while walking. You can connect the ESP32 to your phone hotspot and open the IP address on your smartphone browser. Start walking slowly, then try normal walking and faster walking. You should observe the step count increasing, cadence changing, and the activity modes switching between still, walk, and run.
The live web page also shows graphical data such as goal progress, active time percentage, statistical bars, cadence trend, and motion trend. These visuals make it easier to understand the activity data in real time.
Well, that's all from the video part today. All the detailed written guides related to this project can be found on the website article on how to electronics. You can find the build of materials, schematic, PCB, Gerber file, source code, and other instructions there.
I hoped you like this video, so why not drop a like and hit the subscribe button. Finally, thank you so much for watching. See you in the next one.