Hacking A Cheap Rechargeable Lamp With Non-Standard USB-C Connector

The "USB C" cable that comes with the Inaya Portable Rechargeable Lamp. (Credit: The Stock Pot, YouTube)
The “USB C” cable that comes with the Inaya Portable Rechargeable Lamp. (Credit: The Stock Pot, YouTube)

Recently [Dillan Stock] over at The Stock Pot YouTube channel bought a $17 ‘mushroom’ lamp from his local Kmart that listed ‘USB-C rechargeable’ as one of its features, the only problem being that although this is technically true, there’s a major asterisk. This Inaya-branded lamp namely comes with a USB-C cable with a rather prominent label attached to it that tells you that this lamp requires that specific cable. After trying with a regular USB-C cable, [Dillan] indeed confirmed that the lamp does not charge from a standard USB-C cable. So he did what any reasonable person would do: he bought a second unit and set about to hacking it.

[Dillan] also dug more into what’s so unusual about this cable and the connector inside the lamp. As it turns out, while GND & Vcc are connected as normal, the two data lines (D+, D-) are also connected to Vcc. Presumably on the lamp side this is the expected configuration, while using a regular USB-C cable causes issues. Vice versa, this cable’s configuration may actually be harmful to compliant USB-C devices, though [Dillan] did not try this.

With the second unit in hand, he then started hacking it, with the full plans and schematic available on his website.

The changes include a regular USB-C port for charging, an ESP32 board with integrated battery charger for the 18650 Li-ion cell of the lamp, and an N-channel MOSFET to switch the power to the lamp’s LED. With all of the raw power from the ESP32 available, the two lamps got integrated into the Home Assistant network which enables features such as turning the lamps on when the alarm goes off in the morning. All of this took about $7 in parts and a few hours of work.

Although we can commend [Dillan] on this creative hack rather than returning the item, it’s worrying that apparently there’s now a flood of ‘USB C-powered’ devices out there that come with non-compliant cables that are somehow worse than ‘power-only’ USB cables. It brings back fond memories of hunting down proprietary charging cables, which was the issue that USB power was supposed to fix.

