Saikumar Mandaji

Firmware & IoT Engineer with 5+ years building embedded systems for medical devices, industrial controllers, smart wearables, and large-scale IoT deployments.

Download CV
firmware.c
<500nA sleep current achieved
2500+ devices in production
5 hubs LoRa fleet, active in field
nRF52840 STM32 BGM220 FreeRTOS BLE 5.3 Zephyr

About Me

My introduction

Innovative Firmware & IoT Systems Engineer with 5+ years of experience architecting embedded solutions for medical devices, industrial controllers, smart wearables, and large-scale IoT products. Strong background in real-time systems, wireless communication, embedded Linux, and ML integration on edge devices. Proven record of delivering production-grade firmware, enhancing system reliability, and collaborating across hardware, cloud, and data teams.

5+ Years
Experience
20+ Projects
Completed
15+ MCU Platforms
Worked With
2500+ Devices
Deployed

Skills

Technical Expertise

MCU & SoC Platforms

BLE/Thread: nRF54L15, nRF52840, nRF52832, SiLabs BGM220, Dialog DA14531
Wi-Fi/BLE: ESP32, ESP32-S3, ESP32-C3, ESP8266
ARM Cortex: STM32, TI CC2640, RP2040 (Pi Pico)
AVR: Arduino UNO/Nano/Mega, ATmega328P, ATtiny85

Programming & Firmware

Languages: C/C++, Python, Embedded C, MicroPython
IDEs/Tools: VS Code,Simplicity Studio,Segger,IDF, PlatformIO, Arduino IDE, STM32CubeIDE
Debugging: JTAG, SWD,Power Profiler, Logic Analyzers, Oscilloscopes

Embedded Systems & RTOS

RTOS: FreeRTOS, Zephyr
Linux: Embedded Linux, Raspbian, Ubuntu
Firmware: Bootloaders, OTA Updates, SPI Flash Drivers
HW Interfaces: ADC, GPIO, Sensor Interfaces, Analog Signal Conditioning

Circuit Design & PCB

EDA Tools: EasyEDA Pro
Design: Multi-layer PCBs
Processes: Schematic Capture, Layout, DRC/ERC, Gerber Generation

Test & Measurement

Oscilloscopes: Digital Storage Oscilloscopes (DSO), Mixed Signal Oscilloscopes
Analyzers: Logic Analyzers, Bluetooth Protocol Analyzers, Multi-Protocol Debugging
Simulation: LTspice, EasyEDA, PuTTY

Communication Protocols

Serial: SPI, I²C, UART, CAN, RS-485, USB, MIPI
Wireless: Bluetooth LE 5.3, Thread, Zigbee, Wi-Fi, MQTT, LoRa/LoRaWAN

IoT Cloud Platforms

Cloud: AWS IoT, GitHub
Middleware: Node-RED, Mosquitto MQTT, HiveMQ, Eclipse IoT

Sensors & Actuators

Environmental: Temperature/Humidity Sensors, Gas Sensors, Pressure Sensors
Motion: Accelerometers, Gyroscopes, Distance Sensors, Gesture Sensors

Experience

Professional Journey

Firmware Developer

Caropet Technologies Pvt Ltd
Apr 2024 – Present
  • Leading firmware for medical critical care devices, pediatric patient monitoring systems (PediaSense), and industrial automation PLCs.
  • Developed reliable real-time data acquisition and safety-critical firmware for healthcare applications.
  • Created modular drivers, improved system stability, and optimized firmware performance across multiple product lines.
  • Collaborating with hardware and cloud teams for end-to-end IoT product delivery.

IoT Developer

