Category Archives: Hacking

Reverse engineering an USB car charger

I recently bought a Dual USB Car Cigarette Powered Charger from your well known gadget store in China. The specifications was spot on for what I wanted, two USB ports that could deliver at least 1 amp per port. Actually labeling states 1 A + 2.1 A. I ordered one and when received got too curious to what was on the inside. Partly because I like to take stuff apart, but also to calm my worry about putting this in my car and see it spontaneous burst into flames.

Product being dissected can be ogled in its full glory here.

I grabbed some pictures of the essential sides of the printed circuit boards (PCB), as there were two boards soldered 90 degrees onto each other. I forgot to take an initial picture showing the entire construction before I broke it into two pieces.

Kretskort hovedkort oversideKretskort hovedkort undersideKretskort kontaktkort underside

It is not an alarming amount of components, and on the upside they are clearly marked except the surface mounted capacitors. The PCBs were easy to reverse engineer, with a help of a strong flashlight and my beeping multimeter. The following schematics represents the two PCBs.

Kretsskjema

Components on the top side of the main board

  • IC1 CX8505
  • C1T unknown F, assumed 10 nF
  • D1T SS34 schottky diode
  • R1T 100k ohm
  • R2T 3,3k ohm
  • R3T 15k ohm

Components on the bottom side of the main board

  • C2B unknown F, assumed 3,3 nF
  • C3B 10 uF
  • C4B 47 uF
  • L1B 10 uH
  • R1B 7,5k ohm

Components on the bottom side of the USB connector board

  • R6 and R12 75k ohm
  • R8 and R10 43k ohm
  • R5, R7, R9, and R11 51k ohm

If you go to the trouble of searching for CX8505, you will find the component at the manufacturer, with a matching datasheet in Chinese. From this information I added the assumed values to the unknown components.

The manufacturer of the charger has chosen to add a schottky diode, assumedly to protect against short circuiting the USB ports. The datasheet for CX8505 also states there is a built in protection.

Another interesting detail is that the SS pin (soft start?) on CX8505 is not wired through a capacitor down to ground, as recommended in the datasheet.

Reading further through the CX8505 specifications we can calculate Vout using the formula 0,925 * (1 + R1 / R2), where R1 is component R3T, and R2 is component R2T. This will give us 0,925 V * (1 + 15000 / 3300) = 5,13 V. Well withing the USB specification, and since it’s on the upside of 5 V allow for some loss in USB cables.

After completing the dissection and reverse engineering the schematics I was not strongly reluctant to use this in my car. Looking at other USB chargers from China, they all seem to offer this 1 A + 2.1 A combination. I would not be too surprised if they all have a very similar design.

Omvendt ingeniørkunst av USB-lader for bil

Kjøpte nylig en Dual USB Car Cigarette Powered Charger fra en velkjent gadgetbutikk i Kina. Spesifikasjonene var veldig nære hva jeg kunne tenke meg, to USB-porter som kunne levere 1 ampere og 2.1 ampere. Ble nysgjerrig på hva som var inni og hvordan den var konstruert. Litt fordi jeg liker ta ting fra hverandre, og litt for å tilfredsstille bekymringen mot at laderen vil selvantenne i midtkonsollet.

Produktet som ble dissekert kan beskues i sin helhelt her.

Jeg tok bilder av de essensielle sidene av kretskortene, det var to som var loddet 90 grader på hverandre. Glemte såklart å ta et bilde av konstruksjonen før jeg knakk den fra hverandre.

Kretskort hovedkort oversideKretskort hovedkort undersideKretskort kontaktkort underside

Det var ikke fryktelig mange komponenter, og de var tydelig merket med unntak av de overflatemonterte kondensatorene. Etter litt søking med multimeter kom jeg frem til følgende kretsskjema for designet.

Kretsskjema

Komponentdetaljer overside hovedkort

  • IC1 CX8505
  • C1T ukjent F, antatt 10 nF
  • D1T SS34 schottkydiode
  • R1T 100k ohm
  • R2T 3,3k ohm
  • R3T 15k ohm

Komponentdetaljer underside hovedkort

  • C2B ukjent F, antatt 3,3 nF
  • C3B 10 uF
  • C4B 47 uF
  • L1B 10 uH
  • R1B 7,5k ohm

Komponenter underside kort med USB-kontakter

  • R6 og R12 75k ohm
  • R8 og R10 43k ohm
  • R5, R7, R9 og R11 51k ohm

Om man tar seg bryet å søke etter CX8505 så finner man komponenten hos leverandøren, med tilhørende datablad på kinesisk. Derfor har jeg antatt verdiene på de overflatemonterte kondensatorene.

Produsenten har også valgt å legge på en schottkydiode for kortslutningsbeskyttelse på USB-portene, selv om databladet til CX8505 påstår den skal ha det innebygd.