33 thoughts on “Hacking A Cheap Rechargeable Lamp With Non-Standard USB-C Connector

  1. Just ran into something similar a couple days ago. I bought a new desk fan for my office at work and I accidentally bought one that’s powered by USB. It came with an USBA to USBC cable but the included USBA brick supplies 2A and it needs the 10W to function. Luckily nothing happened when I tried powering it with a usb port off of my monitor before I realized the weirdness of it requiring higher current than standard USBA can provide. I’ll probably test to see if I can power it off of a standard USBC brick with higher current and toss the brick so I don’t accidentally mix and match non-conforming cable standards and hope it’s also not doing something funky with the internal cable wiring.

    I wish there was tighter controls for these standards to protect from potential fire hazards or frying other devices but I guess you can’t do too much with ‘China Export’ rated devices.

        1. Nope. That’s not a counterfeit logo. It is a badly drawn genuine one. It is fully intended to be a CE logo. However, a company that doesn’t pay attention to detail, like this, might not care too much about the product itself.

          1. … So it’s a counterfeit logo. That’s pretty much the definition of counterfeit logo, which of course intend to be legitimate logos but are not.

          2. Replying to @pelrun: There is no such thing as a CE certification. CE is a self declaration of conformance to the relevant European standards. So there is also no such thing as a genuine CE mark. Every manufacturer can use is freely if it self declares conformance.

    1. The usb-pd standard has allowed 2A over usb-a/b for over 10+ years. Usb-a chargers supplying 2.1A are extemely common place and were supplied with virually every device before usb-c took over. A monitor usb port is unlikely to be a high power port. Standard usb ports have some built in overload protection and should shutdown automatically.

    2. CE labels are available by the roll on AliExpress, and some are holographic. Haven’t seen UL ones , but haven’t looked all that hard. Honestly I looked when we were trying to open an arcade and the insurance company insisted on them, not like they checked and God knows if the cabinets that DID have them we’re legitimate. Not like anyone checked. And yeah, some cabinets had some electrical leakage, but what’s what the ground pin is for, right?

      Getting things UL field inspected is expensive and annoying.

      Reason it like this: without that sticker, sales struggle, lots of buyers seem obsessed with these stupid stickers and ask meaningless questions, so just put the stickers, we have a business to run. So, of course. Sorry.

      1. You can draw the logo with a pencil if you want, CE is a self-certification in most cases. And in those cases it’s pretty easy to do as well. It’s baffling how many people don’t know that. Putting the logo on without filling out the declaration is of course illegal (doing that because “you have a business to run” is a disgrace).

          1. Well, it’s not the Arduino, ASICs, buttons and switches part of AliExpress. It’s clothing, homewares, stationery, toys, camping, kitchen, etc. All made in China and shipped over by the container load.

  2. Messing with the USB-C spec already happens in other contexts as well. There’s a handful of mini-PCs – two that come to mind are the original CHUWI LarkBox and the ZimaBlade – that require 12V input via USB-C. The included power adapter outputs a constant 12V on the VBUS pin of the USB-C connector. I believe the devices will negotiate to PD chargers that have 12V support, but for some reason (anyone know why?) the 12V configuration was dropped somewhere along the line, with only 9, 15 and 20V standard for the original USB-C power specs. (Yes, I know about the newer 28V/48V/240W/etc. specs too.) You can still get 12V out of many modern chargers using the PPS protocol, but these devices don’t implement that – if you put a fully functional QC/USB-PD charger on them, they just do nothing (the output stays at 5v, since they ask for 12v which isn’t supported).

    The REAL danger here is that someone might try to charge some other USB-C device using the charger that came with the mini PC. As I said it outputs 12V on VBUS all the time, no negotiation. That could cause serious damage to devices not expecting it that haven’t been designed to tolerate higher voltages.

    These devices absolutely violate the USB-C standards, and in a perfect world they would face consequences for their misuse of the standard. In practice, many of these devices coming out of China just do whatever they want and violate the standards in all sorts of weird ways, and there’s not a whole lot the standards bodies can really do (they’d have to be able to enforce sanctions against companies and factories that build these products, which would require cooperation from multiple governments…)

    (In my experience China also goes out of their way to make closed-source gadgets – if you’ve ever bought an inexpensive oscilloscope/multimeter/USB-C tester/etc. from Amazon, they just give you a link to a Google drive to download a shady single-EXE binary to communicate with the device. People have reverse-engineered the protocols and published the code, but I’d bet that once those libraries become common the manufacturers will just deliberately pull that version from the market and make a new one with a totally new protocol.)

    1. You don’t need PPS to get 12V through USB PD. It’s just not required by the standards for power sources to implement.

      Only power supply equipment I own not capable of doing 12V is a Lenovo 65W type C charger. And I’ve seen some other similar OEM chargers that can do 12V.

      Lenovo ThinkPad USB-C docking stations will provide any fixed voltage in the 5, 9, 12, 15, 20 volts steps. Can’t say the same thing about Dell docks, many only do 5V and “20V” (which is closer to 19V in reality).

  3. Doesn’t advertising “XYZ” when you aren’t violate some countries’/localities’ false-advertising laws?

    Even if the standard isn’t enforced by the entity that owns the trademark, if it breaks the law, it breaks the law.

    That said, governments usually have limited budgets and aren’t inclined to spend money enforcing false-advertising laws unless there’s a lot of political pressure to do so.

  4. Let’s be real for a second here. USB powered desk lamp? I’m looking at a 50’s era desk lamp that’s amazing gorgeous design I got when my father in law died. It’s nothing special and this or a similar one can be had for less than the $17 garbage lamp described here. eBay or a garage sale. And I put a modern LED bulb in it and it works great.
    Get outta here with your USB desk lamp. Lighting is a solved problem 100 years ago.
    -old and grumpy.

    1. There is one good reason to have USB lamps, and any other accessory that normally would be mains powered but might be wanted while at your computer – lots of folks these days are rather mobile, space constrained, and thus do everything off the one laptop at whichever space they could find this time but can’t occupy long term.

      Though I can’t understand a light like this one at all – seems to be entirely impractical in that sort of scenario and only really suited to more ambient background mostly decorative lighting – which is definitely something that should just be wall powered as you are surely vastly more likely to have a mains socket than a USB supply…

  5. So he made the fake-USB situation even worse by buying a second unit instead of returning the first?

    And then even more worse by doing the engineers’ work and fixing the design?

    And all that for something as fundamentally wrong as a USB desklamp? (see Craig’s comment)

    Not cool in my book.

      1. Holding manufacturers to a higher standard and pointing out junk is pretty on brand for HaD.
        Supporting junk-producers by not just buying one but two (instead of returning for immediate refund) then doing the engineering for them has also been discussed at length in the comments sections of many HaD articles.
        Fixing crap- also consistent.
        It’s not a zero sum game.

  6. I got an aftermarket door clamp mount for the video doorbell for my apartment. It has a nice little plug hole on the back that leads to a flat flex cable that powers the doorbell on the front of the door from the plug on the backside of the door. It’s pretty nice. Except for 1 thing.

    The power supply they provided uses a usb c plug but at 20V AC! At least they didn’t make the cable detachable, making it more likely you try to use the things for anything else but still. I’m pretty sure that’s enough of a harsh environment to defeat all sorts of reverse polarity protections. Just wild. I am curious how the usb c plug is wired though. Maybe like above where they take over data lines for current carrying. Except there is no reason to because at 20v a little doorbell cam is not pulling anywhere near enough amps to cause a problem with the standard set up.

    1. Now there’s a though, just why doesn’t USC-C specify AC power? I should email them and ask for it to be added.

      It would have been mice if everyone used 24v instead of 19v, 20v etc. Everything industrial is 24v, would have made more sense and be rather useful.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.