Niltech Pvt Ltd
Apr 2020 – Apr 2024
  • Delivered firmware for IoT, industrial, and wearable products end-to-end — from bare-metal bring-up through production deployment on ESP32, STM32, and Raspberry Pi.
  • Designed and shipped firmware for 2500+ RFID Smart Card Payphones, each with GSM calling, cloud sync, and remote dashboard access.
  • Built LoRa-based environmental monitoring system (BeetleGuard) handling 250 sensor nodes per hub — 5 hubs currently active in the field.
  • Developed edge ML inference pipelines on constrained hardware using TF Lite and MediaPipe for vision-based applications.
  • Wrote project-specific Python UART tools — serial parsers, real-time matplotlib plotters, binary packet decoders, and automated calibration scripts — eliminating manual testing bottlenecks.
  • Mentored 200+ interns in embedded systems, guiding hands-on hardware bring-up and firmware debugging.

Embedded Software Engineer (Intern)

Niltech Pvt Ltd
Aug 2019 – Apr 2020
  • Supported firmware development, debugging, and IoT prototyping.
  • Assisted multi-sensor integration and early-stage R&D projects.

Education

B.Tech — Electronics & Communication Engineering

Guru Nanak College of Engineering 2016 – 2019

Diploma — Electronics & Communication Engineering

Jyothishmathi Institute of Technology 2013 – 2016

Projects

· Medical · IoT · Industrial · Wearable
BeetleGuard production LoRa boards
IoT

BeetleGuard

Scalable LoRa monitoring system handling 250 devices/hub for real-time environment tracking. FreeRTOS task architecture with dedicated sensor, radio, and cloud sync tasks. 5 hubs active in production.

STM32LoRa SX1278FreeRTOS SPIUARTAWS IoTCloud Dashboard
IoT Payphone enclosure — deployed unit
IoT

IoT Payphone System

RFID-authenticated payphone for student GSM calling — 2500+ units deployed. Raspberry Pi handles cloud sync, usage logging, and a remote dashboard for parent and admin access.

Raspberry PiRC522 RFIDGSM Module SPIUARTREST APIData ExportCloud Dashboard
Medicine Reminder System — Raspberry Pi with rotating dispenser platform
IoT

Medicine Reminder System

Automated medicine reminder and dispenser using Raspberry Pi. Rotating platform positions the correct compartment at dispense time, with LCD alerts and scheduled reminders for patient compliance.

Raspberry PiLCD DisplayMotor Control GPIOSchedulerAutomation
Medical 🔒 Under NDA

Oxygen Therapy System

SpO₂-driven closed-loop oxygen flow control on STM32. Independent high-priority alarm task, hardware watchdog, and NVM-backed alarm state persistence for safety-critical medical operation.

STM32MAX30102 SpO₂Flow Control Valve ADCMedical AlarmsWatchdog
Medical 🔒 Under NDA

Standalone Diagnostic Analyzer

Standalone biochemical analyzer for urine metabolite identification. Optical sensor array driven by STM32 ADC with calibration coefficients stored in flash. Outputs formatted diagnostic reports over UART to a local printer.

STM32Optical SensorsADC UARTStandalone UIReport Generation
Medical 🔒 Under NDA

Patient Vitals Monitor (BLE)

Ultra-low-power vital signs monitor on Si Labs BGM220. Custom GATT service packs HR, SpO₂, and NTC temperature into a single characteristic notification. Sub-500nA sleep current achieved via load-switch isolation and EM4 deep sleep.

Si Labs BGM220BLE 5.0MAX30102 NTC ThermistorGATTMobile App
Custom compact ESP32 IoT board — wearable form factor
IoT

ULP BLE Temperature Logger

BLE temperature logger on Si Labs BGM220 with nano-ampere sleep current. Removed all pull-up resistors on sleep-sensitive nets; replaced with software-configured internal pull-ups that disengage in EM4 sleep. Energy harvesting enables indefinite coin-cell operation.

Si Labs BGM220BLE 5.0Energy Harvesting nA Sleep CurrentLow Power ModesSPI
Food sanitization machine — 3D printed enclosure
Industrial

Food Sanitization Machine

Standalone food sanitization unit with timed processing cycles. STM32 drives relay-controlled actuators via a state machine with door-interlock safety — cycle cannot start unless interlock is closed. 3D printed enclosure with integrated chamber.

