Programmable USB-C Power Supply? - Yes, it's possible! (video, 12m)
The latest video on the GreatScott! channel discusses a common USB-C cable that, when connected from one side to a USB-C charger and from the other to a USB-C PD trigger board, allows you to select an output voltage of 5V, 9V, 12V, 15V, or 20V. This is fantastic as it enables powering portable projects without the hassle of making your own power supply solutions. Although this technology isn’t new, a significant addition is the PPS (Programmable Power Supply) feature, which allows voltage adjustment, as showcased in the video. PPS effectively turns your USB-C charger into a variable lab bench power supply, and its applications are not limited just to smartphones; it can be utilized in various electronic projects to fully leverage USB-C power capabilities.
In the video, GreatScott! discusses the innovations surrounding PPS, explaining how it interacts with microcontrollers and various components. He admits that initially, the long interaction with PPS technology was too complex for him, but thanks to technological evolution and the new AP33772SIC chip, communication with USB power becomes much simpler, translating into easier use of this feature. One of the main players in this area is Santilab, which created a breakout board with a library that simplifies using PPS.
The video provides plenty of interesting information and tips regarding the purchase and usage of hardware for PPS projects. GreatScott! shares his experiences testing various power sources and their outcomes, allowing viewers to understand how different USB-C accessories can collaborate in the context of the PPS system that modern power relies on. For instance, the video reveals that not all adapters can actually support PPS, which may pose a challenge when attempting to set required parameters.
The video highlights voltage and current optimization, a crucial aspect for users seeking efficient charging solutions for batteries. GreatScott! demonstrates how to set up a device to monitor and adjust voltage in constant current mode. This functionality is especially significant for charging LiPo batteries, where reliability is key. With proper calibration, you can accurately control charging cycles, which greatly enhances battery longevity.
Finally, the statistics of this episode are impressive. At the time of writing this article, the video has reached 546,061 views and garnered 20,605 likes. With such positive reception, it certainly contributes to a greater awareness of PPS and other modern technologies within the DIY community. Once again, GreatScott! combines education with practical tips for creators and electronics enthusiasts.
Toggle timeline summary
-
Introduction to USB-C cable with PD trigger board.
-
Explains selectable output voltage options for portable projects.
-
Introduces the Programmable Power Supply (PPS) feature.
-
Discusses how smartphones use PPS for variable charging voltage.
-
Describes additional features like voltage and current monitoring.
-
Introduction to JLCPCB as a PCB manufacturer and sponsor.
-
Details about JLCPCB's promotional offers and services.
-
Explains the limitations of PD compared to PPS.
-
Mention of challenges in using microcontroller code for PPS.
-
Introduction of the AP33772SIC, a new sync controller for USB PD.
-
Discussion about a breakout board from Santilab for easier use of PPS.
-
Demonstrates display profiles function utilizing the breakout board.
-
Experiment with outputting fixed PD voltage and current limits.
-
Showing how to select a variable PPS voltage with appropriate commands.
-
Contrasting previous testing with the current capabilities of the breakout board.
-
Explains successful implementation of constant current and voltage modes.
-
Differentiates between PPS and Adjustable Voltage Supply (ABS) features.
-
Notes on the availability of supporting power supplies for ABS.
-
Encourages viewers to explore DIY options for working with the IC.
-
Closing remarks urging viewers to like and subscribe.
Transcription
Now this is an ordinary USB-C cable and by connecting it on one side to a USB-C charger and on the other side to a USB-C PD trigger board, you can select between an output voltage of 5V, 9V, 12V, 15V or 20V. Which is awesome because this way you can easily power your portable projects without having to worry about making your own power supply solution for them. But let's be honest, this is not new. I mean I've been powering tons of my projects this way for years. But what is relatively new is the PPS feature which stands for Programmable Power Supply. Right now the only real life application I got utilizing it is my smartphone while super fast charging. What it does is basically turning my USB-C charger into a variable lab bench power supply with adjustable voltage because as you can see here, my phone dictates exactly what voltage it requires for charging. But not only smartphones can use PPS because by using the right hardware you can use it too and thus get the most out of your USB-C power sources like a variable voltage, a current limit, current and voltage monitoring and quite a bit more. So let me show you how it works and how you can easily use it too. Let's get started. There are many PCB manufacturers on the market but only few offer a complete in-house production process like JLCPCB does who are the sponsor of this video. They do it all for you and by that I mean they produce your PCBs, source the components and do the PCB assembly which is all possible due to their smart factories. This ensures consistently high quality, low costs and super fast lead times. For example you can get 1-8 layer PCBs for just $2 that ideally arrive at your place within a week. And to make this deal even better JLCPCB recently launched new discounts in their coupon center including PCB services, CNC machining and mechatronics parts. So don't miss out, click the link below and give them a try. Now first off we have to understand that while such USB PD trigger boards are commercially available there are no decent PPS boards in the big online stores yet. And in case you're wondering with PD you can only select a fixed voltage value that comes with an absolute max current of 5A. But with PPS you can select a variable voltage between most of the time 3.3V to 21V in 20mV increments and you can even set a current limit that can be adjusted in increments of 50mA. This sounds pretty neat. And of course in order to set the voltage and current we have to talk to our USB-C power source. The PD trigger boards does that by utilizing a common microcontroller in combination with the FUSB302 USB Type-C controller. I actually tried something just like that in a previous video which did work out in the end. But back then I realized that the code for the microcontroller was very complicated for me because in this case the microcontroller does all the talking and the additional IC basically only translates it to USB-C language. So communicating PPS like that would be impossible for me. But luckily technology evolved and nowadays we got the AP33772SIC which is a USB PD 3.1 sync controller. This thing talks to microcontroller through the I2C bus and all you have to do is set the PD mode, send over the voltage and current value and it does all the heavy lifting for you which makes everything much simpler. They even give you a typical application schematic that should not be that hard to turn into a PCB. However I didn't have to do that and you also don't have to do that because someone else already did and created this breakout board. I'm talking about Santilab who actually reached out to me because not enough people are knowing slash using PPS and I was one of them. And best of Santilab already created a library for this IC meaning we don't have to deal with I2C programming and can use way easier commands. So let's try it out by connecting the power and I2C pins of the board to an ESP32 like shown here. Now after installing the library for the IC I first wanted to try out the display profiles function. So after uploading that and connecting my USB-C charger we can see on the serial monitor its 5 PD profiles with their max current and the 6th profile which is PPS that comes with this voltage range and max current. Those values correspond exactly with what is written on my power supply so no surprise here. But many times manufacturers do not share all details like with my power bank here that according to its label only comes with PD profiles at 3A max and no PPS. But after connecting it to the circuits and pressing reset we can not only see that it comes with a maximum current of 5A instead of 3A but it also supports PPS. Awesome! But before getting to that I tried outputting the 15V fixed PD voltage by simply using this command with the 4SD 15V profile and a max current of 1A. After uploading this we immediately get the requested voltage which does in fact come with a current limit of 1A. However, the power bank is still turned on and outputting 15V. What cut the current instead was the output of the breakout board by utilizing these two MOSFETs here which is a pretty neat feature to have. This current limit is by the way not present when using the more common PD trigger boards. There it only stops when you reach the maximum current the supply can output. But anyway last but not least let's move on to selecting a variable PPS voltage by turning on the output and using this command where we define the PPS profile number, the output voltage and the max output current. And yes, after uploading we get our desired voltage. What didn't go according to plan though was the set current limit because the power supply didn't care about that and outputs up to 2A before resetting the voltage back to 5V. I tried lowering the current limit even more and switching over to my USB-C charger instead of the power bank but nothing did the trick and the current limit simply got ignored. At this point I thought that my power supplies are simply too old and thus do not support a constant current mode in which the output voltage gets lowered until we reach the set current limit. But other sources claim that PPS doesn't directly enforce a constant current mode meaning our breakout board has to monitor the current and adjust the voltage accordingly. Before doing just that though I tried the current-slash-voltage monitoring with this piece of code that also automatically turns off the output when more than 1A is flowing. And to my own delight that worked perfectly fine even though it is noteworthy that the current measurement is not really super precise and apparently comes with a resolution of 25mA. And speaking of resolution, I later tried finding the max resolution for the voltage adjustment and it seems like it is 100mV aka 0.1V. This is a bit more than what the USB-C PPS standard claims but basically the max the IC offers. And with all of that out of the way I created my so far last piece of code for this board that basically monitors the current and adjusts the voltage accordingly so that we can perfectly charge up a LiPo battery. After uploading that and hooking up a battery it seems like my 1A constant current mode works just fine which then transitions into a constant voltage mode at 4.2V and then cuts the output once the current drops to 100mA. Very nice. This is basically what my smartphone does as well with this PPS feature and this way they do not have to include an additional beefy DC to DC converter in the phone that eats up space and creates heat due to losses. So all in all this IC and breakout board is pretty awesome considering all the features it offers. And I couldn't even cover all of it because I was not able to test the ABS feature which stands for Adjustable Voltage Supply. And yes, I was confused too because what is the difference between PPS and ABS? You see in the old days we only got the standard power range that was basically limited to an output power of 100W and that is where PPS is taking place. But with USB PD 3.1 we now also got an extended power range that goes up to 240W and that is where ABS takes place. It is more or less the same as PPS but comes with even bigger voltage and current steps. The only power supply that currently supports this though is from Frameworks which I didn't get my hands on but it already got tested successfully with this IC and board. So if you're interested in getting one then you can find links in the video description. And if you want to go the DIY route then Santilabs also shares the Gerber and BOM files meaning you can order your own PCBs and required components. Either way, I think having this IC around will be helpful in the future. And I'm really happy that this PPS stuff got introduced to me and hopefully you also enjoyed watching this video. If so, then like always don't forget to like, share, subscribe and hit the notification bell. Stay creative and I will see you next time.