Liquid metal batteries

April 29, 2010 | categories: energy, engineering | View Comments

I've recently started a contract at work for Professor Donald Sadoway's lab at MIT working on liquid metal batteries. I can't describe the details of the project I'm working on, but the research going on in the lab is quite interesting. The idea is to solve the problem of energy storage that accompanies all of our promising renewable energy solutions, like wind and solar. When the wind stops blowing or a cloud obscures the sun, the electrical grid still needs to supply energy to the world. If you only have a small amount of renewable power attached to your grid, you can just ignore the problem, but around 20% penetration, you get into trouble. Our best solution right now is either firing up natural gas turbines to cover the peak loads or pumping water up a hill when we have extra capacity so it can run down through a generator when we need it back.

What we really need are massive, cheap, efficient batteries. The idea in the Sadoway lab is to make something like an aluminum refinery, but instead of just sinking huge amounts of electricity to extract aluminum, you set up a reversible reaction so you could get the electricity back later.

Go take a look at this awesome, enormous picture of one of these furnaces in an aluminum refinery so you know what I'm talking about. Look at the size of the guy in the picture, and then look at how many furnace chambers there are in the row. That's an industrial scale operation.

To make aluminum, you dig bauxite out of the ground and use heat and sodium hydroxide to extract the part that's aluminum. What you get out, unfortunately, is oxidized aluminum, known as alumina. This is because aluminum, in its elemental form, reacts with oxygen, and when it sits in the earth for eternity, there's plenty of air seeping around, so all of the aluminum bonds with oxygen.

Fortunately, we have electrochemistry on our side. The large smelting furnaces in the picture you looked at a moment ago are long steel troughs that are lined with carbon and filled with aluminum oxide. These form the two electrodes in a chemical reaction. When electricity is run through the carbon into the aluminum oxide, the oxygen releases from the aluminum and bonds to the carbon, creating carbon dioxide, which is then vented to the atmosphere to help keep the planet warm. During the reaction, the aluminum oxide in the center heats up and liquefies, while the outer crust remains solid, sort of like the liquid-filled gum of the 70's, Chewels. (You may also recall Freshen-up, "the gum that goes squirt.")

To turn this process into a battery, we need an electrode that doesn't turn into a gas, and we'd like both electrodes to be cheap and lightweight, relative to the amount of energy they can store. Sadoway's lab started with one magnesium electrode and one antimony electrode, with a salt electrolyte in between. (They have since moved on to better combinations that I'm not at liberty to describe.) If you heat the core of the battery up to 700 C, everything becomes liquid, and the resistance drops substantially. Most remarkably, the three materials separate by density — electrode, electrolyte, electrode — all in a stack.

What's so great about a liquid metal battery? They have several advantages, notably extremely low internal resistance and huge current capability. Aluminum refineries run at currents above 100,000 amps. For comparison, most household circuitbreakers blow at 15 amps. The low resistance of liquid metals means that the battery is likely to charge and discharge very efficiently.

At first, the fact that the battery needs to run at high temperature seems like a major disadvantage — if you have to dump a lot of energy into heating, that makes the battery less efficient. This is true, but what's not obvious is what happens to a furnace's thermal behavior as it grows in size. In general, hot objects cool off in proportion to their surface area, which grows proportional to the square of the size of an object, roughly speaking. The capacity of a battery, however, grows with its volume, which is proportional to the cube of its size. This means that as the battery becomes huge, the amount of heat loss per unit of capacity decreases, i.e. the volume overwhelms the surface area. It's this same property that allowed icehouses in pre-industrial times to store ice well into the summer. There's some hope that at the right scale, with the right insulation, the small inefficiency in charging and discharging the battery will suffice to keep the core in the molten state.

So that's what I'm working on recently. (I'm still working on a Linux board on the side, but it's kind of on the back burner for the next month or so.)

Read and Post Comments

Designing embedded systems with web frameworks

April 12, 2010 | categories: rascalmicro, python, embedded electronics, django, engineering, geekery, linux | View Comments

I have a prediction.

We're about to see a shift in embedded systems development. Around 2008 or 2009, embedded microprocessors like the one in your cellphone, reached a threshold where they can perform as decent webservers without special tuning. Even with a slow database query or some inefficient templates, they've got the speed to handle real web serving. This means that suddenly the most efficient development pattern for embedded systems is not the proprietary hardware and software tools that have dominated the industry for the last 30 years, but the open source web development tools that have arisen in the last decade.