STM32Relay ControlTimer Logic HMIAutomationSafety Interlocks
Industrial relay control board with Hi-Link AC modules and ESP32
Industrial

Industrial IoT PLC Interface

ESP32-based bridge between legacy PLC digital I/O and MQTT cloud. Reads RS485/Modbus registers from the PLC and publishes to AWS IoT; subscribes to control topics and drives relay outputs. Hi-Link AC-DC modules provide mains-isolated 5V on-board.

ESP32RS485 / ModbusDigital I/O MQTTPLC SignalsCloud Integration
Industrial data logger PCB with TFT display and terminal blocks
Industrial

Industrial IoT Data Logger

Multi-input data logger supporting RS485/Modbus, 4–20mA (250Ω shunt + ADS1115), and 0–10V inputs. On-board TFT shows live channel readings; ESP32 publishes to MQTT broker with QoS 1 for guaranteed alarm delivery.

ESP32RS4854–20mA 0–10V ADCADS1115MQTTCloud Sync
Medical 🔒 Under NDA

Therapeutic Gas Monitor

Standalone clinical gas monitor measuring nitric oxide concentration via electrochemical sensor with custom analog front-end. Safety-critical alarm thresholds with fail-safe firmware architecture for reliable medical operation.

STM32Electrochemical SensorADS1115 MCP1525Trans-impedance AmpMedical Alarms
Wearable

ULP Women Safety Device

nRF52840-based safety wearable with gesture-triggered BLE emergency alert. Accelerometer interrupt wakes from deep sleep; firmware validates gesture pattern before alerting to prevent false triggers. Load-switch gating of all peripherals during idle.

nRF52840BLE 5.0Accelerometer Ultra Low PowerEmergency AlertsMobile App
Wearable

Smart Wrist Wearable

Si Labs BGM220 wearable combining MAX30102 vitals and CCS811 air quality in one BLE GATT service. I²C bus shared between sensors with interrupt-driven scheduling to prevent bus contention. Single characteristic packs all sensor data to minimise connection events.

Si Labs BGM220BLE 5.0MAX30102 CCS811 Air QualitySensor FusionMobile App
Medical 🔒 Under NDA

ECG Monitoring System

nRF52840 acquiring ECG at 500 SPS via AD8232 + ADC. Lead-off detection (LOD± pins) prevents false arrhythmia detection from disconnected electrodes. 0.05Hz high-pass firmware filter removes baseline wander without distorting QRS. MAX30100 on I²C runs interrupt-driven alongside timer-based ECG sampling.

nRF52840AD8232MAX30100 DS18B20BLE 5.0ADCSignal Conditioning
Solar Inverter Prototype — transformer, battery, relay control
Industrial

Solar Inverter Prototype

Prototype solar inverter with transformer-based AC conversion, 12V battery input, relay-controlled switching, and DC-DC boost stage. Designed to validate inverter topology and control logic before custom PCB.

Power ElectronicsTransformerRelay Control DC-DC BoostBatteryInverter
Industrial Home Assistant — Raspberry Pi relay controller with mains outlets
IoT

Industrial Home Assistant

Raspberry Pi-based home automation controller driving mains-powered outlets via relay board. Remote control and scheduling over local network with GPIO-driven relay switching for AC load management.

Raspberry PiRelay ControlGPIO AC LoadHome AutomationNetwork Control
Modern Flame Diya — custom gold PCB with flame LED strip
Personal

Modern Flame Diya

Custom KiCad PCB with ATtiny driving WS2812 LEDs in a realistic flame animation via PWM. Touch-capacitive control with three brightness modes. Circular gold PCB with upright flame-shaped LED strip — fully self-contained with USB-C charging.

Custom PCBATtinyPWM Touch SensingWS2812 LEDsKiCad

Tech Blog

Insights from the field
RTOS 5 min read

Writing a SPI Flash Driver in Zephyr RTOS

Zephyr's device model and SPI API are quite different from bare-metal approaches. Here's how I structured the W25Q16 driver on nRF52832 using Device Tree overlays and the Zephyr SPI transceive API.

