Usb type c chagrer board diy 2020
Type C charger DIY 2020

Hi there, you might have already noticed it but let me tell you that I love USB Type C. Charger. The main reason for this love is called Paka Power Delivery.


As an example if I take a Powerbank that features a USB Type C Input/Output and support for power delivery then it cannot only output the classical 5V but also 9V, 12V, 15V and even sometimes 20V with up to 5A of currentso 100W of power.


In short that means I no longer have to worry about coming up with complicated battery power sources for portable projects becauseI can simply get a USB Type C PD Powerbank and you know be done with it. The only problem is that by just connecting up a USB Type C cable, the Powerbank only spits out 5V. So we need such a USB Type C PD trigger board which you can get for cheap from the Internet.


Iphone 11 Experiment 2020 : Will Shock You


By hooking it up we can basically select the output voltage with the help of a push button. But while using this PCB I started to wonder how exactly it functions and whether it is possible and whether it makes sense to DIE such a circuit which is what we will be finding out in this episode of DIY or Buy.


Let’s get started! First off I had a closer look at the commercial PCB in order to better understand how it could function. It apparently comes with two important ICs. The first one is an STM32F03 microcontroller which probably not only detects the push button input and lights up the RGB LED but it probably also communicates with the USB Type C interface used by the power bank.


At this point though the function of the second IC was unclear to me since I could not find any information about it by googling its label. So what I did next for my investigation was buying myself these two USB Type C breakout boards.They feature the most important pins out of which we are pretty much only interested in the VBus and GND pins which are obviously necessary for the power and also the CC1 and CC2 pins which are the configuration channels.


Marshmello Helmet Experiment 2020


Like I already described in my “Why USBType C is awesome” they are used by the sink to negotiate what kind of voltage the source should supply. So to observe what happens on those lines,I used some wire to connect VBus to VBus, GND to GND, CC1 to CC2 and vice versa.


After then using two USB Type C cables to connect the powerbank and the USB Type C PD trigger board, it seemed like there was a problem indicated by the flashing red LED. Even switching the CC wires around did not help in this case but luckily I had another USB Type C PD power bank laying around which after hooking it up, wanted to cooperate with my setup.


That means it was time to connect my oscilloscope probes to the CC lines and press the push button a few times in order to record the sent over data. Like expected we got a data communication between the sink and the source on one of the CC lines. So my first idea was to simply copy this data transmission and let another microcontroller send it out in order to select a certain voltage but there were two rather big problems with this idea.


The first one is that with such a data communication on the oscilloscope we cannot know for sure which part of the communication is sent out by the source and the sink and thus obviously we cannot use it all for the sink message. Instead we need more information about the USB Type C PD communication protocol but more about that later because the second problem was even more important.


Best Gaming Live Streaming Setup 2020 : For 120FPS Live Stream


As you can see the measured logic levels are not standard voltage values and the used protocol seems overall a bit unique. So simply using a microcontroller to talk to the USB Type C PD source would not work with something in-between which probably is why the commercial board got a second IC.


Maybe it translates the sent out data of the microcontroller into USB Type C compatible language, which actually sounded familiar to me. As you might remember I got this USB TypeC development kit a while ago and in it we can find three different boards based around three different ICs whose job is like already suspected to talk with a USB Type C interface.


But those boards were obviously huge in comparison to the commercial PCB which is why I started searching for my personal favorite USB TypeC IC and what I found was the FUSB302. I chose this one not only because it fulfills all the basic functions of such an IC but also because other people already played around with it which means I do not have to do the groundwork.


First off though I needed a PCB for this which means I had to start off by creating a schematic which was super simple to do because the datasheet of the IC gives us a reference schematic along with recommended values for the components. All I basically added was a screw terminals for the Bus Voltage and male headers to breakout the I2C interface.


How to solve 3x3 rubik cube 2020


Next I designed a suitable PCB for the components which was also pretty straightforward to do and thus quickly done. And just like that I got a finished PCB design which I obviously ordered through JLCPCB, and after a week of waiting I received myPCBs along with all the components. Now if you are interested in how I soldered all those tiny components to the PCB then definitely make sure to watch my previous video about reflow soldering.


So as soon as all the components found their place on the PCB, I connected the I2C breakout pins of the IC to an Arduino Nano according to this wiring scheme. After then hooking the Arduino up to my computer and connecting the USB Type C PD power bank it was time to write a bit of code.


According to the datasheet of the FSUSB302,it supports USB Power Delivery to be communicated over the connected CC pins and it integrates thin BMC PD client with its FIFO register which sounds complicated at first but what we simply have to do is to send the correct USB Type C PD Voltage data to this register and it basically does the rest.


Finding out what data to send over though was much harder because if we visit USB.org and download the latest USB PD specification then we get a pdf file with over 600 pages and finding the information I was looking for was everything but easy.


And while searching for a more clear solution to this problem I found reclaimer labs which not only showed an example of such a USB PDcommunication but he also sells an interesting USB-C Explorer board as well as a breakout board based around the FUSB302.


So through with the help of some of its example code uploaded to the Arduino Nano, it was possible to select the highest output voltage of the powerbank which was 15V and also a great start. But what I wanted was a push button attached to the Arduino which I can use to select between the different output voltages.


The only problem was that his code was way too difficult for me to understand which is why I reached out to him and luckily he helped me with my projects. Here is the code that he sent me which as you can see clearly shows that USB PD negotiation is not really a simple subject.


But anyway after uploading this code to theArduino we can see that it does not really work. The reason is that there is not enough SRAMwhich is why I grabbed myself an ESP8266 board, edited the code a bit and connected the board to my breakout board according to this scheme before I uploaded the code to the ESP.


And as you can see, due to the bigger SRAM ofthe ESP, everything works fine which brings me to the conclusion of this video. I hate to say it but just due to the sheer complexity and required space of the USB Type C PD negotiations I have to say that Buy is this time the winner.


And with that being said I hope you still enjoyed this article. If so don’t forget to comment, share. Thank you.

Post a Comment

Previous Post Next Post