The transition will be painfully slow, and of course there are some niches where specialized hardware and real-time control will preclude the use of generic web tools-- motion control springs to mind. But I think that the combination of cheap hardware and modern web frameworks will crush the industrial controller market, like digital cameras did to film cameras.

First, some background on tiny computers

There are millions of tiny computers used for monitoring and control systems around the world. Let's break them into two categories: small (microcontrollers like the Arduino or a PIC development board, which runs $10-500) and large (embedded controllers like National Instruments hardware, which cost $500-5000).

To use the small ones, you write code from scratch, perhaps with some pre-written libraries to talk to certain peripherals and a bootloader to run your code on power-up. The vast majority cannot be connected to the internet without substantial effort, and when connected to the internet, they aren't powerful enough to work like most servers on the internet. For example, a webserver built on a small microcontroller would be overwhelmed by the background noise on the internet, i.e. traffic from bots and viruses. This kind of system is perfect if you want to log temperature in your basement, or turn on a light whenever the garage door is open. They're no good for running an inventory management system in a warehouse with 20 workers.

Below: an Arduino

The large ones come with an operating system, like Windows CE, Linux, or VxWorks. Most of the devices are reworked versions of hardware from the pre-internet days that have had Ethernet ports added to them. They can handle real internet traffic, but they usually use proprietary software to do it. They're shaped like a long, skinny shoebox.

Below: a larger controller

A programmable logic controller

The change is that something equivalent to the iPhone, which uses a 600 MHz ARM processor, can store years of data and serve it up to anyone with a web browser in seconds with hardware cost of a few hundred dollars. Industrial controllers lose on cost of both hardware and programming time, and performance. The hardware has to be expensive to support the R&D costs, which are borne entirely by each manufacturer. There's just no way that even a large industrial control company, which might have a dozen dedicated programmers at best, can compete with the thousands of developers working on open source web software worldwide.

How web software development has changed

In the 90's, software development for the internet meant either writing server software or designing static web pages. Starting around 2000 (give or take a few years), websites started incorporating dynamic data, which was stored in databases. Around 2005, a new kind of web software gained popularity-- the web framework-- with the release of Ruby on Rails.

With old-style web development, a web programmer would write code that inserted data into a database, more code that updated the database with new data, and more code that retrieved and sorted the data for presentation in a web page. With a web framework, the programmer writes out a template for how the data should be presented on a webpage, and the framework figures out what to request from the database. Web frameworks can't scale to the level of a big website like Amazon, but for low traffic systems, they work fine and reduce the programming time needed dramatically.

Most of the time, what people want to do with microcontrollers is log some data from sensors and maybe trigger some actuators in response. After they log the data, people want to analyze the data, make graphs with it, and then do it again, maybe with a different sensor. This matches well with the typical database-backed website. The only substantial additions are code to interact with hardware-- read sensors and trigger actuators. I think this is the least developed part of the systems I expect we'll see in the next few years.

Proof of concept

It's definitely possible that I'm just some blowhard on the internet. I mean, I'm at least some blowhard on the internet, but I might still be right in predicting this change. To that end, I've done some testing to see whether I'm going in the right direction.

Using an off-the-shelf microcontroller kit that cost $339 plus shipping, I installed a Python web framework called Django and wrote code to make it act like a thermostat to replace the one in our house. It took about 2.5 weekends to write the code, which is much faster than I could write a similar application for something like an Arduino with an Ethernet carrier board, and this was my first try. I had played around with Django a few times previously, but this was my largest effort by far.

Below: the proof of concept

The web thermostat in place

The hardware interface is just a cron job that runs once per minute. It queries a temperature sensor on the PCB using a short C program called by a Python script, which also logs the data to a SQLite database. Retrieval of a webpage that queries the database for the last 300 datapoints (5 hours worth) and generates a chart of the data using Javascript takes around 1.5 seconds. That's with a processor running at 250 MHz (relatively slow) and the database stored on an SD card. Most of the time is spent converting Python datetimes to Javascript timestamps.

I could have written a similar application even faster using a GUI tool like LabView, but that requires specialized hardware that cost 3-10 times more-- either a dedicated PC with a USB device for sensors, or a industrial controller with a sensor module. With Django, I got an administrative interface, allowing different users and groups different levels of access, for free. If I want a central repository of users with LabView, I'm looking at another $800 for the "Datalogging and Supervisory Control Module." If I want to talk to a SQL database, I'll need the "Database Connectivity Toolkit" for another $1000. This is on top of the $1500 I would have paid for LabView already, plus the hardware.