When moving from bare-metal STM32 to Zephyr RTOS on nRF52832, one of the first challenges is adapting to Zephyr's device model. Instead of directly configuring SPI registers, everything goes through the Device Tree and Zephyr's HAL.

Key concepts:

  • Device Tree overlay — define the SPI bus, chip select GPIO, and flash node in .overlay file rather than in C code.
  • spi_transceive() — Zephyr's SPI API bundles TX and RX into one call with spi_buf_set structs, unlike HAL's separate send/receive.
  • Chip Select control — Zephyr manages CS automatically if defined in DT, or you can control it manually via GPIO API for timing-sensitive flash operations.
  • W25Q16 commands — WRITE ENABLE (0x06) must precede every page program or sector erase. Status register polling after erase is essential — the chip holds the SPI bus busy otherwise.

Lesson learned: Sector erase on W25Q16 takes up to 400ms. Without polling the BUSY bit in the status register, subsequent read/write operations silently fail. Always implement a timeout-based busy-wait loop.

BLE 6 min read

nRF52840 BLE GATT Profile Design for Medical Sensor Devices

Designing a clean GATT profile is the difference between a BLE device that "works in demos" and one that integrates reliably into mobile apps, handles reconnections gracefully, and survives real-world usage.

Most embedded developers treat GATT as an afterthought — pick a characteristic UUID, throw data in, done. On production medical sensor devices, poor GATT design causes app crashes, data loss on reconnect, and months of debugging.

Service and characteristic structure:

  • One service per functional domain — separate Vitals Service (HR, SpO₂, temperature) from Device Info Service (battery, firmware version, serial). Mixing concerns into one service makes the mobile side brittle.
  • Notify vs Indicate — use Notify for high-frequency sensor data (no acknowledgement, lower overhead). Use Indicate for critical alarms and configuration confirmations (acknowledged delivery). Never use Indicate for streaming data — it will saturate the connection.
  • Characteristic descriptors — always include a CCCD (Client Characteristic Configuration Descriptor) on notifiable characteristics. The central must write it to enable notifications — if your firmware doesn't handle CCCD writes, notifications silently never start.
  • Data packing — pack multi-field sensor readings into a single characteristic rather than one characteristic per sensor value. Fewer notifications = lower power + lower connection event load.

Reconnection and state handling:

  • Reset all CCCD states on disconnect. The next central to connect must re-subscribe. Retaining CCCD state across connections causes silent data floods to unexpected clients.
  • Buffer the last N sensor readings in a ring buffer on the device. On reconnection, flush the buffer before resuming live streaming — this prevents data gaps in clinical recordings.
  • Implement a connection timeout watchdog: if the central stops responding (GATT timeout), trigger a disconnect and restart advertising rather than hanging in a half-connected state.

MTU negotiation:

  • Request MTU of 247 bytes (maximum for nRF52840 with data length extension). This allows packing multiple sensor samples per notification — critical for ECG streaming at 500 SPS.
  • Always handle the case where the central rejects the MTU upgrade and falls back to 23 bytes. Your characteristic write handler must cope with both sizes.

Key lesson: Document your GATT profile as a table (UUID, properties, format, units, range) before writing a single line of firmware. Every ambiguity in the profile becomes a bug in the mobile app integration.

Medical 7 min read

ECG Signal Acquisition — From AD8232 to Digital

The AD8232 simplifies ECG front-end design but introduces subtle challenges around lead-off detection, baseline wander, and ADC sampling rate that directly affect signal quality.

The AD8232 is a single-chip ECG front-end that handles instrumentation amplifier, right-leg drive, and high-pass filter in one package. But clean ECG output requires careful system design around it.