En annen interessant detalj er at SS (soft start?) pinnen på CX8505 ikke er koblet via en kondensator til jord, som anbefalt i databladet.

Ut ifra databladet er formelen for å beregne Vout = 0,925 * (1 + R1 / R2), der R1 er R3T og R2 er R2T. Noe som gir 0,925 V * (1 + 15000 / 3300) = 5,13 V. Noe som er innenfor USB-spesifikasjonen, og gir mulighet for litt tap i kabelen og fortsatt fornuftig spenning i andre enden.

Ut ifra disseksjonen så ble jeg ikke urovekkende bekymret for å dytte den i bilen. Virker som det er veldig mange USB-ladere fra Kina som har lik spesifikasjon, så mistenker denne CX8505-kretsen er velbrukt.

getcartoons v2.3.19

Getcartoons versjon 2.3.19 er sluppet, last den ned her (gzbz2).

2.3.19 – 2010-05-13

  • Fixed URL to Ctrl+Alt+Del
  • Moved to bash to skip any builtins in the shell on Debian boxes
  • Nuked some dead script code
  • Updated URL to Dilbert from vg.no
  • Grab Lunc from http://www.lunchstriper.no/ instead
  • Fixed perl scripts for Pondus, Nemi and Zofies Verden from db.no
2.3.18 – 2009-12-30
  • Added Lunch from http://www.nettavisen.no/tegneserie/striper/index.jsp
  • Added Radio Gaga from http://www.nettavisen.no/tegneserie/striper/index.jsp
2.3.17 – 2009-04-22
  • Added Cyanide and Happiness from http://www.explosm.net/comics
2.3.16 – 2009-04-07
  • Fixed numerous cartoons saved with wrong .filetype.
  • Added Nilsen og Viktor from http://www.nettserier.no/nilsenogviktor
2.3.15 – 2009-02-24
  • Added Saturday Morning Breakfast Cereal from http://www.smbc-comics.com/
2.3.14 – 2008-12-24
  • Refreshed URL for Nemi from db.no
  • Fixed URL for Rose is Rose.
  • Fixed perl script for Zofies verden.
2.3.13 – 2008-12-16
  • Added Zofies verden from db.no
2.3.12 – 2008-12-04
  • Fixed URL to Pondus on bt.no
  • Fixed URL to PC Weenies
  • Fixed URL to Rose is Rose
2.3.11 – 2008-11-26
  • Fixed URL to Pondus on db.no

AVR32 Debian compile farm refurbished

So, finally got around to upgrade the compile farm with an additional switch. This adds ATA-over-Ethernet (AoE) which is used for swapping. This reduces the load on the SDHC card and also gives a bit snappier swap, win-win 🙂

I also redid the MacGyver solution and it is a lot more rigid now. Shorter Ethernet cables and better strapped together with tape, sorry no gaffer tape 😉

More pictures in the gallery.

AVR32 Debian compile farm

So, finally I have gotten around to setup 10 NGW100 and a STK1000+STK1006 board to help with the compilation of Debian packages for AVR32. Big thanks to Bradley “Brad” Smith who actually administrates the whole deal. We are doing quite nice as the graph below shows.

I also took some pictures of the compile farm of NGW100’s.

The compile farm has been named “Karlsson on the roof”, given the position it is placed in the server room.

nixbackup v1.2.3

Nixbackup versjon 1.2.3 er sluppet, last den ned her (gz, bz2).

Endringer siden 1.2.2:

  • Fikset testen for om lagringskatalog eksisterer og er korrekt montert. Noen USB-harddisker ser ut til Ã¥ endre enhetsnavn fra tid til annen.

getcartoons v2.3.10

Getcartoons versjon 2.3.10 er sluppet, last den ned her (gz, bz2).

Endringer siden 2.3.8:

  • La til WulffmorgentHaler fra http://www.dagbladet.no/tegneserier
  • La til The Duplex fra www.gocomics.com/duplex
  • Oppdatert URL til Bizarro
  • Oppdatert URL til Lagunen
  • Oppdatert URL til M

nixbackup versjon 1.2.2

Nixbackup versjon 1.2.2 er sluppet, last den ned her (gz, bz2).

Endringer siden 1.2.0:

  • La til støtte for Ã¥ ekskludere filer og kataloger.
  • Fikset en bug som gjorde at datoen for siste daily ikke ble oppdatert, noe som førte til at veldig gamle filer ble tatt med i daily backupene.

nixbackup versjon 1.2.0

Nixbackup versjon 1.2.0 er sluppet, last den ned her (gz, bz2).

Endringer siden 1.19:

  • La til sjekk om backup-destinasjon er montert.  Vil ogsÃ¥ prøve montere backup-destinasjon om den ikke er montert.
  • Renset skriptet litt, mindre skriking.