A'yuh, that's a lot of rain.
Lost power around 1:00, too, but things aren't too bad right now. It's quite pleasant and quiet at the moment. Perhaps the storm will get Brynna to take her first nap in a week.
B still has light in her room thanks to the combination of Twinklepic and AA-to-USB!
(this update brought to you by my iPhone and cell towers with backup generation)
[UPDATE 2011-08-28 22:27 - We got our power back after an hour or two]
Sunday, August 28, 2011
Hurricane Irene
Posted by
-A
at
12:33 PM
0
comments
Labels: aa-to-usb, twinklepic, weather
Thursday, November 20, 2008
AA-to-USB revisited
[Apologies to our faithful readers who haven't seen this blog updated in a week, only to have it updated with my old and smoldering nerd project. I know you hang out here to catch a glimpse of Brynna. Fear not! With the weekend coming, we'll have some more to say soon.]
Previous posts on this project are here
Nope, I haven't given up yet on this one. When last we left it, some four months ago, I had a sort-of-working circuit board. It worked well enough to create a nice 5 V supply for a USB device from a pair of AA batteries - the green LED said so. But, it couldn't power my iPhone, because it just supplied power - there no brains behind it like in a computer. As a result, being a nice standards-compliant device, the iPhone wouldn't take the power presented to it. So, I had a working device of marginal value to me.
Since then things have been a bit busier - can't imagine why - and I haven't had much time or inclination to follow up.
But, about a month ago, I managed to sneak off to the lab for a bit for every engineer's favorite past time: taking things apart. There are tons of USB chargers out there, and a bunch of them work with the iPhone. How is it that they are able to convince the iPhone to draw power? To find out, I took a car charger I have and cracked it open.