Design considerations:

  • Sampling rate — ECG requires minimum 250 SPS for accurate QRS detection. At 500 SPS you get comfortable headroom. Using Raspberry Pi's ADC (via ADS1015/MCP3008) limits you — use ADS1115 at 860 SPS for better resolution.
  • Lead-off detection — AD8232 provides LOD+ and LOD- outputs. Poll these before processing samples. Attempting to detect heartbeats with disconnected leads produces noise that looks like arrhythmia.
  • Baseline wander — movement artifacts and breathing cause slow baseline drift. A high-pass filter at 0.05Hz in firmware removes this without distorting the QRS complex.
  • Power supply noise — the AD8232 is sensitive to power rail noise. Decouple with 100nF ceramic + 10µF electrolytic close to the VCC pin. Use a dedicated 3.3V LDO if possible.
  • MAX30100 integration — combining SpO₂ (MAX30100) with ECG (AD8232) on the same device requires careful I2C timing. Run MAX30100 interrupt-driven and ADC sampling on a separate timer to avoid interference.

Key insight: ECG is 99% analog design and 1% digital processing. Spending time on PCB layout (ground planes, lead routing, shielding) gives better results than any digital filter.

IoT 5 min read

ESP32 BLE + MQTT — Designing Reliable IoT Data Pipelines

Running BLE and WiFi simultaneously on ESP32 is possible but requires understanding the radio coexistence mechanism and careful task architecture to avoid dropped packets on both sides.

ESP32's dual-mode radio (BLE + WiFi) is powerful but the two share the same 2.4GHz antenna. Understanding coexistence is critical for reliable simultaneous operation.

Architecture decisions:

  • Task separation — run BLE scan/connect on Core 0 and WiFi/MQTT on Core 1. ESP-IDF's xTaskCreatePinnedToCore() makes this straightforward. Never block the BLE event loop with MQTT operations.
  • MQTT QoS selection — QoS 0 for high-frequency sensor data (acceptable loss), QoS 1 for alarms and critical events (guaranteed delivery). QoS 2 is too overhead-heavy for constrained devices.
  • Reconnect strategy — implement exponential backoff for MQTT reconnection: 1s, 2s, 4s, 8s, max 60s. Aggressive reconnection floods the broker and drains battery.
  • Offline buffering — store missed MQTT publishes in a ring buffer (NVS flash) during WiFi outages. Flush on reconnect. This prevents data loss in poor coverage areas.
  • BLE data flow — collect data via BLE GATT notifications from peripheral sensors into a queue. MQTT task drains the queue and publishes in batches. This decouples the two radios cleanly.

Topic design tip: Structure topics hierarchically — device/{device_id}/sensor/{type}/data. This allows wildcard subscriptions on the backend for fleet monitoring.

Hardware 6 min read

Analog Front-End Design for Industrial & Medical Sensors

From 4–20mA loops to transimpedance amplifiers for electrochemical gas sensors — analog signal conditioning is where firmware meets hardware, and getting it wrong corrupts every measurement downstream.

Industrial sensors speak in currents and voltages that MCU ADCs cannot read directly. The signal conditioning chain between sensor and ADC determines measurement accuracy more than any software calibration can fix.

4–20mA current loop:

  • Convert to voltage using a precision shunt resistor (typically 250Ω → 1V to 5V range). Use a 0.1% tolerance resistor — 1% error here propagates directly to measurement error.
  • Add a 100nF filter capacitor across the shunt to suppress noise. Cut-off frequency: Fc = 1/(2π·R·C).
  • Use ADS1115 (16-bit) over internal MCU ADC (12-bit) for industrial measurements where ±0.1% accuracy is required.

Transimpedance amplifier (TIA) for gas sensors:

  • Electrochemical gas sensors like SGX-7NO produce femtoamp-to-nanoamp currents proportional to concentration. A TIA converts this current to a readable voltage: Vout = Igas × Rfeedback.
  • Choose Rfeedback based on full-scale current. For NO sensors at 100ppm, typical output current is 40–200nA, so Rfeedback of 10MΩ gives 0.4V–2V output.
  • Use a precision voltage reference (MCP1525 = 2.5V, 0.4% accuracy) as the TIA reference voltage — power supply noise on the reference rail directly appears on the output.
  • PCB layout: guard rings around the TIA input node. Any leakage current (even 1pA on PCB surface) competes with the sensor signal at these impedance levels.

