Tag Archive: DIY


Today in LabLulz, I’m going to walk through a recent preparation I did in my chemistry lab: increasing and measuring the concentration of hydrogen peroxide.

WARNING: This procedure involves heat and the end product is a powerful oxidizer. Don’t get burned and don’t get it on yourself – wear gloves, splash-resistant goggles, and an apron. I had a spill of ~15%, all over everything, including myself. It was okay, but only because I followed safety protocols. I didn’t have the apron though, and I had to get pantsless.

Hydrogen peroxide is an interesting substance; it’s formula is H2O2, meaning that it is composed of two hydrogen atoms bonded to two oxygen atoms.

sdfsfasdf

Figure 1. Behold, the hydrogen peroxide molecule!

It is a powerful oxidizer, decaying into water and free oxygen. This is because the bond between the two oxygen atoms, called the peroxide bond, is unstable. Some substances which contain the peroxide bond are even explosive, like triacetonetriperoxide. Because it’s an explosive precursor, and somewhat dangerous on its own, concentrated hydrogen peroxide can be difficult to come by. The weak 3% solution found in drugstores is all that is available to DIYers, hobbyists, and other scientists outside of the mainstream chemical supply chain.

Fortunately, it is relatively trivial to increase the concentration from 3% to around 30%. There are several tutorials on the subject at YouTube (TheChemLife; zhmapper, nerdalert226) so I’m going to focus on measuring the concentration of the end product, a procedure which the videos tend to treat very qualitatively. I hope this tutorial will be informative and useful, even outside of punklabs; the process is easily generalized and density is important in many fields, including medicine and winemaking.

The concentrating procedure is pretty simple: pour about 500 mL of the 3% solution into a beaker and heat it, forcing the excess water to evaporate until there is a tenth as much liquid left (peroxide boils at 150 C, compared to 100 C for water.) There are only a couple of tricky points: the liquid must NOT boil, only steam – if it starts boiling, the peroxide will decay. Bits of dust and dirt will also cause disintegration, so the equipment must be kept very clean and free from scratches.

Okay, so after a few hours, I have about 50 mL of liquid. I drop a bit into a solution of corn starch and potassium iodide, and the mixture turns black, a positive test for oxidizers. I add a squirt to some sulfuric acid and copper wire, and the metal wire begins bubbling and the solution begins to turn blue with copper sulfate*. This reaction is faster and more vigorous than when I try it with the 3% solution, so I’ve clearly succeeded in increasing the concentration, but to what level? To answer that question, I’m going to measure the density of the solution.

The Setup

Figure 2. The Densitometry Setup. Note the safety equipment. Note also the lab notebook, which is essential. Other sights include a bit of iron oxalate, tongs, and a desiccator.

Here’s my setup. I don’t have a nice buret with a stopcock, so instead I have repurposed a graduated medical pipette (I picked up a huge box of these at the Scrap Exchange). This is controlled with a valve and a syringe plunger. It’s a little drippy and derpy, not great for dispensing a planned volume, but it works fine to measure the amount that has been dispensed, which is sufficient for our purposes. The milligram scale was lent to me by a friend after armed thugs stole my old one (thanks, B!) The brown glass vial is good for containing peroxide, since light speeds up its decomposition.**

Once the room and the beaker are at the same temperature (20 deg C), I draw about 8 mL of my peroxide up into the pipette, and start adding peroxide a bit at a time. By the time I had figured out the fluidics system, I’d added about 3.0 mL, so that’s where the data start. I then would squirt a bit of peroxide into the vial, note the volume and the mass, and repeat. I took 8 different measurements this way.

Then, after I put everything away and cleaned up, I sat down with a cup of coffee for a bit of data entry.

sdfasdf

Figure 3. Data, in analog and digital form. This is a page from my lab notebook, and the spreadsheet in gnumeric (inset).

I usually store my data in spreadsheets, and my processing and analysis with Python. Once the spreadsheet file is ready, I get started and load up my data.

$ ipython –pylab

In [1]: import xlrd
In [2]: phial = xlrd.open_workbook('densityData.xls')
In [3]: data = phial.sheet_by_index(0)
In [4]: raw_volume = data.col_values(1)[5:]
In [5]: raw_mass = data.col_values(3)[5:]

Next, I take a quick peek at the data just to make sure that everything is as expected.

In [6]: plot(raw_volume, raw_mass, 'bo')
test

Figure 4 Plotting the raw data.

Looking good; the data are nice and linear, meaning that the slope (and therefor the density) is well defined. But this is the raw data, which include the mass of the bottle. I also didn’t start at zero on my pipette, just wrote down the volume the liquid was at when I took each mass measurement. It doesn’t matter too much, but strictly speaking, we want to compare just the mass of the liquid in the bottle to the volume of liquid drained from the pipette. Let’s go ahead and calculate that (it’s a lot like calculating temperature anomaly.)

In [12]: volume = array(raw_volume) - 3.0*ones_like(raw_volume)
In [12]: mass = array(raw_mass) -9.988*ones_like(raw_mass) 

Much better. Now, to get some basic statistics on these data, let’s apply a linear regression.

