When building your own ESPHome sensors and nodes using the popular ESP8266 or ESP32, you will quickly come to realize that there are three main voltages used in such projects: 3.3 V, 5 V, and 12 V. Generally though, you will only be using a single power supply for the finished project, even if you’re working with multiple voltages. That is why DC-DC buck converters exist.
While there’s nothing wrong with wiring everything up while prototyping of your project, it’s much easier to use a bench power supply for testing purposes. That way you can exclude any power circuit until it is time to build the finished product. The downside of a bench power supply is that they are heavy, bulky, and can cost a pretty penny.
It doesn’t have to be that way because you might already have the perfect bench power supply for your ESP8266 and ESP32 projects lying around and collecting dust somewhere in your home. Any old ATX computer power supply will do the job as they output 3.3 V, 5 V, and 12 V. You won’t have to modify the power supply at all for this to work and if you’re on a budget, all you need is a bit of wire to get started.
Why an ATX power supply is perfect for ESP32 and ESP8266 projects
There are a few reasons why I consider ATX power supplies to be perfect for projects using an ESP32 or ESP8266. For starters, you can buy them for relatively little money, especially if you scour the second-hand market. ATX power supplies generally have a large fan, keeping all the components cool while not being all too noisy. Bench power supplies will often use a miniscule fan which has to spin fast to keep up.
Finally, what might be a downside for more experienced makers, but, for me personally is an upside, you only get what you need. You don’t have to twist any knobs or adjust and levers. All you get is clean 3.3 V, 5 V, and 12 V. Nothing more and nothing less.
Decoding the 24-pin ATX power supply connector
The only connector needed for this ATX to bench power supply conversion is the largest one with 24 pins. The one you would usually be plugging it into the motherboard of your computer. You will notice that the wires leading in to the 24-pin connector are coloured differently. Orange cables carry a +3.3 V signal, red cables carry a +5 V signal, and yellow cables carry a 12 V signal. Which cable you choose has no influence on the outcome, as long as you make sure you have the right colour. The black wires all lead to ground.
You will notice a few more coloured cables (namely purple, grey, brown, and green) of which only the green one is of interest to us. Why that is so will be next.
How to power on an ATX power supply
At this point you might be liking the idea of using your old ATX power supply for your ESP8266 and ESP32 projects, but you might be asking yourself one thing: How does one turn on an ATX power supply without a motherboard being attached to it? The answer is, you simply bridge the green wire (there is only one) and any black wire (ground).
I suggest you leave the ATX power supply switch turned off or simply unplugging it from the wall. You can then insert a short wire in to the two pins. Make sure it sits there firmly, as you will want it to stay there. With the wire inserted, you will be able to turn the ATX power supply on and off using the switch on the back.
A more elegant solution
If fiddling around with wires isn’t your thing, there is a more elegant solution available. You can buy a board into which you plug in the 24-pin connector. You will often find these with the descriptor XH-M229, and they have some added benefits: A power indicator LED, an on/off switch, individual and easy-to-access connectors for the different voltages, and a fuse for each set of connectors which could potentially save your boards.
- 【 4 Output Voltages 】 Providing quick access to 4 sets of typical output voltages, which including: 3.3V, 5V, 12V and -12V.
- 【 24 Pin 】 Standard 24pin ATX port.With power indicator for easy reading and power switch for turning on and off, ideal for DIY. Low voltage power supply suitable for developing physical computing projects (embedded systems).
- 【 With Replaceable Glass Fuses 】 Each output channel has replaceable 20A glass fuse and corresponding ground binding posts for easy connection.
As you’d expect, there are plenty of 3D models to be found with which you can make your setup prettier and potentially saver by covering up exposed wires. The XH-M229 can also be found for sale on AliExpress where it will cost you less than $3.