Key rule: Solve the analog problem in hardware. Software calibration can compensate for offset and gain errors, but it cannot fix noise, non-linearity, or impedance mismatch.

Medical 5 min read

Medical Alarm Design — Safety Firmware Patterns

A medical device alarm that fires one second late, or worse, fails to fire at all, is not a software bug — it's a patient safety incident. Here's how I approach alarm firmware architecture.

Medical alarm design is guided by IEC 60601-1-8 (alarm systems) and IEC 62304 (software lifecycle). The principles apply even in R&D devices not yet in clinical trials.

Alarm priority levels:

  • HIGH — immediate patient danger (SpO₂ < 85%, flow failure). Continuous audio + visual. Cannot be silenced for more than 2 minutes.
  • MEDIUM — deteriorating condition (SpO₂ 85–90%). Intermittent audio. Can be acknowledged.
  • LOW / ADVISORY — informational (sensor disconnected, battery low). Visual only acceptable.

Firmware patterns:

  • Independent alarm task — never couple alarm evaluation to the measurement task. A separate high-priority RTOS task evaluates alarm conditions every 100ms regardless of measurement state.
  • Watchdog timer — hardware watchdog must be kicked by the alarm task specifically. If the alarm task hangs, the device resets — this is intentional and required.
  • Alarm persistence — once a HIGH alarm triggers, it stays active until the condition clears AND an operator acknowledges. Auto-clearing alarms are dangerous in clinical settings.
  • Fault injection testing — intentionally break sensors in test builds to verify every alarm path fires correctly. Unit tests are insufficient for safety-critical paths.
  • Power-fail alarm state — store last alarm state to non-volatile memory before power loss. On restart, if the device was alarming, restore that state rather than booting clean.

Philosophy: Design alarms to fail safe. If the alarm subsystem itself has an error, the device should alert — not stay silent.

Hardware 7 min read

Custom Hardware Design for Nano-Ampere ULP Systems

Achieving nano-ampere sleep current is not just a firmware problem — it demands custom PCB design, careful component selection, and hardware-level power path optimisation that datasheets alone won't tell you.

When working on ultra-low-power products with Si Labs BGM220, hitting the theoretical sleep current numbers from the datasheet requires solving several hardware problems that most reference designs ignore.

Power path design:

  • Leakage is the enemy — at nA targets, even a 10MΩ pull-up resistor leaks 330nA at 3.3V. Audit every resistor on power-sensitive nets. Replace pull-ups on unused pins with software-configured internal pull-ups that disengage in sleep.
  • Voltage regulator quiescent current — standard LDOs have 50–200µA Iq. For nA targets, use a nano-power LDO (Iq = 25nA range) or run directly off battery with protection-only circuitry.
  • Load switch isolation — sensors, LEDs, and peripherals must be power-gated via a P-channel MOSFET or dedicated load switch. If a peripheral draws 100µA idle and is continuously powered, no firmware trick recovers that.
  • Capacitor leakage — use ceramics exclusively. Tantalum and electrolytic caps have significant leakage at nA budget levels.

PCB layout for leakage control:

  • Guard rings around high-impedance nodes to intercept surface leakage before it reaches sensitive pins.
  • Conformal coating on production boards — humidity causes surface leakage orders of magnitude above dry-lab measurements.
  • Separate analog and digital ground planes joined at a single star point near power entry.

Firmware side (BGM220):

  • Use EM4 (Energy Mode 4) for deepest sleep — RAM not retained but sub-100nA achievable with GPIO/RTC wake.
  • Disable all unused peripherals explicitly before sleep — even a peripheral left in reset draws microamps on some SoCs.
  • Measure actual current with a dedicated power analyser — never trust simulation. Real boards always have surprises.

Result achieved: Through hardware + firmware co-optimisation, sleep current below 500nA was consistently achieved on production hardware, enabling multi-year coin cell operation.

