I'm building a device for my Steam Deck that will intercept the power from its USB-C charger and connect or disconnect the power to the Deck depending on certain conditions. My problem is I'm kinda new to wiring stuff up and I'm not sure how I could go about this safely.
The main idea behind this project is to consolify the docked experience. I have the BIOS set to turn the Deck on whenever it's shut down and the power is plugged in. I would have an Arduino listen for a Bluetooth controller to start broadcasting and it would then turn on the relay, thus turning the Deck on.
My current plan is to have the USB-C charger power an Arduino Micro, and also have the power coming from the USB-C go to a relay that is controlled by the Micro. Then the power goes from the relay to the Steam Deck for charging.
However, I feel like something is missing from this whole setup. I think somehow I need to handle USB-C Power Delivery, but I'm not sure how I would go about this. Maybe the Arduino should be powered separately, but I would much rather have one plug go to the wall rather than two. I can't power the Arduino off of the Deck's USB port since it won't get power while the Deck is shut down.
Here is a super generic diagram of what I'm thinking so far:
I'll have a Bluetooth module connected to it (haven't decided which yet, I just want to get a proof-of-concept for powering the Deck working for now). It'll simply be looking for an Xbox controller signal, and once it sees one, it'll turn on the relay so the charger connects to the Deck. If the Deck is turned off, it will automatically power on, thanks to the nifty BIOS setting I mentioned.
Later I plan on connecting the Arduino to a USB-A port to emulate a keyboard to handle waking it from sleep, but that's a problem I'll solve after this one.
Your diagram is almost perfect, just label what connections are POWER as in USB-C and which connection is the control to turn the relay on/off. The only problem you may have i the relay may need much more power to turn it on than a pin can deliver. The pin will be 10's of ma, the relay coil could be 10's of ma. Consider a MOSFET instead of a relay or a transistor switch between the arduino and the relay.
@sonofcy I will definitely look into a MOSFET or transistor tomorrow morning, thank you!
@LarryD It's power coming from the wall. The wall wart says it could be any of the following outputs:
5V @ 3A
9V @ 3A
15V @ 3A
20V @ 2.25 A
I'm assuming this is due to the nature of USB-C Power Delivery, since those are all voltages that comply with USB PD. I suppose my main sense of unease now is not knowing how much voltage the Deck will call for. Especially since the Arduino Micro is expecting 5 volts. Maybe the solution in this case is to ignore whatever the Deck wants and just give it 5V @ 3A, since 5V @ 1.5A is the default for USB chargers if it can't communicate what it wants. (At least, that's what I understand from this StackExchange post. Feel free to correct me if I'm wrong!)
I think I can test the Deck's USB PD with some public resources available to me at my college, though I won't have access to them until Tuesday.
I looked into using a MOSFET - my understanding is that MOSFETs don't provide electrical isolation between the control circuit and the load circuit, which could be problematic given the load could be as high as 15V @ 3A (that is, if this Reddit post can be believed about how the Deck charges). I'll put a transistor switch between the Arduino and the relay instead. Thank you for the suggestion!
Now my main issue is figuring out how to deal with the Deck's PD. The Reddit post linked above, combined with the USB PD capabilities of the charger that came stock with the Deck, seem to suggest that the Deck is indeed capable of USB PD. While the Deck charges at 15V while active, the problem is the Deck could negotiate for a lower voltage while it's idle or sleeping, and the Arduino is going to want 5 volts...
I wonder if I even need USB PD, maybe I can just provide the Deck with a steady 5V at all times and let the Arduino share this 5V circuit... If I plug my Deck into a basic wall outlet, it does charge, just slower.