In [13]: from scipy import stats
In [16]: (m, b, r, p, std) =stats.linregress(volume, mass)
In [17]: (m, b, r, r**2,  p, std)

Out[17]:
(1.1189534883720933,
0.067450581395348319,
0.99932418729044048,
0.99864883130369941,
7.7125664942037092e-10,
0.01680292147514929)

It’s mostly the slope, m = 1.12 g/mL, which we’re interested in.

In [16]: linFit = polyval([m,b], volume)
In [29]: plot(volume, linFit, 'r-')
In [30]: plot(volume, mass, 'bo')
In [31]: title('Mass vs. Volume for H2O2')
In [32]: xlabel('Volume (mL)')
In [33]: ylabel('Mass (g)')
In [36]: text(1.25, 4.5, 'M = %fg/mL*V + %fg'%(m,b))
final

Figure 4. The mass of peroxide is plotted as a function of its volume, and a linear regression applied.

Now that we have the density, we can use this graph from H2O2.com.  (It’s derived from Easton et al 1952. The paper actually reports on density measurements at 0, 10, 25, 50, and 96 degrees, so these are probably interpolated curves).  We’ll draw a horizontal line at the measured density (~1.12 g/mL) until we hit the curve corresponding to the temperature (20C). Then we draw a vertical line and read off the concentration where it crosses the horizontal axis. Result? The concentration is about 32%. (Figure 5)

asdfasdfasdfsd

Figure 5.

You may wonder why I went through so much trouble of taking multiple data points and calculating a trend line. If density is defined as mass per volume, then surely I can measure it in one go, by massing a single sample of known volume. Right? The problem is that any one such measurement might be a little wonky. Maybe one fewer drop than usual wiggled out, or a draft of air was pushing down a little on the scale. Look back at Figure 4; see the data point third from the end, visibly above the trend line? If I was only taking one measurement, I might get unlucky enough to get an outlier like that one.  By using a linear regression, I can aggregate the data, and hopefully all those small outside factors will tend to cancel out.

Another reason is that the linear regression allows us to calculate uncertainty in the slope of the line, and therefor in the density. There are good online explanations of this, so I’m just going to churn through the equations.

In [26]: N = len(volume)
In [27]: unc = std *sqrt(N/(N*sum(volume**2)-sum(volume)**2))
In [28]: unc
Out[28]: 0.005463100999105781

We can thus report the density as 1.119 +/- 0.005 g/mL. If we wanted, we could use the uncertainty in the density to calculate the uncertainty in concentration the same way we calculated the concentration estimate: plot lines at 1.119 + 0.005 g/mL for the upper bound, and 1.119 – 0.005 g/mL for the lower bound and work backwards to get a confidence interval of concentrations. In our case though, the uncertainty is so small that it’s about the width of the original line not really worth propagating.

I feel comfortable just calling this 32% peroxide. Success!

* An easier, quicker test is to add peroxide to a catalyst that causes it to decay, but I didn’t have any manganese dioxide or horseradish on hand. Also, everyone loves copper sulfate.

** This is really a moot point, since I am keeping this sample in the fridge, and there is not even a lightbulb to philosophize about. But it’s also why you buy peroxide in opaque bottles.

~~~

Easton, M., Mitchell, A., & Wynne-Jones, W. (1952). The behaviour of mixtures of hydrogen peroxide and water. Part 1.?Determination of the densities of mixtures of hydrogen peroxide and water Transactions of the Faraday Society, 48 DOI: 10.1039/TF9524800796

How did TopOc do on last year’s to-do list?

Not bad! As consistent readers might have noticed, the big news behind the scenes is that I have gotten involved in another production space, LumShop. Not only is it providing facilities for DIY Spectro development, it is also kindly hosting my chemistry lab! This will end well, I’m sure.

So what’s next?

  • Even more hard-hitting commentary and sass
  • More fractals and fungaloids!
  • Augmenting and measuring the concentration of hydrogen peroxide!
  • Third generation DIY Spectro!

Between this lineup and my lab, I’m sure the site will stay busy, but if you have any requests or suggestions, leave a comment!

There is a companion article exploring the issue from the perspective of environmental monitoring over at ArkFab.

Human influence on the environment has increased dramatically over the last 10,000 years, to the point that some geologists have argued that human reworking of the earth defines a new geologic age, The Anthropocene. (Zalasiewicz et al, 2008) Much of the focus has been on relatively robust, tangible changes in biogeochemistry. Examples include:

  • megafaunal extinction, accelerated erosion (Zalasiewicz et al, 2008) and nitrogen fixation resulting from the spread of intensive subsistence patterns
  • the loss of stratospheric ozone resulting from the release of novel chlorofluorocarbons

However, fleeting and less tangible effects are also important. Two examples are:

  • the light pollution resulting from urbanization and transportation infrastructure
  • changes in the acoustic environment resulting from direct addition of sonic energy and memes, as well as indirect sources.

A year-long composite view of the earth at night, showing human light generation. White lights are cities; blue lights are fishing boats; green lights are natural gas flares, and red lights are ‘ephemeral light sources’, interpreted as fires. Image from  NOAA National Geophysical Data Center – click for source + discussion.

