Monday, January 23, 2017

Reader Beware: A completely long-winded USB-socket story

Hi guys,

I know, I know. We're getting lazy.

Lemme put out something pretty insignificant, but I think is pretty interesting anyway.

Story tiiiiiiiiiiiiiiiiiiime (James Hetfield voice, while stretching the mouth to the ends of the face at the "ime" part, and a chugging riff). Well, to point out the obvious, with the era of smartphones, you would know why we don't use those bulky and sticky and nasty blocks of plastics anymore for our road navigation when finding out you're running out of gas in some small town... not knowing where the gas station is. After the Autobattrion project, my charger which had a Mini-B USB socket, used for charging the said GPS device was not used for a long time. To you chumps out there here's a USB guide from

I am not gonna cut the wires to the original charger to fit a Mini-B to a Micro-B type. I just don't like being invasive. This means I'll have to use an adapter, both female. But I hate buying it at 5 bucks apiece or more. So I went to a store in Jalan Landak, KL during my lone ventures into the world of electronics and bought a Mini-B receptacle for 80 cents (≈0.18 USD as of the date of this article). Pretty close to free.

After three months, one night, I was feeling kinda "floaty". I don't have the mood to read my usual books after dinner, so I sat on my project bench and found the socket. Fishing around for a standard Type-A female receptacle, I came across an old Type-A to Mini-DIN6, used to fit the Stone-Age keyboards. Here's how it looks generally (image from Superuser):

I was already imagining all the ripping apart for the pin-exposing and all the eye-squinting for the precise soldering required and felt pretty much yep, this is gonna be a piece of work, let's put that one off. But then I remembered scribbling something about the DIN-6 pinouts and fished out my old logbook and voila! I found the pinouts - without internet connection. Here's the pinouts for both Mini-B and a DIN6 connector:

Now, those pictures may look like whatever. But if you look closely, notice that a small Mini-B has both +5V and GND pins on both leftmost and rightmost sides, as also can be seen from the 6-pin DIN connector. "So what? You've saved the world with this info?!!", you might say. It might not. but you'll save 5 bucks or more. Why not? Anyway, let's quit goofing around. What does this mean? Well, it turns out to be pretty convenient. It means both connectors can be aligned pretty neatly with minimal soldering. No wires. The rest is pretty straightforward. 

Let the picture speak for itself:

1st picture: For starters, remove the metal shield on the DIN socket, to reveal the pins. I clipped the other pins, leaving only +5V and GND. Then solder the pins together according to the pinouts mentioned above. I just have to bend the USB pins a bit to nearly reach the DIN pins but as you can see, the soldering did the rest.

2nd picture: Then, aesthetics is important. I wrapped tape to form a cylinder around the insulation and "poured" epoxy into the "mold" if you like. Now it looks pretty close to a standard Female-to-female Type-A-to-Mini-B, right? 

3rd picture: Well, it worked well. I colored the dried epoxy finish with a permanent marker. Now no one'll know it's homemade. *Evil laugh*. Go on guys, laugh with me.... OK I know that's lame.

Anyway, now you know! Don't say I didn't warn you about how pedantic I can get.


Saturday, February 1, 2014

A DIY Car USB Charger: Autobattrion

Salam'alaikum everyone,

I was walking around in a shopping mall (I don't like those glitzy shopping malls at all for the record, they're noisy and our country is mushrooming with 'em. What, like you don't have enough things to buy already? Okay I'll quit before it gets off-tangent, but this article sums up quite a bit about my opinion on them. Haha.) And you know what? A simple USB car charger costs RM30! I know places where they sell it for RM5 apiece, but the point is, I prefer not buying them for the quality they give. And I'll certainly shan't fish out three red notes to pay for such a kiddie item.

Anyway. The interwebs got lots of projects like these, like:
-Instructables: A good-ish instructable, with lots of feedback. I'd have to say the comments helped a lot.
-Jason Jalopnik: A project with really nice pictures, and easy for electronics beginners.

Why build my own? Well, I had stuff lying around (my sister's old Nokia 3310 battery charger, kaput, I just need to build on what's inside) and I think it is much more... monumental, building things which you use rather than buying them. I think the reason people throw Scandinavian furniture away every other day is because it is too easy to acquire. Well.. *snap* to the apartment guys.

How does it work? For the layman, what you're getting from your car where you plug in your cigarette lighter is basically the battery power which powers up a resistive element in the lighter. So electrical energy is converted into heat, and voila. Be careful with car batteries, they potentially can shock anybody if mishandled. If you're not sure how to do it, then ask someone who knows them. This is how I'd visualize it:

Figure 1: What actually that hole in your car is all about.
Now we proceed to the small stuff. I got a UA7805, which is a sample from Texas Instruments, so it's free. (Thank you TI's Thief River Falls guys!) It will regulate the voltage from the car socket output's 12V to 5V. The rest is pretty basic; indeed that's all you need. But I wouldn't mind adding some small stuff since I got them anyway. 

Next, you'd need a USB female socket. Duh. I'd like to note that since most of us use smartphones, and the adapters for charging are most likely micro-b type (Refer here for more detail). However, since most of us have the [Type-A]-to-[Type-whatever] adapters, it would be more practical for us to have a more universal socket, like Type A.

Figure 2: USB socket
Notice the keyboard buttons? I'm using it as a housing for the socket. I suppose the decline on using PCs nowadays has greatly contributed to unwanted keyboards, and I'd have to say they are super useful to make a lot of things. You'll just need to use a standard cutting knife to cut the shape so that the socket can fit snugly between the pieces. You'll see it later.

The next step is to assemble everything according to the schematic. I'm just posting the schematic for fun using Paint guys, so don't bash me if it lacks the supreme Altium-ish look.

Figure 3: Circuit for the charger, which is just really a simple voltage regulation schematic with more color on it. That's all.
A bit of elaboration needed here. Ahem. The data terminals 2 & 3 (D- and D+) of the USB socket need to be shorted for it to act as a charger. Also, I added a Schottky Diode in series with the 5V output. This will thwart the reverse power leak to the circuitry from the phone's battery. I experienced that when I plugged in my GPS device to a similar charger. It turned flat within minutes! So, something to learn here.

Here's a picture of my assembled Autobattrion (fancy name just for fun, no need to take it seriously guys):
Figure 4: Look at the perfboard, and you'd know how DIY-ish this looks.
I tested the charging by hooking up the charger to a power supply in home:

Figure 5: Powering up the charger with Phaserion

The USB socket is finished as follows:

Figure 6: Clamped both keyboard button to encase the USB socket, a splash of Epoxy Glue, and a dash of black paint.

The charging in my own car went well. Alhamdulillah.
Figure 7: Charging.....
So in conclusion, I built this charger for practically zero bucks within two man-hours. I call this AutoBattrion, so that I don't have to say "I built a DIY-USB-Car-Charger". Instead I'll just say, "Hey guys, AutoBattrion." Hehe.

Well thanks for reading and hope you guys don't mind my rambling! Keep your money for charity instead of buying unnecessary things. InsyaAllah.

Related Posts Plugin for WordPress, Blogger...