Under the Hood: The Physical Wiring of the UPS Supervisor

Saurab ThakurSaurab Thakur
7 min read

When you look at the UPS Supervisor V2.0 from the outside, you see a sleek digital dashboard and a massive battery bank. But if you unscrew the metal casing and look inside, it looks like a scene from a sci-fi movie. Glowing LEDs, tiny microchips, massive power relays, and a spiderweb of jumper wires.

If you have never built a custom electronics project before, looking at the physical wiring can be incredibly intimidating. How does a tiny, 3-volt microchip safely control 110-volt wall electricity and massive, heavy-duty lithium batteries?

Let’s strip away the code, grab some wire strippers, and take a tour of exactly how the physical components of the UPS Supervisor are wired together.


1. The Walkie-Talkie Wires: The Dual ESP32s

As we discussed in a previous article, the UPS Supervisor uses a “Split-Brain” design. There are two separate microcontroller chips:

  • The Brain: An ESP32-S3 that handles the Wi-Fi and web dashboard.
  • The Brawn: An ESP32-WROOM-32 that actually flips the physical switches.

These two chips sit side-by-side on the circuit board. But because the Brawn has no Wi-Fi, the Brain has to physically tell it what to do. They communicate using a “UART Bridge.”

Wiring a UART bridge is surprisingly simple. You only need three wires:

  1. Ground to Ground: A black wire connects the ground pins of both chips so they share the same electrical reference.
  2. Transmit to Receive (TX to RX): A green wire goes from the Brain’s “Mouth” (Transmit pin) to the Brawn’s “Ear” (Receive pin).
  3. Receive to Transmit (RX to TX): A yellow wire goes the opposite way, from the Brain’s “Ear” to the Brawn’s “Mouth.”

That’s it. It acts exactly like a tin-can telephone string between two treehouses. When you click a button on your phone, the Brain whispers the command across the TX wire, and the Brawn hears it instantly on its RX wire.


2. NPN Transistors: The Tiny Muscle

Here is a major problem: an ESP32 microchip can only output a tiny, incredibly weak 3.3-volt electrical signal. If you try to wire that directly into a massive, heavy-duty industrial relay, nothing will happen. The microchip doesn’t have the strength to flip the heavy mechanical switch.

To solve this, we use an electronic component called an NPN Transistor.

Think of a transistor as a water faucet. The main pipe has plenty of heavy, strong 12-volt electricity waiting to flow into the relay. But the faucet handle is closed. When the tiny ESP32 wants to turn on the relay, it sends its weak 3.3-volt signal to the transistor’s “Base” pin. This tiny signal is just strong enough to turn the faucet handle. Suddenly, the strong 12-volt electricity rushes through the transistor and violently clicks the heavy relay on.

By wiring NPN transistors between the ESP32 and the relays, the tiny brain can safely command massive amounts of physical electricity.


3. The Power Directors: Solid State and Latching Relays

The relays are the actual gatekeepers of the electricity in your server rack. The UPS Supervisor uses a combination of different relay types, specifically chosen for their jobs:

Solid State Relays (SSR)

For controlling the AC power to the studio monitor speakers or the battery chargers, we use Solid State Relays. Unlike traditional relays that have moving metal parts that physically “click” together, SSRs have absolutely no moving parts. They use light to silently connect the circuit.

  • Wiring: The NPN transistor sends 12V to the input side of the SSR. The output side is wired directly inline with the live AC wire going to your speakers. When the SSR activates, the music flows.

The Latching Relay

This is the heart of the UPS. The latching relay controls the main heavy power flowing from the massive LiFePO4 batteries to your TrueNAS server and PC. Standard relays require constant electricity just to stay “on.” A latching relay is different. It only requires a tiny, split-second zap of electricity to snap open or closed, and it stays locked in that position using magnets.

  • Wiring: The Brawn sends a split-second pulse through the transistors to the latching relay’s coil. The relay violently snaps closed, locking the heavy-duty battery cables together. The Brawn then immediately cuts the pulse, saving battery power while the rack remains fully energized.

4. The Grid Sensor: The Optocoupler

How does the tiny 3.3V microchip know if the 110V/220V power grid has died? We can’t wire wall electricity directly into the chip—it would explode.

We use an Optocoupler, which is essentially a tiny sealed box with an LED lightbulb and a light sensor inside.

  • Wiring: We plug a standard 5V USB phone charger into the wall outlet. We wire the USB cord into the optocoupler’s LED. If the grid is on, the LED turns on. On the other side of the box, the microchip’s “eye” (the light sensor) is wired to a GPIO pin. Because there is only light passing between them, the dangerous wall electricity is physically and perfectly isolated from the fragile microchips. If the light goes out, the Brawn instantly knows the grid has failed.

5. The End Devices: Batteries, Servers, and Chargers

Finally, we have the massive lithium iron phosphate (LiFePO4) batteries and the devices they protect. We wire two completely separate battery banks with their own dedicated chargers:

  • The Heavy UPS Pack & Servers: The massive main battery is wired directly into the input terminals of the main Latching Relay. The output terminals of this relay are wired via heavy-gauge cables straight into the power supplies of your TrueNAS server and your Desktop PC. When the relay is closed, the servers receive raw, unfiltered battery power.
  • The Network Pack & Internet Gear: The smaller, secondary battery is wired into a smaller SPDT (Single Pole Double Throw) relay. The output of this relay is wired directly into the DC barrel jacks of your Wi-Fi router and internet modem. When the grid fails, the Brawn cuts the Heavy UPS Pack after safely shutting down the PC and NAS, but the SPDT relay remains locked onto the Network Pack, ensuring your house has Wi-Fi for hours.
  • The Battery Chargers: How do the batteries recharge? We use dedicated Pro-Range AC-to-DC chargers plugged into the wall. However, we don’t leave them on 24/7. The grid power flows through dedicated Solid State Relays (SSRs) before reaching the chargers. The Brawn monitors the battery voltages, and when they drop too low, it clicks the SSRs on, flooding the chargers with grid power to top up the packs. Once full, the SSRs cut the grid power, preventing overcharging and saving electricity.

Conclusion

Building a custom UPS Supervisor requires stripping wires, soldering transistors, and understanding how to safely isolate high-voltage electricity. By bridging two microchips with a UART wire, using NPN transistors to boost their signal, and routing power through smart relays, you create an incredibly robust, deeply customized physical machine that off-the-shelf UPS units simply cannot match.


From this Series

More from the Blog

Share this article

You might also like

Table of contents