Year 2 Archives - Madhav Gulati https://madhavgulati.com/tag/year-2/ Sat, 05 Oct 2024 23:00:25 +0000 en-US hourly 1 https://wordpress.org/?v=6.7 https://madhavgulati.com/wp-content/uploads/2024/09/cropped-Group-32x32.png Year 2 Archives - Madhav Gulati https://madhavgulati.com/tag/year-2/ 32 32 Fixing USB-C Charging Port for LED Desk Lamp https://madhavgulati.com/fixing-usb-c-charging-port-for-led-desk-lamp/ Thu, 03 Oct 2024 18:05:25 +0000 https://madhavgulati.com/?p=201 When I started my freshman year at college, I was excited to move into my own space that I could decorate and be creative with, and have a start a new life in my dorm room at Georgia Tech. I did a lot of shopping for decorations for my wall and desk. I wanted to […]

The post Fixing USB-C Charging Port for LED Desk Lamp appeared first on Madhav Gulati.

]]>
When I started my freshman year at college, I was excited to move into my own space that I could decorate and be creative with, and have a start a new life in my dorm room at Georgia Tech. I did a lot of shopping for decorations for my wall and desk.
I wanted to get some good lighting for my room, as I’ve heard that built-in dorm lighting may not be enough. After some digging on Amazon, I found a cool desk lamp from COZOO (not affiliated) that, along with a variety of lighting controls, features 2 AC outlets, a USB-A charging port, and a USB-C charging port. I thought this would be a great item to have on my desk so I could easily charge many devices at once.

LED desk lamp from Amazon featuring AC outlets, and USB-A and USB-C charging ports. (Image from Amazon product listing)

When I purchased the lamp, everything worked smoothly and I had no problems with it. I use the USB-A to charge my phone and the AC outlets for my laptop.

The Problem

Recently, while studying for an exam I used my lamp to charge my phone using a USB-C cable. After a few hours of productivity (I promise I didn’t even open YouTube once), I went back to check my phone and saw that it hadn’t charged at all. I tried checking if it was plugged in loose, but there was still no charging indicator. After trying a different cable, and making sure it had to be the lamp, I became curious as to why the lamp wasn’t working as intended.

I took the lamp over to The Hive – one of the on-campus makerspaces – and disassembled the lamp. My first thought was that there was a connection that over time became disconnected from the USB-C port, and I could easily fix it with some soldering.

The LED desk lamp in my room before disassembly.

A Look Inside…

When I unscrewed the base of the lamp, I found a PCB inside that featured all the switches that control the lights, the AC outlets, and the USB-A and USB-C ports.

Internals of the LED desk lamp, showing a PCB with switches and USB ports, and AC outlets.

First, I checked the voltage across the USB-A port to see if there was a voltage, and it came out to ~ +5.24V. For the USB-C port, it was slightly harder to locate the VBUS and GND pins due to the amount of pins, but after looking at the pins, I used a multimeter and found out … there was also a +5.24V voltage across the USB-C. Interesting.

USB Type-A pinout (image credit) vs USB Type-C pinout (image credit)

This eliminates the possibility of a broken connection. But how come my devices weren’t charging from the port? Just as a quick sanity check, I tried charging my iPad using the lamp, and it still didn’t work.

LED lamp not charging an iPad as indicated by the white text in the top right corner of the screen, rather than green to indicate charging.

I decided to make sure that there was a voltage reaching the other end of my USB-C cable, so I plugged in my cable to the lamp, and on the other end used a breakout board to isolate the V+ and GND pins. I measured the voltage again, and got the same +5.24V.

Using a digital multimeter to measure the voltage across the device facing end of the USB-C cable, showing 5V successfully reaching the device-end.

So, the USB-C port in the lamp had a voltage across it, there was a voltage traveling along the cable to the other end… that narrows it down to the device. But the device charged just fine with other power sources.

At this point, I had tested everything I could think of and turned to the internet for answers.

Research

I read about something called USB Power Delivery (PD) – a protocol introduced with USB-C. Essentially, since USB-C can be used to both supply and receive power, there needs to be a negotiation between the lamp and the device on the other end of the cable about which device gets charged, and the power delivery capabilities. My assumption is that for devices that are able to charge with “fast charging” or support PD protocols higher than 5V, they are not able to communicate with the lamp because it lacks full PD support. As a result, the lamp is unable to charge these devices at all despite its basic 5V functionality. I tried plugging in my roommate’s headphones that charge via USB-C and doesn’t have a fast charging protocol, and sure enough, it worked like a charm!

LED desk lamp successfully charging headphones with a USB-C cable, as indicated by the white LED dot.

USB-A on the other hand always outputs 5V by default rather even if there is no power negotiation. As a workaround for my lamp, I tried using a series of adaptors to charge my iPad: USB-C to USB-A, then USB-A back to USB-C, and a USB-C cable to my iPad. Since USB-76A provides 5V output by default, my guess was that the USB-A conversion would remove the need for a power negotiation. I was delighted to see a green charging indicator.

Successfully charging my iPad from the lamp’s USB-C port using a USB-C to USB-A adapter.

As far as a more permanent solution, it is possible to force the USB-C port in the lamp to output 5V (circumventing power negotiation) by pulling the CC1 and CC2 pins to GND. This forces one-directional 5V power from the lamp to the other end. But for now, my adapter solution gets the job done. I’m going to reassembly my lamp and make sure it still works. 🙂

Thanks for reading!

The post Fixing USB-C Charging Port for LED Desk Lamp appeared first on Madhav Gulati.

]]>