Update : Now I'm using a Smart Lowside Power Switch HITFET BSP 75N Better and less confusing than the transistor switch.

I have a power supply (PSU) (not standard computer ATX PSU) PSU EPP-300 is at https://www.meanwell.com/productPdf.aspx?i=715 with function connector:

  • 5VSB
  • DC COM
  • PS-ON


function connector

If I'm right: DC-COM = GND, 5VSB is same as VCC

As I understand and tested: the PS-ON should be either connected to DC-COM or 5VSB.

By using a SPDT toggle switch I can switch the PSU on and off.

PS-ON to 5VSB switch PSU ON.

PS-ON to DC-COM switch PSU OFF.
Not connected PS-ON switch PSU ON. 

Now the problem is : I would like to implement an electronic switch to toggle between DC-COM and 5VSB to PS-ON. This is essentially a same as SPDT relay switch. The logic level will be controlled by a microcontroller (ESP32).

Best I could come up is to use a 2N2222 transistor to switch the 5VSB to PS-ON.

For this I had to pull-down PS-ON to DC-COM with a 39k resistor. Without a 39k resistor, the PSU will switch on immediately.

Do you think this is a good solution? I'm hesitant to connect PS-ON to DC-COM via a 39k resistor, while at same time the 2N2222 will supply 5VSB to PS-ON.

How can I better implement a toggle switch by transistor or IC?

I found TS5A3157 10-Ω SPDT Analog Switch. I'm not sure if TS5A3157 would be good to switch between DC-COM and 5VSB.

New update .: Best I could come up is : 2N2907

Internally in the PSU ,PS-ON is pulled up to 5VSB. Current flows through 2N2907 because the base is pulled down with a 10k resistor. The PS-ON is pulled down . If the base is pulled up (connect base to 5VSB) ,then the current stops flowing and PS-ON will be pulled up (internally).

  • 1
    \$\begingroup\$ What sort of PSU? With a standard ATX supply you connect PS_ON to DC COM (i.e. GND) to turn it on. \$\endgroup\$
    – Finbarr
    Sep 6, 2023 at 10:47
  • \$\begingroup\$ In which case PS_ON is pulled up to 5VSB internally with a resistor. You can just use an NPN BJT with e.g. a 1K base resistor or an N-channel MOSFET. \$\endgroup\$
    – Finbarr
    Sep 6, 2023 at 11:06
  • \$\begingroup\$ Thanks @Finbarr .Yes PS-ON should be internally pulled up . I tried and works . : NPN BJT (2N2222) . 10k Base resistor . Emitter to DC-COM . Collector to PS-ON. Normally PSU ON . If I connect base to 5VSB , then PSU switch OFF. \$\endgroup\$
    – g1ra
    Sep 6, 2023 at 11:44
  • \$\begingroup\$ I did pulled up a base of 2N2222 via 10k resistor . So the PSU will not power on . \$\endgroup\$
    – g1ra
    Sep 6, 2023 at 12:01
  • \$\begingroup\$ I don't want to start a PSU by default . Maybe I should use a PNP BJT such as 2N2907 . Emitter to PS_ON , and Collector to DC_COM . Base to 10k resistor connect to microcontroller bus signal . \$\endgroup\$
    – g1ra
    Sep 6, 2023 at 12:13

1 Answer 1


Since it is a standard ATX power supply, it will internally pull PS_ON weakly high to 5VSB and you need to pull PS_ON strongly to ground to turn it on.

As you have a microcontroller with 3.3V level output that does not tolerate 5V, I do not recommend driving the PS_ON directly with the MCU. Some MCUs can tolerate 5V on their pins so those can drive the PS_ON directly.

The 2N2222 is a bit excessive for the job but it should work fine.

Connect emitter to ground and collector to PS_ON. Put a 10k between MCU output and base. You may put a 10k pull-down from base or MCU pin to ground to make sure there is no leakage to turn on the transistor while MCU is not driving the pin.

Also note that some MCUs have pins that need to be pulled high or low to boot into correct mode, so obviously using these pins to drive the transistor may not be right pins. They may prevent the MCU from booting ot they might start the power supply before your code can turn it off, or what's worse, both.

  • \$\begingroup\$ Turned out that the PSU is not standard ATX. this is EPP-300 meanwell.com/productPdf.aspx?i=715 . PS-ON need to pulldown to DC-COM to turn OFF . By default the PSU starts . Must be internal pullup PS-ON \$\endgroup\$
    – g1ra
    Sep 7, 2023 at 9:38
  • \$\begingroup\$ Yes the microcontroller (MCU for short) is 3.3V output . Can I drive a NPN BJT (2N2222) base pin with a 3.3V output from a MCU ? \$\endgroup\$
    – g1ra
    Sep 7, 2023 at 9:43
  • \$\begingroup\$ @g1ra I wrote in my answer the instructions how to do it. So there is no need to ask if it is possible. \$\endgroup\$
    – Justme
    Sep 7, 2023 at 10:16
  • \$\begingroup\$ ok . @justme understood . MCU through 2N2222 is not direct \$\endgroup\$
    – g1ra
    Sep 7, 2023 at 13:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.