Urgent.News

What's breaking now, across thousands of outlets.

Tech

Shipping 6,300+ 35A Smart Breakers: PCB, Firmware and Cloud Lessons

A smart breaker looks simple from the outside. It switches mains power, measures how much energy passed through it, shows a number on a small display, and sends that number to a cloud dashboard. It is also one of those products where every layer has to be right at the same time. A firmware bug is not a UI glitch — it is a device inside a customer's distribution box. A calibration error is not a…

A smart breaker appears simple from the outside. It switches mains power, measures energy flow, displays that energy in kWh, and sends the data to a cloud dashboard. However, every layer of the product must work together seamlessly. A firmware bug is not a UI problem - it can cause device failure in a customer's distribution box.

A calibration error is not just a rounding issue - it can lead to billing disputes. The product has shipped over 6,300 units. The engineering choices behind the smart breaker are critical and inform similar connected mains products.

The product operates on an AC 100-250V input, with a 35A rating for mains switching using a relay drive. It meters energy consumption in real-time and reports it every 30 seconds. The device features a local display and physical controls, ensuring usability even without a network. The ESP12S (ESP8266) microcontroller with a 2.4 GHz radio handles the MQTT uplink. The cloud API allows for device data exchange.

The PCB design splits into two layers for a reason. The top layer houses the ESP12S module, its antenna, MCU-side circuitry, and user interface. Meanwhile, the bottom layer accommodates the AC-DC supply, current sampling circuitry, and relay drive. This separation prevents high-energy mains switching and current sensing from interfering with the radio and display functions. It simplifies routing and debugging, as well as antenna placement.

Mechanical stack considerations are crucial too. With only two layers, board layout dictates isolation strategies. Multiple boards, displays, terminals, and the mains section must fit within a single housing. Proper spacers are necessary to accommodate assembly variations, ensuring the device can be assembled 6,000 times without issues.

The firmware incorporates four crucial decisions. First, metering is a calibration problem, not a driver problem. Each unit has unique components, references, and parasitics, so calibration must be implemented during manufacturing rather than in a one-time lab script. Incorrect calibration can result in permanent issues in the field.

Second, a 30-second data reporting cadence balances product usability with network load management. Reporting every 30 seconds provides a live dashboard feel while minimizing unnecessary traffic. Timestamps are assigned to the sample measurement for consistency. Third, offline conditions are the normal state for the product. Firmware must handle disconnections gracefully, including bounded buffering and reconnecting with backoff protocols.

However, safety-critical functions like switching, displaying energy, and metering must remain local even when offline. Lastly, over-the-air (OTA) updates and a safe mode are integral to the product, not just an after-thought. This ensures firmware changes can be deployed after installation, with a reliable fallback mechanism in place.

Production considerations differ from prototype testing. Production demands ensure the six-thousandth unit behaves identically to the first. Prototype validation focuses on "does it work?" whereas production requires answering "does the six-thousandth unit behave like the first?" Boring, yet essential aspects include calibration fixtures, end-of-line functional tests, and a mechanically robust design that tolerates assembly variations. Early PCB design should incorporate test points and interfaces for easier debugging and testing.

Looking back, the author would have frozen the telemetry contract earlier in the development process. Defining the topic, payload, units, timestamp semantics, and offline behavior before finalizing the PCB allows for independent evolution of firmware and cloud components. This approach enables effective field issue diagnosis through telemetry data, reducing reliance on phone calls and facilitating smoother updates and maintenance.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Stripe Billing or Chargebee: The Renewal Decides

Comparisons between Stripe Billing and Chargebee usually start with feature grids: proration, tax handling, revenue recognition, portals. Those grids matter when you are choosing a billing platform.

  • Stripe Billing excels in native payment processing, managing retries seamlessly.
  • Chargebee offers complex catalogues, grandfathered pricing, and tailored dunning emails.
  • The renewal process reveals which platform handles issuer issues and operational problems better.

How we test promo codes with a checkout bot that is not allowed to pay

Most coupon pages never tell you whether anyone tried the code. On Kuponaut, a small site that lists discount codes and prices for AI and SaaS tools, every code carries a label that says how we know…

  • Kuponaut bot tests promo codes without paying, documenting results with dates
  • Bot programmed to never enter payment info, CAPTCHAs, or auto-complete steps
  • Initial failures due to bot's prior account session, now flagged for manual review

How to Hide the Taskbar on Windows 11

Learning how to hide the taskbar on Windows 11 is useful when you want more screen space, enjoy a cleaner desktop, or concentrate on your work without distractions.

  • Open Windows 11 Settings by clicking Start or pressing Windows key + I
  • Navigate to Taskbar configuration in Personalization menu
  • Enable automatic hiding of taskbar via checkbox in behaviors section

A New JsonSerializerOptions Every Call Cost Me 120x

A list endpoint on one of my services started showing up heavier in the traces than it had any right to be. It pulled a small object, serialized it, returned it.

  • Creating a new JsonSerializerOptions object for each call caused performance slowdown.
  • Reusing a single cached JsonSerializerOptions instance improved performance 120x.
  • Moving JsonSerializerOptions creation outside the method optimized memory allocation 42x.

More from Saturday 7 November →