Embedded control systems running web services are still an immature technology at best, but I think they'll grow up quickly in the next few years.

Why are you writing this?

I've been thinking about this change for a year or two now. I'm working on developing something like the Arduino, but a little heavier duty, so it can run a web framework, but with the hardware drivers pre-integrated. Send me an email at brandon at or post a comment if you want to know when it exists for real.

Read and Post Comments

Estimating air changes per hour with a blower door

February 24, 2010 | categories: energy, estimation, engineering, heating | View Comments

When I was trying to figure out how big a gas boiler we needed for our house a few months ago, I tried to account for both the insulation in our walls as well as the air leaks that let warm air escape as cold air sneaks in. I had read that an old, drafty house turns over its volume in air once per hour. That seemed high to me, but I was looking for a conservative estimate, so that's what I used in my calculations. Since then, I've been hoping to find a way to make a better estimate.

Solution: Colin's blower door

The blower door in place

A friend of mine from Stanford, Colin Fay, runs a company with his dad, David Fay, called Energy Metrics. Last weekend, Colin and his nearly homonymic associate Cullen were kind enough to bring Colin's blower door over to our house to run a test to see how drafty our house is.

The basic idea of a blower door is this: you fill your front door with a curtain and a massive fan that forces air out of the house. While it's doing that, a small sensor measures the air pressure difference between the inside and outside of the house. There are a few different tests you can run, but the standard test that the fan controller runs is to automatically adjust the fan speed until the pressure inside is 50 Pa lower than outside. For comparison: 50 Pa is roughly equivalent to the pressure from a windspeed of 20 mph, but blowing at your house uniformly from all directions. Atmospheric pressure is around 100,000 Pa.

When the fan reaches a steady state, air is whistling in through all the gaps around your windows, doors and foundation, and you can tell where the problems are. For us, the largest draft was coming under the basement door. The next worst were the gaps between the sashes in our larger, older double-hung windows. In real life, I suspect that the gap under the basement door is not so bad-- the thermal gradient keeps the colder, denser air sunk down in the basement. I didn't realize it at the time, but most of the draft was probably coming down through our vestigial chimney.

Colin's blower door, a Retrotec 2000 with a DM-2 Mark II controller, pulled air through our house at 3900-4000 ft3 per minute to generate a pressure difference of 50 Pa. Our house has a volume of around 18000 ft3, so with the fan blowing, we were replacing all the air in our house every 4.5 minutes, or 13.3 times per hour.

Assembling the blower door frame

Assembling the blower door frame

The blower door from the inside

The blower door from the inside

Once you know how drafty your house is with a fan pulling the heavens through it, you need to scale that to match the typical conditions for your house. As a rough rule of thumb: just divide by 20. With the fan, we had 13.3 air changes per hour, so that's about 0.7 air changes per hour without the fan.

But if you want to ascend to the peak of Mount Energygeek, and you're willing to do it unashamedly, you can use the empirical corrections of Max Sherman of the Energy Performance of Buildings Group at Lawrence Berkeley National Lab, who completed his thesis on modeling building air infiltration in 1980, when oil rolled down like waters and righteousness like acid rain. You look up correction factors for climate (~18 for Boston), building height (0.7 for our house), wind shielding (1) and leakiness (1), multiply them together, and you've got a better correction factor than the rough guess of 20. For our house, we end up with 13.3/(18 x 0.7 x 1 x 1) = 1.06 air changes per hour.

With that knowledge, you can calculate the power required to offset the drafts cooling or heating your house. Our house, nominally a 1900 ft2 Victorian, has an internal volume of 18000 ft3, or 510 m3, so when it's 0 C outside, we're heating about 1.06 x 510 m3 of air per hour by around 20 C. The heat capacity of air is around 1200 J/m3C. That means we need to pour in 1200 J/m3C x 540 m3 x 20 C every 3600 seconds. By my calculation, that's about 3.6 kW.

The conductive heat loss model I developed for our house a few months ago when we were installing the boiler predicts that the conductive heat loss at the same temperature will be around 18 kW, so we lose about 1/6th of our heat from air infiltration.

