This project centered on an electronic scale integrated with hospital information systems through wired and wireless links, reducing manual transcription and human error. I worked on MCU resource planning, power management, weighing-signal quality, and clock stability.

MCU pin-out redesign

The prototype was complete when I joined, but customer feedback kept adding sensors and modules. COVID-era supply risk and medical-certification schedules ruled out an MCU change, so I replanned the STM32L4S9ZI PinMux while working with hardware engineers to balance pin count, power architecture, signal integrity, and EMC.

InterfaceInitialFinalChange
UART24Added Wi-Fi and external optical-sensor interfaces
I2C22Kept two buses while adding gyro, RGB LED, touch sensor, batteries, EEPROM, and other devices
SPI23Added Ethernet and migrated NFC from PN7100 to ST25R3916
GPIO1022Added power control for Load Cell, Ethernet, Wi-Fi, optical sensor, and other subsystems

Three-source power architecture

Together with the hardware team, I replanned battery selection, the power tree, and MCU control strategy around a Main Battery, onboard Sub Battery, and 110/240V AC. AC powers the complete system and charges both batteries. The sub battery maintains service when the main battery is depleted or hot-swapped, while the hospital system is notified. The MCU also gates Ethernet, Wi-Fi, optical-sensor, and gyro power domains to reduce consumption.

Reaching ±0.5% weighing accuracy

I established a validation method for Load Cell linearity, repeatability, and temperature compensation, covering zero-load drift, consistency across loads, and stability under the same load at different temperatures. The results guided several changes:

The system reached ±0.5% accuracy and passed medical-device certification testing.

Reducing RTC drift from 3,500 ppm to 34 ppm

The system clock drifted by roughly five minutes per day, and intermittent hospital networking made NTP correction unreliable. We traced the root cause to MCU clock accuracy, selected a high-precision external 32.768 kHz ±10 ppm crystal, improved component handling, and revised PCB layout. Measured drift fell from roughly 3,500 ppm to 34 ppm.

Conventional validation took more than 24 hours, so I routed the MCU clock to GPIO, counted pulses with an Arduino Uno, and compared them with a DS3231 high-accuracy RTC. This accelerated late-stage tuning substantially.