Jon's Place

Friday, September 27, 2013

So up until a month ago, I was working on performance related aspects of Firefox OS (I'm an employee of Mozilla). The performance team did a team meetup in Toronto at the end of August, and one of the team members thought it would be cool to use this digital USB ammeter to measure current draw from our phones.

3D CAD Model
I said "I know how to do that stuff", and in short order whipped up a 3D model of a battery harness that would allow us to insert a shunt into the + line between the battery and the phone, and feed that shunt to the ammeter. I printed a couple versions of the harness on the in-office Replicator 2, and wasn't very happy with the print quality. I sold my Dimension uPrint earlier this year, so I ended up going to a commercial printing place and had it printed on a uPrint. It came out beautifully, of course, so I designed a little printed circuit board for it, and had that manufactured.

Python Ammeter Script
I wrote a simple python script to sample the data from the ammeter, and within a week I had a pretty neat setup...

Battery Harness
I demoed this setup at the work-week in Oslo at the beginning of September, and it seemed to be well-received.
After I got back from Oslo, I started work in earnest on this. We decided that the commercial ammeter didn't have the features we needed (specifically the ability to remotely disconnect and reconnect the battery line to force a phone restart), and although the company makes custom parts, having a single prototype to test with before ordering 200-300 boards wouldn't work for us. So, I sat down and started reading data sheets and ordering parts. My brother Dave Hylands (who also works for Mozilla on Firefox OS) has been an enormous help in all this.

Ammeter Schematic
As of today, I have prototyped (on a breadboard) all the parts I need to make this happen. We (Mozilla) ordered a commercial 3D printer, and once it gets here I'll be able to start cranking out models. I've designed the ammeter PCB, and have ordered the first iteration of it. I'm hoping to have enough time to populate the board before I leave for the Mozilla Summit next week, so I can bring it with me to show people (I'll be in Santa Clara).



  • Very neat! Look forward to seeing it in Santa Clara!

    A few suggestions for the schematic,
    * When the switch is off, R7 will slowly drain the battery. Likewise, it will charge the battery when the switch is on and the phone is not connected. Can R7 be removed?
    * There should be an anti-aliasing filter between the amplifier and the ADC, to reduce aliasing in your samples.
    * The ADC should ideally use a voltage reference. Currently, the ADC is referenced to Vcc, which means for a standard USB supply of 5V +/- 5%, you could get a +/- 5% error in your measurement plus noise from supply fluctuations.


    By Blogger Jim Chen, At October 1, 2013 at 11:00 PM  

  • Jim,
    R7 is there so the device will be usable with the harness with the ammeter not plugged into the computer.
    Lets get together and talk in Santa Clara - I would welcome some help from someone who actual knows how to do electronics...

    By Blogger Unknown, At October 2, 2013 at 11:29 AM  

  • I'd love to! I have to demo at the Fennec booth during the innovation fair, but I'm sure we can find other times.

    By Blogger Jim Chen, At October 2, 2013 at 6:01 PM  

Post a Comment

Subscribe to Post Comments [Atom]

<< Home