BLE 6 min read

Building Custom BLE Beacon Systems for Embedded Products

Generic iBeacon or Eddystone specs rarely fit real product requirements. Custom beacon firmware lets you pack exactly the data you need — sensor readings, device state, battery level — into advertising packets with zero connection overhead.

For projects where data needs to broadcast to multiple listeners simultaneously without connection latency, custom BLE beacons are the right architecture.

Custom advertising payload design:

  • Manufacturer Specific Data (AD type 0xFF) — pack up to 27 bytes per advertising packet. Define a custom company ID prefix followed by your payload struct.
  • Tight packing — a typical sensor beacon: 2B device ID + 2B temperature (0.01°C resolution) + 1B battery % + 1B status flags = 6 bytes total. Compact and extensible.
  • Sequence counter — a 1-byte rolling counter lets listeners detect missed packets and assess link quality independently of RSSI.
  • Lightweight obfuscation — XOR payload with a key derived from device ID to deter casual sniffing of proprietary formats on shared radio environments.

Advertising interval strategy:

  • Fast advertising (100ms) for active/alarm states, slow (2–5s) for idle — a state-machine in firmware drives interval switching based on device condition.
  • Randomise interval slightly (±10ms) to avoid systematic collision with other devices on the same channel hopping pattern.

Gateway/receiver side:

  • Filter on company ID immediately — ignore all unrecognised advertising packets to minimise processing load on the gateway.
  • Device registry keyed on BLE MAC: track last-seen timestamp and flag devices as lost after 3× their normal interval.
  • Average RSSI over 5 consecutive packets before any proximity decision — single-packet RSSI is too noisy for reliable distance estimation.

Key advantage: 50+ beacons can be monitored simultaneously by a single gateway with no connection slots consumed — far more scalable than maintaining concurrent connections for fleet monitoring.

Tools 5 min read

Python UART Debug Tools — Real-Time Embedded Device Analysis

When a device misbehaves in the field, UART is your lifeline. I built custom Python serial tools to capture, parse, visualise, and log device data — far beyond what any terminal emulator offers.

Rather than relying on generic terminal emulators, I write project-specific Python tools using pyserial that understand the device's exact data format and surface problems immediately.

Core architecture:

  • Serial reader thread — read UART in a background thread; pass data to the main thread via queue.Queue so no bytes are dropped while the main thread processes output.
  • Structured log format — define a lightweight log protocol on the device: [TIMESTAMP][LEVEL][MODULE] message. Python parses and colour-codes by level: DEBUG=white, INFO=green, WARN=yellow, ERROR=red.
  • Binary packet parser — for sensor data sent as packed structs, use Python's struct.unpack() matching the exact layout defined in firmware. Any struct mismatch becomes immediately visible as garbage output.

Visualisation:

  • Real-time plotting with matplotlib — sensor readings, ADC values, RSSI over time. Catches drift, noise spikes, and glitches that scrolling text hides entirely.
  • CSV export with PC timestamps — logging a full day of device operation and analysing patterns in pandas has caught multiple intermittent bugs that never appeared in short test sessions.

Specific tools built:

  • BLE beacon sniffer parser — device in observer mode outputs raw advertising data over UART; Python tool decodes custom beacon payloads and shows all nearby devices in a live table with RSSI, device ID, and sensor values.
  • Power event logger — firmware logs sleep/wake events with timestamps over UART; Python calculates actual sleep durations, wake frequency, and estimated average current — no power analyser required for initial debugging.
  • Sensor calibration tool — interactive script sending calibration commands over UART, reading raw ADC values back, computing correction coefficients, and writing them to device NVS flash — the entire calibration workflow automated in one tool.

Key insight: A logic analyser captures what the hardware does. A custom Python tool captures what the firmware thinks. The gap between those two is often exactly where the bug lives.

Contact Me

Get in touch

Email

mandajisaikumar@gmail.com

Location

Hyderabad, Telangana, India