Making Dumb Chargers Smart: A Practical Guide to OTA and OTW

    This guide explores how to upgrade traditional chargers into smart devices using OTA (Over-The-Air) and OTW (Over The Wire & Wireless) technologies. It covers the limitations of traditional charging hardware, the implementation of full-mode OTA for updating power control firmware, and the design of a reliable device-side upgrade architecture. Furthermore, it details how OTW enables bi-directional communication for state monitoring and dynamic power scheduling, alongside cloud module design and JSON message protocols for effective device management.

    Introduction: Why Old Chargers Need “Upgradeability”

    New battery charging curves and fast-charging protocols are updated rapidly, but charging hardware is typically finalized at the factory. Many chargers are designed with parameter matching only for the batteries and protocols available at the time of design, making them difficult to adjust later. As a result, devices may experience excessive heat, reduced efficiency, or acoustic noise under specific loads in new scenarios.

    The “charging noise” reported by users is usually electromagnetic whining. It is mostly caused by mechanical resonance of inductors or capacitors at a certain PWM frequency, combined with control strategies that do not dynamically adjust based on the load. In other words, the problem often stems from the interaction between software and hardware, and simply replacing components may not resolve it.

    Therefore, the industry has begun introducing the concept of software-defined hardware into charging devices. On one hand, devices must be able to receive firmware updates; on the other, they must be able to report their running status to the cloud and receive dispatch instructions. This article will introduce these two capabilities and outline the boundary conditions that need attention in engineering.

    Three Pain Points of Traditional Charging Devices

    Traditional “dumb” chargers mainly expose the following issues in complex scenarios:

    1. Lack of State Awareness: Devices can usually only collect basic voltage and current, and cannot continuously monitor internal temperature, voltage ripple, and current harmonics. Hardware protection only triggers during severe overload or short circuits, failing to make proactive adjustments.
    2. Rigid Power Scheduling: Devices operate on fixed logic, and charging curves often fail to match different battery chemistries. This can lead to efficiency drops, abnormal heating, and whining.
    3. Short Lifecycle: Once hardware leaves the factory, it cannot be upgraded. When new fast-charging protocols or battery standards emerge, old devices must be discarded, increasing e-waste.

    For acoustic noise issues, troubleshooting can follow the sequence below, eliminating software factors first before checking hardware:

    Troubleshooting Item Inspection Content Handling Method
    Firmware Version Whether the current version is the latest and has known noise fix records Upgrade and verify on a test machine first
    PWM Frequency Whether the noise occurs near a specific switching frequency Offset the frequency via firmware and observe noise changes
    Load Range Whether the noise only appears in a specific power or current range Set a dedicated frequency strategy for this range
    Temperature Whether the noise worsens as temperature rises Test in conjunction with derating strategies
    Inductor & Capacitor Whether component selection and mounting positions pose resonance risks Consider hardware revisions only if firmware adjustments fail

    Full-Mode OTA: Update Scope and Technical Boundaries

    OTA (Over-The-Air) refers to remotely updating device programs via wireless or network channels. Common industry OTA usually refers to system-level or application-layer updates, meaning updating the device’s main program and configuration files.

    The full-mode OTA discussed here refers to a broader range of modules covered by the upgrade, including three types of content:

    • Application Layer: Device business logic, status reporting logic, and user interaction logic.
    • Protocol Stack: Implementations of fast-charging protocols, communication protocols, and authentication.
    • Power Control Firmware: Low-level code running on the MCU or DSP, such as PWM modulation, power scheduling, and protection thresholds.

    Compared to the two common industry methods, full-mode OTA is an extension of coverage, not a new transmission method. Full-package upgrades replace the old version with a complete image, while differential upgrades only transmit the differences between the new and old versions. Full-mode OTA can be distributed using either full-package or differential methods; the key is whether the upgrade scope includes the power control layer.

    Taking acoustic noise as an example, the R&D team can push a new firmware version via the cloud to adjust the switching frequency in specific load ranges, moving the operating frequency away from the inductor’s resonance band. This adjustment does not require hardware changes. However, frequency offsets may introduce new efficiency or electromagnetic interference (EMI) issues, so every adjustment requires physical testing. One cannot assume all batches of components behave identically.

    Key Elements of Device-Side Upgrade Architecture

    A reliable device-side OTA architecture typically needs to include the following elements.

    1. Secure Bootloader

    The bootloader is the first program to run after the device powers on, responsible for verifying and starting the new firmware. It needs to perform the following checks:

    • Firmware integrity check, such as using SHA-256 to calculate a digest and comparing it with the value in the signature.
    • Digital signature verification, such as using RSA or ECC algorithms, to confirm the firmware comes from a legitimate publisher.
    • Anti-rollback check, meaning the device only accepts firmware with a version number not lower than the current version, preventing attackers from downgrading the device to an old version with known vulnerabilities. The version counter should be saved in one-time programmable memory or a secure element.

    The signing private key must be kept by a dedicated key management system and should not be placed in ordinary files on the build server. If the private key is leaked, attackers can sign malicious firmware, affecting all devices.

    2. A/B Partition Upgrade

    The device Flash is divided into A and B partitions. During an upgrade, the new firmware is written to the inactive partition, and the device switches to the new partition to boot after a restart. If the new firmware fails the health check after startup, the device automatically rolls back to the old partition.

    The A/B mechanism significantly reduces the risk of devices becoming unusable due to upgrade failures. However, it has clear boundaries: if the bootloader itself is corrupted, the Flash develops bad blocks, or both partitions fail to write, rollback will not work. Therefore, A/B partitioning only reduces risk and cannot guarantee the device can always be recovered.

    3. Differential Upgrade and Breakpoint Resume

    For bandwidth-limited communication links, differential upgrades can significantly reduce the download size. BSDiff is a commonly used binary differential algorithm that uses the old version image as a baseline to generate a patch package between the old and new versions.

    The applicable conditions for BSDiff are quite clear:

    • The differences between the new and old versions are small, usually minor version iterations within the same major version.
    • The Flash layout on the device remains consistent between versions.
    • The device must retain a reliable old version baseline and verify its integrity before merging the patch.

    When crossing major versions or when the layout changes, the differential package might be larger than the full package; in this case, a full-package upgrade should be used directly. Breakpoint resume is used to handle download interruptions: the device records the received offset and continues from that position after the connection is restored.

    4. Security Prerequisites During Upgrade

    The following conditions must be strictly enforced during the upgrade process:

    • The device must maintain power during the upgrade. Check battery level or voltage before upgrading; refuse to start writing if power is insufficient.
    • Verify after download, then write to the partition. Firmware that fails verification is discarded directly.
    • Signing keys and version counters must be managed separately and rotated regularly.
    • If rollback fails, the device should enter a safe state, such as stopping power output and reporting an error code, rather than continuing to run in an unknown state.

    Upgrade success rate is an important metric for measuring the solution’s effectiveness. It is recommended to standardize statistics as follows: the success rate equals the number of devices that successfully completed the upgrade and passed the power-on self-test, divided by the number of devices that initiated the upgrade. Statistics should be grouped by batch and firmware version, and the scope should be gradually expanded using canary releases.

    OTW: Enabling Bi-directional Communication for Dumb Devices

    OTA solves the problem of “whether a device can be upgraded.” OTW (Over The Wire & Wireless) solves the problem of “whether a device can perceive and interact.” OTW refers to the device establishing a bi-directional data channel with an edge gateway or the cloud via wired or wireless links.

    Note that OTW is a general term for communication channels, primarily carrying status reporting and command dispatch. OTA firmware packages can also be transmitted via OTW, but their responsibilities differ: OTA replaces code, while OTW transmits status and control information.

    Common OTW channels include the following, each with significantly different applicable conditions:

    Channel Typical Scenario Advantages Limitations
    Type-C CC Line Comm Charging handshake, parameter negotiation, minor status return Utilizes existing interface, no extra cables needed Low speed, relies on interface protocol, suitable for short messages at close range
    Power Line Communication (PLC) Unified management of multiple devices within the same power distribution or socket network No extra wiring required Limited bandwidth, susceptible to grid noise interference
    Bluetooth Low Energy (BLE) Phone pairing, local configuration, close-range debugging Low power consumption, high phone penetration Lower bandwidth, limited communication range
    Wi-Fi Large data reporting or firmware downloads requiring high bandwidth High bandwidth, easy network access Higher power consumption, relies on network and configuration process

    The actual available speed depends on the chip and protocol stack implementation; the table above only outlines the general characteristics of each channel, and selection should be based on actual test data.

    With OTW capabilities, charging devices can accomplish the following two types of smart functions:

    1. State Recognition: The MCU samples voltage and current waveforms during the charging process at a high frequency, with the data used for local closed-loop control. Key data can also be reported to the cloud via OTW to analyze hidden dangers such as battery aging and poor interface contact in conjunction with historical data.
    2. Dynamic Power Scheduling: The cloud can dispatch power limits or charging strategies based on grid load, device temperature, ambient temperature, and user charging habits. For example, appropriately increasing power during nighttime off-peak electricity price periods, or actively derating operation when the device temperature approaches a critical value.

    The device side must always retain local protection logic. Even if cloud commands are lost or delayed, the device should operate according to local thresholds and must not lose over-temperature and over-current protection due to communication interruptions.

    Engineering Practice: Cloud Modules and Message Design

    As the number of devices increases, the cloud needs to handle a large number of persistent connections and status data. A common practice is to adopt a microservices architecture, splitting different responsibilities into independent modules. A typical smart charging cloud platform can be divided into the following modules:

    Module Main Responsibilities Design Considerations
    Device Access Layer Maintain massive persistent connections, handle device authentication Support lightweight protocols like MQTT, plan capacity for connections and heartbeats
    Message Queue Buffer status data reported by devices, peak shaving and valley filling Set reasonable partitions and retention periods to avoid data backlogs
    Time-Series Database Store metrics with timestamps such as temperature, power, and voltage Support high-concurrency writes and time-window-based aggregation queries
    Rule Engine & Alerting Determine temperature anomalies, harmonic exceedances, etc., and trigger alerts Alert thresholds need to be configured separately by device model
    Device Management & Upgrade Service Manage firmware versions, canary strategies, and upgrade tasks Store firmware packages in object storage and record version and signature info

    The interaction between the device and the cloud can be implemented through standardized JSON messages. Below is an example of a device reporting its status:

    1. {
    2. "msg_id": "rpt_20261124_000123",
    3. "device_id": "charger_node_8923",
    4. "timestamp": 1672531200000,
    5. "metrics": {
    6. "voltage_mv": 5000,
    7. "current_ma": 3000,
    8. "temp_celsius": 42.5,
    9. "pwm_freq_hz": 150000
    10. },
    11. "status": "CHARGING",
    12. "anomaly_flags": ["ACOUSTIC_NOISE_DETECTED"]
    13. }

    Example of the cloud dispatching a scheduling command:

    1. {
    2. "msg_id": "cmd_98765",
    3. "action": "ADJUST_POWER_PROFILE",
    4. "params": {
    5. "max_power_w": 15,
    6. "pwm_freq_shift_khz": 20,
    7. "reason": "NOISE_MITIGATION_AND_THERMAL_LIMIT"
    8. },
    9. "expire_at": 1672534800000
    10. }

    The meanings and processing rules for the message fields are as follows:

    • msg_id: Unique identifier for each message. The device side needs to record recently processed message IDs and directly return results for duplicate commands without re-executing them to ensure idempotency.
    • timestamp: Millisecond-level timestamp, used for sorting and time-series analysis. When the device clock is inaccurate, the cloud should correct it based on the reception time.
    • anomaly_flags: Anomaly flags. It is recommended to define fixed codes for each type of anomaly and maintain a code document to avoid inconsistent meanings across different versions.
    • expire_at: Command expiration time. The device should ignore expired commands to prevent old power strategies from being mistakenly executed after network recovery.
    • Retry Strategy: When cloud dispatch fails, use exponential backoff retry, gradually increasing the interval each time, and set a maximum number of retries. If the limit is exceeded, it should be reported to the operations system for manual handling.

    Most public clouds offer IoT access, message queues, object storage, and time-series database services. Teams can choose specific products based on their existing cloud environment and operations capabilities, and evaluate the availability, billing methods, and data compliance requirements of different services separately.

    Conclusion and Outlook

    Full-mode OTA allows devices to adjust power control logic after leaving the factory, providing an opportunity to resolve certain acoustic noise and efficiency issues. OTW enables devices to report status and receive commands, allowing the cloud to make dispatch decisions based on operating conditions. Together, these help extend the device’s lifecycle and reduce hardware obsolescence caused by protocol updates.

    The effectiveness of this solution depends on the quality of implementation. The upgrade link must have signature, anti-rollback, and rollback mechanisms, and power supply during upgrades must be reliably guaranteed. Firmware frequency adjustments also require thorough EMI, efficiency, and temperature rise testing on the target model.

    In the future, edge computing and large language model (LLM) technologies may give charging devices more local judgment capabilities. However, such capabilities have specific constraints in terms of latency, computing costs, and data security, requiring item-by-item evaluation based on actual scenarios before being directly promoted to all products.