Colin suggested we could reduce our draftiness by around 2x before we'd have to worry about the effects of too little fresh air (farts, basically). He suggested picking up a tube of transparent silicone caulk in the fall to fill the gap between the window sashes, as that's where our worst leaks are. In the spring, when it's time to open the windows again, the silicone peels off.

After seeing fellow energy geek Holly's sexy basement windows last weekend, I think I might look into replacing those as well.

Read and Post Comments

Measuring insulation with an IR camera

February 04, 2010 | categories: energy, engineering, heating | View Comments

I got my hands on a thermal imaging camera for a few hours recently and took a look around the house to see what I could learn. The camera detects infrared radiation, which is proportional to surface temperature. When you're inside a house in the winter, the poorly insulated bits look blue, because they're colder. From the outside, the poorly insulated parts look red, because they're hotter than the surroundings. (This is assuming you have the camera set to adjust the spectrum to cover the temperatures in the field of view. The camera I was using, a Flir i60, could either adjust automatically or stay fixed so you could compare temperatures across multiple pictures.)

I learned some interesting stuff. The gables of our attic appear to be completely uninsulated. There is one stud bay missing insulation next to our front stairs. I hadn't noticed it, but once I knew to check, I could feel the temperature change with my hand.

Our windows are generally our most poorly insulating surface, but in the picture below, you can see the panels in the front door are a close second. (The large box of fire is a radiator.)

Front hall, cats

I was thinking I should insulate the garage roof, but the thermal camera revealed that the door was leaking more heat.


I had noticed that our cats preferred lounging in certains parts of our kitchen floor, but I hadn't noticed the large cold stripe down the middle.

Radiant heat in the kitchen

Here, you can see that there are two rooms we aren't heating-- their windows are blue.


Read and Post Comments

Sizing a gas boiler

January 03, 2010 | categories: engineering, estimation, heating, energy | View Comments

When you own a house, you are forced into bizarre contortions to reduce the cost of maintenance. For example, our roof needs to be replaced, but part of that is repairing the chimney. We don't really even need the chimney, because we don't have any fireplaces left-- they were all removed decades ago, well before we owned the house. But, until late this fall, when we installed a new boiler and water tank, we still needed a way to vent our ancient and inefficient gas boiler and water heater, or the basement would fill up with carbon dioxide and soot. We realized that if we replace those first, we can buy efficient systems that need only a plastic pipe through a basement wall to vent, rather than a chimney. Our heating cost would drop, and we could just toss the chimney in a dumpster, which is cheaper than repairing it, and need only be done once. Also, when we do replace the roof, we don't have to worry about finding someone with the skills to make a reliable flashing around the chimney.

As a result, we decided to replace our gas boiler and water heater. (The water heater actually had some life left in it, but we just wanted to do this once and be done with it.) An added advantage is that we could tear out the matrix of steel pipes that undergirds our first floor and replace them with PEX tubing, so I no longer have to wear a helmet when I walk around the basement.

Knowing that we're going to replace the boiler and water heater, someone had to figure out how big the replacements should be. The water heater is fairly easy-- we had a 40 gallon tank, which was plenty for the two of us, given that our shower uses around 6 L (1.5 gallons) per minute. Given that we were replacing the boiler and the water heater at the same time, it made sense to install an indirect storage tank, rather than a separate water heater. With an indirect setup, the super-efficient boiler heats water to warm the radiators in the house, but it also has a second loop that runs through a heat exchanger in a water storage tank. The heat exchanger is necessary so you don't end up drinking water filled with radiator rust. The boiler manufacturer we considered most seriously, Viessmann, doesn't make a water storage tank smaller than 42 gallons, so that's what we chose. We also considered getting a boiler with an integral on-demand system (the WB2 6-24C), but the output looked a little shy of what we wanted. (She-who-takes-hot-showers overruled he-who-takes-long-showers on this one.)

Sizing the gas boiler is more difficult. Our old boiler was rated at 48 kW (164,000 BTU/h or 164 MBH). Our old boiler didn't modulate-- it either burned at full power or turned off. Using our gas meter and a stopwatch, I measured the full-power consumption at 3.0 ft3 per minute, which is 53.5 kW for natural gas, slightly above the nominal rating of the boiler. On a cold evening recently, when the temperature was holding constant for several hours around 33° F outside and 66° F inside, and there was no sun and little wind, I measured the duty cycle of our old boiler. Over a 133-minute period, it was burning 26 minutes, which is about 20%. This means that average power going into the boiler with a temperature difference of 33° F between inside and outside was 11 kW. Maybe 8 or 9 kW of that actually makes it into the house, while the rest goes up the chimney.

