10 ms·
It's a surprise to see my blog post from nine years ago (!) at the top of Hacker News. Anyone have questions about chargers?
by kens 5y ago
It's a surprise to see my blog post from nine years ago (!) at the top of Hacker News. Anyone have questions about chargers?
- andrewmcwatters 5y agoHow does one learn to build such things? Most would say school, but I imagine there are particularly good reads out there that are more helpful to those driven enough to be autodidacts. Thank you for such an excellent and digestible article. Such a pleasure to read.
- kens 5y agoI don't know how to build them, just take them apart :-) But seriously, there are a lot of books on switching power supply design. E.g. Fundamentals of Power Supply Design by Mammano, who is "the father of the PWM controller IC industry".
- andrewmcwatters 5y agoVery cool! Thank you!
- seltzered_ 5y agoHuh, that's a new one. I worked in the space and Erickson and Maksimovic - Fundamentals Of Power Electronics (along with the courses taught at UC Boulder) was one many centered around. In many cases most of the power engineers I worked with just sorta had a feel for things and relied on simulation tools (LTSpice / SwitcherCAD).
- cogman10 5y agoFor something as basic as a charger, an intro to electronics course/book is probably good enough. There's more than enough youtube videos out there about bridge rectifiers and the like. The charge circuitry here isn't anything too special.
- andrewmcwatters 5y agoI imagine then that some of the more claimed sophisticated elements come from multidisciplinary backgrounds like having experience with electronics in noise-sensitive circuitry.
- kens 5y agoIt's easy to make a linear power supply, but a switching power supply like a charger has a lot of complications. Among other things, the layout of the board matters a lot due to the high frequencies involved. I'll point out the the application note on this controller chip is 34 pages long. https://www.st.com/resource/en/application_note/an1326-l6565-quasiresonant-controller-stmicroelectronics.pdf https://www.st.com/resource/en/application_note/an1326-l6565...
- cogman10 5y agoCertainly. My point was more that the basics are pretty readily covered in intro electronics courses. Heck, throw in a low pass filter or two and you end up with a lot of the same required knowledge to make a switching power supply. I agree you won't be able to make an apple quality device, it'd just be enough info to understand how one is working (Without taking into account things like line noise impact on wiring).
- lmilcin 5y agoFar from it. Chargers are actually very complex and demanding design tasks with a lot of interesting* fault modes. (* assuming you like small fires and exploding devices) Just because you can make it work doesn't mean it is safe. Good charging circuit will be designed to behave correctly if any of the components fail. Even a simple battery charger can easily cause fire. The usual advice to amateurs is to stay away from charging circuits and switching power supplies. And reuse existing circuits in their designs. There is a lot of complete charging circuits and power supplies made to be included in designs.
- dontcare123 5y agoThis isn't an actual charger though, just a basic off the shelf switching power supply, low power AC -> 5V DC. The actual battery charger chip is on the phone (which again, will use a ready made BMS IC, so not really complicated either, all the smarts are already done). There's some things to consider when laying out a switcher (keep loop areas small, keep sensitive lines from noise ones, etc), but it's not that complicated, and once you've done a few of them, it becomes routine. And of course to pass safety standards there are clearance and creepage rules and EMI/EMC to keep in mind. Any junior level EE/hobbyist with a few years of tinkering should be able to put this together.
- ENOTTY 5y agoHave you torn down any more recent chargers? Curious if quality standards for Apple or other consumer electronics companies have held steady, improved, or gotten worse in the 9 intervening years.
- kens 5y agoI kind of got bored with chargers and found other projects like the Apollo Guidance Computer. My impression is that the quality of super-cheap chargers has increased a bit since people are paying more attention to safety, but I don't have any quantitative data.
- lazide 5y agoOn the practical side, I imagine many chargers even if they catch on fire will struggle to cause a large scale fire unless they are behind something flammable or the like. Maybe an idea for a test at some point? Simulate typical environments they might be in, blow them up, and see how much mayhem they create?
- mschuster91 5y ago> I imagine many chargers even if they catch on fire will struggle to cause a large scale fire unless they are behind something flammable or the like. Given that USB-C PD's EPR upgrade will allow 48V @ 5A for a total of 240W of power, the potential for a fire due to shoddy (too thin/fraudulent or damaged) cables, dirt or loose solder connections on the sockets (causing high resistance and thus heat build-up at the spot) is not negligible. The most troublesome potential is the combination of PD controller bugs on the charger side leading to 48V/5A on the cable, and a lack of protection circuitry on the side of a device that has been designed for 5V-only.
- lazide 5y agoTheoretically non negligible. I just want to see stuff catch on fire!
- 5y ago
- deadmutex 5y agoWould love to see this type of post for framework's power adapter: https://frame.work/blog/power-adapter https://frame.work/blog/power-adapter
- kens 5y agoThat's a pretty cool GaN (gallium nitride) charger. I'm guessing that it uses the InnoSwitch4-CZ control chip. That chip is interesting because instead of having separate chips on the primary (high-voltage) and secondary (low-voltage) sides of the transformer, they use a single chip that contains circuits for both sides. Internally, the two sides are isolated and communicate via an inductive coupling link. The chip looks very weird because it has a super-wide drive pin. https://www.power.com/sites/default/files/documents/InnoSwitch4-CZ-Data-Sheet.pdf https://www.power.com/sites/default/files/documents/InnoSwit...
- toomuchtodo 5y agoWould pay to see a Ting electrical system sensor torn down. https://www.tingfire.com/ https://www.tingfire.com/
- kens 5y agoMy guess is that it has an analog-to-digital converter to measure the line voltage at high frequency and a microcontroller to analyze the data to look for transients that indicate arcing. I found a datasheet for an arc-fault detector chip for solar panels which would be similar concepts: https://supp.iczoom.com/images/public/20181016/1539670869717085600.pdf https://supp.iczoom.com/images/public/20181016/1539670869717...
- toomuchtodo 5y agoThank you for the reply! It is appreciated.
- xrendan 5y agoDo you know what the big difference for companies to cram enough hardware into the same space to support 20W power like Anker [1] Is this just incremental improvements or is there a technological breakthrough that's enabled this? [1] https://us.anker.com/pages/uai2020 https://us.anker.com/pages/uai2020
- gh02t 5y agoSome of the new ultra-compact chargers are using switching regulators based on GaN transistors, which are a fairly new technology. These are more efficient and hence can be smaller for the same power envelope. Some of the Anker products use these, not sure about the one you linked. But similar logic applies even for the ones that aren't using GaN. More efficient parts and/or designs allowing for more and more shrinkage. One of the other big drivers has been manufacturers starting to market monolithic chips that manage all the aspects of power regulation and USB-PD in a single/small number of parts.
- kens 5y agoIt's essentially a technological breakthrough. That charger uses GaN (Gallium Nitride) instead of silicon for the switching transistors. Gallium Nitride has various advantageous properties over silicon (higher bandgap voltage, higher breakdown field, faster electron mobility) that make it more efficient in chargers.
- lovemenot 5y agoIn theory, would SiC be a further improvement over GaN? There's a slow transition underway from Si to SiC power-semiconductors in industries such as automotive.
- kragen 5y agoNo. Carborundum can operate at higher temperatures and voltages than silicon, but it isn't more efficient; it just lets you run the transistors hotter and at higher voltages, so they can switch more power. The nitride is actually more efficient, but it's more delicate to overvoltage. (I think it also withstands higher temperatures, but in a wallwart the problem isn't that the transistor loses its ability to switch; it's that the plastic case melts.) You can relive my emotions from when I learned about the astounding properties of nitride transistors (in 02017, I think) in https://dercuano.github.io/notes/jellybeans.html#addtoc_1 https://dercuano.github.io/notes/jellybeans.html#addtoc_1. Unfortunately there weren't any carborundum parts in my list.
- jbay808 5y agoDo you ever encounter chargers that are AC-coupled (like, a transformer at the input), or do they generally all work fine from a DC supply?
- kens 5y agoI don't think anyone has made an AC-coupled phone charger in decades since it's way more bulky and expensive. There might be some consumer electronics that uses a transformer to get a low-voltage AC output, but I can't think of any offhand. Switching supplies should work from DC, but I don't want to give any guarantees. In particular, for a higher-power supply with power factor correction, I'm not sure what it does if the input isn't AC.
- bredren 5y agoThanks for the previous work. I was most interested in your prose about the old, recalled Apple charger, where design suggested to you someone at Apple was told ~“be sure these never can come out again.” Most of the action in chargers right now is in 30 watt USB-C. Everyone wants the fasted charge possible. New iPhones can apparently consume 22 watts plus (via usb-c to lightning and macs and iPads (I believe) can pull the full 30 over an appropriate usb-c. As a result, when shopping for USB-C chargers, or power strips containing USB-C, I study the supply carefully to make sure they provide this or if not I’ll be happy enough consuming a standard wall plug with a 30W adapter. These adapters seem to have shrunk in the past two years due to GaN, or Galium Nitride instead of silicon. (I have not read what this means exactly but it is in the marketing copy) One of the bigger electronics accessory names was the first, but now you see no-name brands offering GaN as well. To my knowledge, Apple has not introduced GaN-based power adapters but I could be wrong. Regardless, it would be very interesting to read a study of yours of 30W chargers in this class. For example, this no name brand is selling two for $20, a very low price point: https://www.amazon.com/dp/B098J6LN4Q/ https://www.amazon.com/dp/B098J6LN4Q/ Versus Anker and the other big names which have similar, higher priced versions. I’m presuming the cheap one linked above is likely to set my home on fire. But maybe not? You would be the one to speculate. I’d be happy to fund a portion of the purchases needed for such an article. My email is in my profile.
- londons_explore 5y agoGaN is a type of MOSFET, which is the high power transistor at the core of all modern power supplies. By choosing GaN, the MOSFET can be switched quicker without wasting too much energy as heat. That in turn means all other components (capacitors, inductors) can be made smaller in the same ratio. The end result is modern GaN technologies allow someone to make a 30 watt power supply in the same physical space that a 5 watt power supply from 2005 took.
- baybal2 5y agoGaN-FET is not necessarily a MOS-FET strictly speaking. > By choosing GaN, the MOSFET can be switched quicker without wasting too much energy as heat. That in turn means all other components (capacitors, inductors) can be made smaller in the same ratio. Faster switching frequency of the whole circuit is not necessarily an attribute of the material. There are silicon ICs with high switching frequencies for things like powering CPUs, and GPUs. They are of course physically bigger, and a bit less efficient. What GaN switches put on the table is having a single transistor being able to do this, and thus allowing much simpler circuits, basically a drop in replacement for existing silicon devices.
- shoto_io 5y agoDefinitely. I am addicted using the large iPad chargers for iPhones. Is this wrong? I am under the imagination that they are far superior, i.e. charge faster!
- Jiocus 5y agoA charger capable of providing higher wattage (energy/second) allows a device to charge faster. By now, device, USB characteristics and battery care services determine how much is used. For example, my Xperia uses extra slow charging every once in a while for battery longevity - using the otherwise fastcharging adapter.
- Daneel_ 5y agoFast charging is typically extremely hard on the battery, so I’m the opposite to you - I actively try to use the lowest wattage charger whenever I can (5W). My understanding, borne out by experience, is that this is far, far kinder to the battery and will significantly increase the lifespan of the battery (in combination with good battery charging and discharging practice). I have one or two high output chargers for when I need my devices charged in a hurry, but that’s extremely uncommon. My main phone, an iPhone X bought at launch (Nov 2017), is still at 89% battery health and working well.
- Causality1 5y agoIt would be interesting to get a real expert's explanation of how the ways the Nintendo Switch violates the USB specifications leads to third party docks sometimes frying consoles, or maybe an explanation of how phone manufacturers can charge batteries at absurd C rates without killing them.
- duskwuff 5y ago> third party [Switch] docks sometimes frying consoles Simple: an early third-party dock for the Switch, made by Nyko, implemented USB-C incorrectly and could deliver up to 9V on the CC1/CC2 (configuration channel) pins. These pins are only supposed to have 5V on them, and a USB-C interface IC in the Switch was frequently damaged by that voltage. The Switch was fine. The fault was entirely in the dock.
- Causality1 5y agoThe Switch violates protocol in many ways: https://web.archive.org/web/20190201011444/https://plus.google.com/102612254593917101378/posts/2CUPZ5yVTRT https://web.archive.org/web/20190201011444/https://plus.goog...
- duskwuff 5y agoFrom what I'm reading, most of the violations Nathan is complaining about are on the part of Nintendo's dock, not the Switch itself. Moreover, these violations are all relatively minor (especially compared to Nyko's 9V CC howler!) and are unlikely to cause any serious issues under normal use.
- kergonath 5y agoThe point was not whether the implementation in the Switch was perfect, it was about frying the console. Minor spec violations won’t do that, but a wildly out-of-spec charger might.
- InitialLastName 5y ago> The Switch was fine. The fault was entirely in the dock. ... and now those of us who design things with USB-C ports have a very clear market study in "should we shell out the $ to protect the CC pins against a short to VBUS?"
- dudus 5y agoAny good resource for alternative usbc/iphone chargers that don't cost an arm? I've relied on Benson's reviews in the past for USBC cables, but I'd love to have somewhere a list of expertly curated products. https://www.amazon.com/gp/profile/amzn1.account.AFLICGQRF6BRJGH2RRD4VGMB47ZA/ref=cm_cr_srp_d_gw_btm?ie=UTF8 https://www.amazon.com/gp/profile/amzn1.account.AFLICGQRF6BR...
- 404mm 5y agoYou mentioned the interference with touch screens. Long time ago I accidentally purchased one Apple power supply from Amazon and I assume it was a counterfeit. I remember not being able to control the iphone because touches were misaligned and generally off. Can you please help me understand what (likely) happened?
- kens 5y agoCheap chargers can interfere with capacitive touchscreens because cheap chargers have a lot of electrical noise in their output. This noise gets coupled to the touchscreen and causes problems. Specifically, the touchscreen controller needs to measure pico-Coulombs of charge which is difficult when there are multi-volt spikes coming out of the charger. The chip can perform various filtering to deal with this noise, but that slows it down. Some touchscreen chips even do frequency hopping to avoid the noise (kind of like a military radio trying to avoid jamming). Details here: https://www.cypress.com/file/117656/download https://www.cypress.com/file/117656/download
- ValentineC 5y agoWould the electrical noise damage the battery in the long run? I've always been leery about plugging my iPhone into cheap 3rd-party chargers, but I never knew if the logic behind my fear was sound.
- jwatte 5y agoThe battery is probably the least sensitive part to noise. In fact, the battery may be able to filter/absorb a lot of noise, as long as it's charging, because it's a strong current sink and it has low impedance. (You may still have ground loop problems and other resistive voltage dividers that let the interference get to other places.) The circuits in the phone may be damaged by excessive spikes. Especially if the spikes happen to be of a frequency that the internal filters / regulators in the phone aren't good at rejecting -- some regulators may only reject 20 dB of noise in certain bands, and > 80 dB in others.
- ysleepy 5y agoAny thoughts on the ikea koppla usb power supply? I sort of stuck with it for the price/performance/safety. Here is a teardown (might be dated): https://lygte-info.dk/review/USBpower%20Ikea%20Koppla%20UK.html https://lygte-info.dk/review/USBpower%20Ikea%20Koppla%20UK.h...
- kens 5y agoFrom that teardown, it looks like a solid charger with an unchallenging design. (I.e. they didn't try to make it small.) I think it uses the iWatt 1699 control chip: https://www.dialog-semiconductor.com/products/acdc-conversion/iw1699 https://www.dialog-semiconductor.com/products/acdc-conversio...
- Daneel_ 5y agoBig Clive also did a fairly comprehensive teardown of the IKEA charger and was pleasantly surprised with the design: https://youtu.be/uRe9w5PKmsE https://youtu.be/uRe9w5PKmsE He also confirms that the control chip is a 1699-02.
- germinalphrase 5y agoAny interest in looking into ebike chargers? Particularly on the diy side, there are a bunch of folks out there banging up battery packs in their basements and getting shocks, starting fires.
- zamalek 5y agoAudiophiles swear by Apple chargers as a power source. It's a needlessly clean power source. I was having extreme issues with noise from my DAC, to the degree of clearly audible at normal listening levels. Apple sorted that right out. The charger is the only product I will buy from Apple. It's complete and utter overkill, you'll never have problems for a very minor premium (absolutely speaking, not relatively).
- dep_b 5y agoDo you have some sources for this? A quick google search turned up nothing
- samtheprogram 5y agoProfessional (and generally speaking) audio equipment can produce undesired sound effects if there’s any voltage irregularities going on. I know that certain outlets in my house that cause static noise out of a guitar amplifier because they aren’t.. perfectly wired? Also, I know audio engineers will typically plug their equipment into an outlet that is separate from their computer to avoid this as well. I haven’t studied electrical or sound engineering too deeply but I have noticed the same. Knowing that this is a general issue, I did a quick search and found this: http://www.enjoythemusic.com/magazine/manufacture/0712/ http://www.enjoythemusic.com/magazine/manufacture/0712/
- dep_b 5y agoOh yeah I have a electronic music studio for years and a clean power source is the beginning of everything. Brought in stuff for repairs only to have the technician tell me that there was nothing wrong. At home same problem again. "Try plugging it in directly to a wall socket" problem solved. And with lots of outboard gear you get lots of cables and lots of adapters.
- jwatte 5y agoGoogle "balanced power for tube amplifiers" and see how far that rabbit hole goes ... (And it's not all superstition, and it's not all for tube amps -- it's all in the SNRR of your power stages for every piece of equipment in your sound chain.)
- iampivot 5y agoCan you talk a bit about the tingling sensation from touching the aluminium case of a macbook pro, when using a non-earthed cable with the power supply? With the latest macbook pro M1s, apple no longer include an earthed cable in the box (with the exception of the three pronged adapter in the uk).
- amelius 5y agoInsufficient isolation between input and output. Perhaps you should try a medical-grade power supply. https://www.seacomp.com/resources/medical-vs-commercial-power-supplies https://www.seacomp.com/resources/medical-vs-commercial-powe...
- nomel 5y agoHere are some good answers about it [1], but it's current leakage from the mains voltage making its way onto your chassis. You end up with upwards of 60V sine wave on your MacBook case, compared to the relatively grounded you (capacitively to your surroundings). This voltage creates some electrostatic force to attract your finger to the surface enough that you can feel a change in friction. The Disney Research Lab made a neat touch display surface that used the same effect (and higher voltage) to modify the friction and "texture" feeling for a haptic touchscreen [2]. 1. https://la.disneyresearch.com/publication/teslatouch-electrovibration-for-touch-surfaces/ https://la.disneyresearch.com/publication/teslatouch-electro... 2. https://la.disneyresearch.com/publication/teslatouch-electrovibration-for-touch-surfaces/ https://la.disneyresearch.com/publication/teslatouch-electro...