Light pollution, the scourge of urban astronomers, is a well-accepted phenomenon with serious consequences. A 2004 review begins:

In the past century, the extent and intensity of artificial night lighting has increased such that it has substantial effects on the biology and ecology of species in the wild. We distinguish “astronomical light pollution”, which obscures the view of the night sky, from “ecological light pollution”, which alters natural light regimes in terrestrial and aquatic ecosystems. Some of the catastrophic consequences of light for certain taxonomic groups are well known, such as the deaths of migratory birds around tall lighted structures, and those of hatchling sea turtles disoriented by lights on their natal beaches. The more subtle influences of artificial night lighting on the behavior and community ecology of species are less well recognized, and constitute a new focus for research in ecology and a pressing conservation challenge. (Longcore & Rich 2004)

The amount of sonic energy released by human activity is recognized as an urban nuisance as well as an occupational safety concern. It also has recognized ecological effects: urban European robins have begun singing at night, when they have less acoustic competition. (Fuller et al 2007) Frogs have begun changing the pitch of their croaks in order to talk over traffic noise (Paris et al 2009)  In addition to sonic energy, human activity has released sonic memes into the environment. A meme is a self-replicating information pattern; jokes and computer viruses are two examples of memes. A person or computer acquires a meme and then spreads it, through retelling or infected emails. Sonic memes, such as ambulance sirens and cellphone ringtones, have been picked and repeated by songbirds. (Stover 2009) This is very interesting: human memes, the basis of Richard Dawkins’ ‘extended phenotype’ concept, have organically extended into other animals’ extended phenotype. (Recent reports of dolphins mimicking human speech are also very interesting in this context. The reverse flow also occurs, as animal communications are repackaged as ringtones or ambient music.)

View full article »

dont forget the crystals

Magnesium sulfate crystals, clingin’ to a petri dish. Chillin’.

Another quick lab snap. These are some nice crystals I grew. I was washing an earlier, less photogenic crystal garden with alcohol, and catching the runoff in a petri dish. I let it evaporate and was greeted with this happy little accident! The crystals are magnesium sulfate, available as Epsom salt at most pharmacies.

haxor hijinx: a DIY hotplate

I have, once again, found myself at the helm of a DIY lab, this one with a chemical wetlab focus. I’m sure this will provide lots of material in the future; right now, I want to share a protip I came up with the other night. I have been using soda can alcohol stoves for heat, but this isn’t always appropriate. You can’t heat flammable mixtures, and they leave soot on my glassware. But I don’t have a hotplate yet! What’s a gutterpunk labnerd to do?

Don’t forget the boiling chips!

It’s won’t spin a stir bar, but a clothes iron will do fine as a hotplate! You can see that I’ve secured this one to the lab bench with wood and a clamp for extra stability.

 

 

DIY Spectro II

There is a more philosophically focussed companion article over at ArkFab.

At long last, second generation DIY spectro has arrived!

The spectrophotometer. Yes, that is an invisibility cloak. You can't see the stuff that's under it can you? Then that stuff is invisible!

If you recall, when last we left our humble spectrophotometer, it was a shambling mess of stone-age technology. Now, its a shambling mess of information-age technology!

Let’s take a closer look… View full article »

A Detective Story

About to run the Final Qualifying Round for some second generation DIY Spectro, I placed the first blank into the cuvette holder, and pressed start (or rather ran python tryna.py; I’m tryna measure a spectrum, gosh!). The machine hummed into action, now that the motor control wire was plugged into slot 9, which the computer was communicating with rather than slot 2, which the computer was not.

A few minutes later I got the results: Nothing. The machine was not seeing any light. At all.

See, normally when I scan a blank sample, the detector (which has different sensitivities at different colors) shows a characteristic hill shape:

Some typical blank sample runs. Horizontal axis is motor position in degrees (0-180) and vertical axis is detector response. Black is the mean of the time series coming from the detector at a given motor position (1 sec data per degree); green is the standard deviation of the time series, and red denotes the maxima/minima. Time series were preprocessed to remove annoying serial communications glitches.

But when I ran this blank: View full article »

DIY Spectro

UPDATE: There is a newer, more automated version of this project here, and an FAQ section here.

For the last while I have been concentrating on a project: developing an easily built spectrophotometer for low budget and DIY laboratories.

At the subatomic level, light is made up of entities called photons. Photons are electromagnetic vibrations; the speed at which they vibrate (in vibrations per second) determines the color of the light. Red light has a relatively slow vibrational frequency, while purple light has a faster one. The frequency also determines the energy that the the photon has: the faster a photon vibrates, the more energy it has. A photon of violet light has more energy than a photon of red light.

White light, like that from a halogen lamp, contains photons of a lot of different frequencies. However, you can use a prism or a diffraction grating to break that light up into its component colors, to get the familiar rainbow:

 

The spectrum of a halogen lamp

The above image is from a spectroscope I built during development. It’s made from bamboo, duct tape, pieces of beer cans, and an old CD: the perfect combination of steampunk, cyberpunk, and drunkpunk.

 

I did this spectroscope myself.

View full article »

Follow

Get every new post delivered to your Inbox.