The key thing in these pictures is the cluster of resistors (R9-R12) clustered next to the USB connector. These form what's called a voltage divider that puts about 2 V on each of the two data lines of the USB port. This jives with information I was able to glean from others who have tried to hack their own iPhone chargers - including the maker of the popular MintyBoost. Some say to add a pull-up resistor to each of the data lines, others say a resistor divider. I'm following the resistor divider I found in this car charger.
(What I really would have liked to do was take apart one of the Apple AC-power adapters for the iPod/iPhone. That obviously would be the most authoritative design (once you get past the AC-DC conversion). However, it turns out they are devilishly difficult to get into without breaking them, and I'd rather not risk doing that. I wasn't able to find anyone who'd taken one apart and posted the pics for all to see, alas, something that has been done to just about every other Apple product out there.)
So, I just needed to cram four more resistors onto the circuit board in the neighborhood of the USB connector. I was able to do this by placing them on the underside of the board, beneath the connector, and being a little clever with the circuit routing. 

The addition made the board a touch wider then before. I needed to squeeze and shift things a bit to make sure the thing was less than one square inch, since BatchPCB rounds up and charges by the square inch. I just made it. I sent off the order and received by boards earlier this week. I had ordered 10, but somehow received 17. I'm going to chalk this up to them probably having a little extra space in a panel of circuit boards, and squeezing in a few extra copies of mine for the heck of it. I'll need to send them a nice thank you email.
Anyway, in the last day or two I've been able to populate the board and try it out. I had one false start when I soldered the main chip incorrectly. Being square, with leads all around, and very external markings, I didn't notice until too late that I'd had it rotated 90 degrees from the beginning. The next time, though, I managed to get it right. Viola!

As you can see, there's little different from the earlier version except for the four resistors under the connector. The other difference is that I can show off the sliding top enclosure I made with the rapid prototyper at work.
Even better than having an LED glow to tell me the thing works is for my iPhone to do it.
One thing that I have learned after letting my phone charge from this thing for a while - rechargeable NiMH batteries are probably a better fit for this circuit than alkaline AAs. The reasons are technical, and tough to explain without graphs. The short answer is that NiMH batteries' cell voltage drops more slowly than alkaline AAs. Even though the alkalines have more energy inside them, their cell voltage drops too low for the circuit to work before the batteries are fully drained. It would be like having a gas tank where the gas line exited from the middle of the tank instead of the bottom. This suits me just fine - I prefer using rechargeables when I can in any case. As it happens, I've got some neat rechargeables to use from USB Cell, which you can recharge using a USB port. Hmmm...use the USB port to charge the batteries to power the USB port. Eureka!
So, what was the final breakdown for this project? I shelled out about $35 for parts - enough to populate 7 or 8 boards, along with some free sample chips from TI. Each run of circuit boards was about $38. Goodness knows how many hours went into designing, assembling, and debugging it. I figured that, for parts, I could make them for $13 in lots of ten. I have so far only made one finished, working device.
All this effort just to be able to charge my iPhone on the go? Well, in my defense, I could say that I haven't just made a charger for the iPhone. I've made one for just about any USB device out there, including H's iPod and our Flip camcorder. Plus, this circuit, now that I've got the boards for it, will make a handy AA, 5-V power supply for future projects I might come up with. [Updated 2008-11-21 20:11] There's one that I have my eye on tackling -and LED nightlight for Brynna, roughly modeled along these lines. But, as usually happens, I'm thinking of expanding it a bit, so that the lights don't just shine, but twinkle in and out. That'd require some sort of microcontroller, and some coding, and...
[Updated 2008-11-21 20:11] In the end, as I stated at the start of the project, that it was not really ever about the having of an iPhone charger. It was, first and foremost, about the making of one.
Posted by
-A
at
10:25 PM
0
comments
Thursday, July 17, 2008
AA to USB - It Works!


The pretty green light says so.
Ok, caveat time: it works in the sense that it takes the power from two AA batteries (or any number of other low voltage sources) and boosts it up to a nice regulated 5 V to power a USB port. However, one reason for doing this project was so that I could have a supplemental battery for my iPhone. By that measure, this device doesn't work, yet. I can connect the iPhone to this thing, but it will not draw power from the 5 V line.
To answer the question of why that's not working, I'd have to get a bit into USB enumeration and details of the USB specifications. For the curious, this guy has a decent explanation on his blog. Wikipedia also has some info on Power in the USB spec. The short answer is this: the iPhone won't blindly draw power from a USB port. Being a good little USB-compliant device with peculiar power needs, it transmits a request to the USB host to draw power, and waits until it gets an acknowledgement. This sort of thing requires a PC, or a least some sort of microcontroller, that is able to implement the USB communications. My simple device can't do that.
That's not to say that it can't still work as a USB charger for other devices. By my reckoning, it should be equivalent to the venerable Minty Boost, which is able to provide at least some power to nearly all of the iPod lineup.
In response to this situation, many have looked to see if there is some way to trick the iPhone into charging off a "dumb" USB port anyway. And, in fact, it appears that at least some have gotten it to work through clever combinations of resistors across the communication lines of the USB connector. I might give that a try.
Posted by
-A
at
11:16 PM
1 comments
Friday, July 11, 2008
AA to USB, part V
This is the continuation of my little project to build a device to power a USB port off a pair of AAs. Click for part I, part II, part III, and part iv.
And you had thought that, just because I hadn't breathed a word of this project in three months, that it had gone away. Ha! Just because I'm putting the bathroom back together, have had some busy times at work, done some traveling, and am awaiting my firstborn, doesn't mean I've lost interest in getting my geek on. Today's update: circuit boards.
These little suckers are the implementation of the design I had been doing on the computer. My earlier, prototype board, was made by one of my colleagues using a sort of Dremel on an x-y table, cutting away copper-clad board. These little boards were made by photo-etching. Copper clad board gets coated with a photoresist. The circuit pattern gets shone onto that resist, and the unexposed resist is washed away. Then the whole thing gets dunked in acid, which eats away any copper not covered by photoresist. There are some other steps, like drilling many little holes and plating them with metal, then covering most of the top and bottom surfaces with that green plastic.
This is, in the main, a bit outside the realm of amateurs - it is best done by a "board house." It's not all that different from, say, getting a stack of wedding invitations made up. In my case, I used a small company called BatchPCB. For a handful of really small circuit boards, this was the least expensive option I could find. This company works by gathering lots of smallish orders, from hobbyists and makers, and lays them out on computer to fill large panels, which then get sent off to a board house in China. The full-sized panels get sent back to BatchPCB, who then cuts them up into individual boards, assembles the orders, then sends them on their way. So, the turnaround time is pretty long: about 4 weeks in this case. But, I was charged only $2.50/board, since my board is about one square inch in size. Other places I know of, like Advanced Circuits, can turn out a board in 2-3 days. Usually, for their smaller orders, they charge a flat rate for a board in a given size range. My 1-sq in board would have cost as much as a 10-sq in board, some $20-60, typically with a minimum order order of several boards. That's actually a good deal for a medium or large size board, but not cost effective for tiny ones like mine. If it were on the company's dime, and a project's momentum counted on a fast turnaround, spending a few hundred for 2nd day prototype boards is no big deal. When producing thousands or millions of a circuit board, the cost is pretty small, only a dollar or two for a cellphone or ipod's. For a hobbyist, the priorities are different.
Yup, it's a pretty small piece of work - a lot is crammed in there. There's an equal amount of stuff going on underneath as well. I'm pretty pleased with the results so far. Now I just need to find some time to populate the board and see if it works!
Posted by
-A
at
10:54 PM
0
comments
Tuesday, April 29, 2008
AA to USB, part IV
This is the continuation of my little project to build a device to power a USB port off a pair of AAs. Click for part I, part II, part III.
Well, the first prototype worked out pretty well. But, hey, one can always do better. So, I sought to make the board smaller by squeezing the components closer together and, more importantly, making it a two-layer board by putting traces and components on the top and bottom. One other major change is that I put a little slider switch on the board for turning the thing on and off. Other devices people have cobbled together often don't include an on/off switch, and I don't really know why. Even if there isn't anything plugged into the USB port, the lack of a switch will cause the batteries to slowly drain away. I had always had a switch in the design, but figured it would be somwhere off the board, a part of the case, and run wires between the two. Then I realized that there wouldn't be much free space in the case, so the switch and the board would be sitting right next to each other anyway. Soldering something to a board is a lot easier than soldering tiny jumper wires between things.
Anyway, this is how the new design looks in Eagle. Looking at board layouts takes a little getting used to. The red is the copper on the top layer, blue is the bottom layer. The backwards writing is on the bottom layer, too - it looks right if one were to flip the board over. The green circles are called plated thru-holes which, as the name implies, means that they are holes that go through the board and are plated with metal to be conductive and solder-able. Some thru-holes are places to attach components, others connect signals between the top and bottom, called vias. This is just a two layer board - imagine the complexity of a six or eight layer board! When things get that complicated, PCB layout folks rely heavily on auto-router programs that use various optimized algorithms to connect signals together. Eagle does have an autorouter, but this I did by hand.
Next I need to have a colleague route this out so that I can populate it. I am also working on a mechanical CAD model of the board, batteries, etc., so that I can design the case just right. Stay tuned.
Posted by
-A
at
9:14 PM
0
comments
Monday, April 21, 2008
AA to USB, part III
This is the continuation of my little project to build a device to power a USB port off a pair of AAs. Click for part I, part II.
It is a wonderful thing to work where I do. I could just bop in this weekend, grab a couple of resistors and capacitors from the large and varied stock on hand, fire up the soldering iron, and see if I can't this here board working. Don't worry about misappropriating company resources: the resistors go for about $0.02 apiece, and maybe $0.10-$0.50 for the capacitors. The inductor might be a whole dollar...I'm not sure - it's the big red thing that clearly doesn't belong there. My intended design uses a surface mounted inductor that is much smaller (a footprint a tad larger than the chip in the middle). I used this red bo-huncker because I didn't get around to ordering my own parts from Digikey until just yesterday. (It's a handy thing that Digikey is located in Thief River Falls, MN. It means that I'll probably have my parts delivered by the USPS tomorrow without having to pay for expedited shipping.)
The unsightly orange wire (ok, a LOT of it's unsightly, but that's the process of creation) is a jumper that bypasses some components I didn't feel like putting on this first prototype. The red and grey wires coming in from below are the input power; the ones on the left side are the 5V output. Again, I would have put an actual AA battery holder and USB port on this board, but I didn't have them on hand. Besides, with free wire leads, it was easier to hook the board up to a power supply and multimeter for testing the input and output, respectively.
The red LED I threw in there to tell me if I'm getting any power out of the thing. In my ultimate design, that LED will shine on the side of the case, and will be green instead of red. Again, this was just a stopgap to expedite the testing.
Ok, on with the testing. Turns out that I initially soldered that orange wire in the wrong place - shorting the input power and ground together. So, it was a good thing that I was testing the board with a power supply instead of actual batteries - a power supply can be reigned in and deal with short circuits gracefully without blowing up. Batteries, on the other hand, don't like short circuits very much. Even if it isn't as potent as a shorted out laptop battery, a shorted AA can get dangerous and toasted in a real hurry.
I suppose I shouldn't have been surprised. Even simple circuits rarely work right the first time. I'm glad I didn't burn anything at least. A bit of troubleshooting, a little more soldering, and eventually I realized my mistake. After that, when I turned the power on, I got a nice glowing red LED and a multimeter readout of 5 V. Mmmmmm, glowing light!
Of course, an LED doesn't really require all that much power to light up, which is why they'll eventually replace compact fluorescents. One of my goals with this doohickey is to be able to supply the full 500 mA of current at 5 V that the USB spec call for - 2.5 W of power. So, to push things a bit further, I ganged together a bunch of resistors to force the device to supply more current. I'm pleased to say that it did so without a hiccupy.
Ok, so this at least proves that I can still follow a chip's datasheet and do a circuit layout. What next? Well, I already mentioned that I ordered parts - enough to populate a couple more boards. I am also working on a new revision of the circuit board in the hopes of making it smaller. This board would have copper traces and parts on both the top and bottom. I think I'll also pay to have this board fabricated for real, which means it won't be bare copper, but also have the familiar green coating on top and white markings and such. I'll post when again I get that sorted out.
Posted by
-A
at
7:28 PM
0
comments
Saturday, April 19, 2008
AA to USB, part II
This is the continuation of my little project to build a device to power a USB port off a pair of AAs. Click here for part I.
So, I started casting about for components. Thankfully, the proliferation of USB devices provides plenty of possibilities and reference designs. I found a nice chip designed for this exact application from Texas Instruments, the TPS61092. It's a tiny bugger (more on that later), but it satisfies the two things I wanted to improve upon. It can supply up to 500 mA at 5 V, and would be upwards of 96% efficient in converting the power, which means that more of the energy in the AA batteries is delivered to the device, and less is lost to heat. It also has two features I haven't found in most other DIY ipod chargers - an input to turn the thing on and off (most designs are on all the time unless the batteries are pulled), and an output that lights up when the batteries get low.
I wanted my design to be compact, which implies implementing it on a printed circuit board and using surface mount components. In order to do a printed circuit board properly, one needs to first lay it out on a computer. I used a free program for this, popular in the Make and open-source communities, called Eagle. It looks and operates like most other electronics CAD program I've ever used, but the controls take some getting used to. It's a bonus that it works on my Mac laptop - most are windows only.
If I were posting this on Instructables or Make, I would go through some of the process of explaining the design. Instead, for a more lay audience, I'll just throw up some pretty pictures.
This is how the layout looks in Eagle. The white outline at the top is the USB port, which should put the size of things into some perspective. The whole board measures 1" x 1.5". I am pretty sure I can eventually cut that in half. All the red are the copper tracings. This board only has one layer of such tracings, which makes it easy to prototype. I had a coworker take this design an cut it out on something called a board router. A board router is like a dremel tool with a tiny cutter tip that is attached to an X-Y stage. What it's routing is a sheet of fiberboard that has copper adhered to the to and bottom. The cutter tip cuts the unwanted copper away, leaving the traces you want behind. This is a relatively quick way to prototype a circuit board, but usually only in one or two layers. A computer or cellphone has a circuit board with 4-8 layers - very complex - and gets made with a different process.
I said earlier that the chip, the TPS61092, was a tiny bugger. Well..it is. The chip measures 4 mm to a side, and has 16 miniscule contacts around the perimeter. Most surface mount chips have leads - little bits of metal that extend out from the package a bit so that you can get some solder onto them. This chip doesn't have leads that extend out, they only are on the edge, and they're 0.3 mm wide. What is more, the underside of the chip is itself one relatively large contact - for heat dissipation. Being on the underside means that I can actually get a soldering iron onto it to heat it up. But, with some a little help and advice from another coworker who does this kind of thing for a living, I was able to get the chip soldered on.

Here's another view, from an angle, so that you can see the small leads soldered on. In doing this delicate hand soldering, it was quite helpful to have a device somewhere between a microscope and microfiche viewer. It magnifies the view and puts a lot of light on it, so you can see what you're doing and inspect it later. It also magnifies every tremor in your hand, amking you believe you'll never be able to hold anything steady, even if you've skipped the coffee. Looking into the scope at the magnified work area, tiny tweezers shaking in one hand, soldering iron shaking in the other, I was put in mind of how a neurosurgeon must feel anastomosing a 2 mm blood vessel in the brain. Thankfully my life doesn't depend on the outcome of this fine work - just my ego.
Next time - populating the rest of the board, and trying to get a pulse...
Posted by
-A
at
5:53 PM
0
comments
Friday, April 18, 2008
AA to USB
Over a couple of posts, I'll be describing a little project I've been working on. When all is said and done, this device will take a pair of AA batteries and use them to power a USB port, something called a boost converter. What's that good for? It could be used as a backup power source for something that is powered or recharged over USB, such as an ipod. My iphone gets about 4 hours of video playback on a full charge - this device I'm making could be used to augment or recharge the iphone battery to double that playback time - good for long flights.
Now, the end result will be useful, but is hardly the point of the project. If I was actually interested in having such a device, I could just buy one. If I wanted something cooler than store-bought, I could purchase a Minty Boost kit, a tin of Altoids, then have a fun for an hour with a soldering iron.
No, the point of this project is the design of it and the doing of it. I haven't done much electronics work since I left college, so it's nice to dabble in it again. Partly I wanted a little side project. Another part of it was that, while looking over the development and design of the Mint Boost, I thought that I could do a better job. It's a cool piece of work, and the Altoids tin gives it some geek chic, but there were two things I wanted to improve on. The first is a limitation on current. The chip at the heart of the Minty Boost, a MAX756, is spec'ed for only 200 mA at 5 V. The USB specification is to be able to supply up to 500 mA at 5 V. I'm not sure what the power draw of an iPod is while it is playing something and recharging, but I figure I may as well try and satisfy the spec. The second limitation is efficiency. The Minty Boost does better than most DIY designs, but is only about 85% efficient. I figured I could do better.
Tune in next time for the start of the design, and oh so tiny components...
Posted by
-A
at
2:03 PM
0
comments