The choices

I was trying to choose between the Viessmann WB2 6-24 and the larger 8-32. (The parts of the names of the models after the hyphens are close to, but not equal to, their peak output in kW-- perhaps they were the design targets.) Both models are extremely efficient condensing boilers; depending on how they're loaded, they operate in the 90-98% efficient range. As they're loaded closer to peak power, their efficiency drops. It also drops with the returning water temperature-- if the water comes back from the radiators cold, it's draws in heat from the burner more efficiently than if it comes back warm. The radiators in our house were installed before insulation and storm windows were standard, so they're quite effective at distributing heat.

This suggested to me that our new boiler would probably be operating near the high end of its efficiency range; the real danger was that in the fall and spring, when just a little heat was needed, it would inefficiently cycle on and off, because its lowest level of modulation would be too high. The larger of the two models I was choosing between cut off at 11 kW, which, you'll recall, was what we were using at 33° F with a much less efficient boiler, so that made the smaller one seem like a better fit. (For those of you unfamiliar with the weather in Boston, the average daily high temperature in the coldest month is 36° F in January.) My estimation was that on a really cold night, we might have a temperatures outside in the single digits, and we'd keep the house in the upper 50's or low 60's, so call that a delta of 50 degrees, about 1.5 times the 8-9 kW we needed at 33 F-- call it 14 kW to be safe.

The last factor I thought about was wind. Our house is not particularly exposed, but I suspect a cold wind could double the heat loss, which would definitely max out the smaller boiler, which peaked at about 25 kW, allowing for boiler inefficiency. If that were the end of the story, I would have chosen the larger boiler, but there were three other factors. The first was that the new boiler would zone the radiators, so I could turn off less critical rooms if we were short on heat. The second was that I'd rather invest money in insulation than a bigger furnace. Finally, we were thinking about installing a woodstove (for strictly recreational purposes-- Sundays, crossword puzzles, and so forth).

The results, in which we learn whether Brandon is an idiot

Against the advice of the heating contractor, we got the smaller boiler. They did a beautiful job installing it in November. Last week, we had a very cold (sub-10° F), very windy night, and the system kept up with demand. We just got our first gas bill covering a month with the new boiler, and our gas usage dropped to 150 therms from around 250 therms for the same time last year, and last year was slightly warmer, so I'm pretty happy. The payback time on the added expense above the cost of an inefficient system will be less than 10 years, which is less than the warranty on the system (except the control electronics). The water storage tank, which is stainless steel, is warranted for the lifetime of the original owner in the original house.

I'd estimate that about half of the savings are from reductions in heated area (spare bedroom, attic) and half are from higher efficiency.


But nothing is perfect. Because we replaced all the large, cast iron pipes in the basement with PEX tubing, the basement hovers in the low 50s in the winter, rather than in the low 60s. This was expected, but I decided I'd rather wear a winter hat than a helmet. Also, because we're not losing heat throughout the system, the boiler runs a little cooler than the old beast, which means that the radiant floor heat in the kitchen has trouble keeping up on the coldest days. I think I can probably fix that by tweaking the boiler target temperature and the circulation pump flow rates.

One other wrinkle is the control scheme used by the new system. Viessmann boilers come with an external temperature sensor, which is mounted outside on the north side of the house. Viessmann's intent (I think) is that the installer calibrates the system to drive the temperature of the hot water supplied to the radiators as a linear function of the outside temperature and the return temperature of the water. The idea is that when the temperature outside changes drastically, the boiler can react earlier than if it had to wait for the effect to be detectable in the radiator water or thermostats. Strangely, our boiler is set up to use the two programmable thermostats we used with the old boiler. The brain of the boiler targets 75° F, but the circulation pumps for the radiators and the floor heat only turn on when the thermostats call for heat. I'm not sure that this is actually worse, but it sure is strange to install an external sensor if you're not planning on using the signal.


Here are the old system and the new system. If you click on the pictures of the new system, you'll get to Flickr, where I've added a few notes about what the different parts in the picture do.

Old system with headbanging pipes

The old gas boiler and the headbanging pipes

New system

The new boiler

Supporting plumbing for new system

Ancillary plumbing

Read and Post Comments

Older posts »