Jon's Place

Monday, January 19, 2015

Work Stuff

Some of you might be interested in the stuff I am doing at my day job (Mozilla - been working for them for two years now).

In general, I'm building tools for measuring power consumption on FirefoxOS phones. Those tools include hardware and software components. I did a post a little over a year ago, when I first started working on power stuff.

This year, I'm building a new version of the battery harness, one that is portable. The idea is, you attach it to your phone, and spend the day wandering around, doing whatever it is that you do, and all the while the battery harness is logging power usage data to a micro SD card.

I assume the people reading this are more interested in how it all works, so I'll dive down into the details now.

The battery harness basically pulls the battery out of the phone, and provides a secure mechanical adapter to power the phone from the battery, while allowing the positive line to be intercepted, between the battery and the phone. This shunt goes to the ammeter (a custom board that I designed and built), and the ammeter measures voltage drop across a resistor to get instantaneous current.

Normally, the ammeter is in a small 3D printed box, and is connected to a PC view a USB cable. There is an AVR on the ammeter running some custom C code, and it sends power usage data over this USB cable to a Python application running on the host PC. With this new portable harness, I mounted the ammeter directly to the harness, and mounted a Sparkfun OpenLog board under it, connected to the debug hardware serial port on the ammeter (which normally isn't used). You can see these pieces on the following pictures:


Portable Harness with Ammeter

Bottom of Portable Harness, with OpenLog Board


You can also see a small Pololu Voltage Regulator board tucked in there in the second picture. It is a step-up/step-down regulator, and produces a steady 5 volts from anything between 2.7 and 11.8 volts.

Normally the ammeter is powered from the host PC over USB, but with this setup there is no host PC. We can't power it from the phone, because that will interfere with the power consumption measurements. So I got another little single cell 850 mAh Lipo battery from Sparkfun, and mounted it where the phone battery would normally go. It provides 5 volts (using the regulator) to power both the ammeter and the logging board.

Here's what it looks like together:

Portable Battery Harness
I designed and 3D printed a cover, so you could put the whole assembly into your pocket without electrocuting yourself or damaging the electronics. In the above picture, the cover is on the left, and contains an on/off power switch, a charge port (for the small lipo battery), and a neat little turning catch to hold it in position.

Here's what it looks like put together:

Portable Battery Harness with Cover
It make the phone somewhat thicker of course, but it allows you to still use all the features of the phone (including the camera) while measuring power consumption.

Here's a picture with the power switch on. The three LEDs are on the ammeter - green is power, red is a flashing heartbeat, and yellow is an indicator for a software switch on the ammeter. The OpenLog board has a small blue LED, but you can't really see it in the picture.

Portable Battery Harness - Powered Up
There is still a lot of work to do on this - the charging system is not ideal, and I'd like to integrate it better, I also need to write some software on the phone itself, so it logs specific events (like "Took a picture") that can be correlated with the power log. I also need to figure out a way to monitor the voltage on the small LiPo, so I don't accidentally drop its voltage down below 3.0 volts (which can cause permanent damage to these batteries).




Friday, January 16, 2015

Arduino Robot

So, its been quite a while since I last posted here. Sorry, haven't been working on anything robotics related in a couple months. Today I got a robot in the mail from a contest I won over at Diigiit Robotics. This is the first robot I've owned (other than bioloid kits) that I didn't design & build from scratch myself.

Not sure what I'm going to do with it, but you never know...