Friday, December 28, 2007

Acrylic Mirror Failures Learning Opportunities

The acrylic mirror samples arrived. I got 3 mirrors about the size of a credit card, but thicker, like a piece of glass.

OBJECTIVE: Create a "trough mirror" that focuses onto a line.

KEY FACT #1: Acrylic mirror softens and bends at around 230-250°F.

KEY FACT #2: A parabola is a mathematically perfect focusing shape, but (a small section of) a circle is plenty fine for my needs.


I got a big, glass jar with smooth sides. I put it lying down inside the oven. I balanced the mirror on top, shiny side pointing down (and with the protective plastic sheet still on it). I had to tape the mirror in place.

Starting at around 215°F, I slowly heated the oven up until the mirror ends started drooping. After probably an hour of watching it slooooooowly bend, I just reached in with an oven mitt and press-formed it to the glass.

RESULT: Meh. The shape is great and the focusing is accurate but the mirror got all foggy. It looks more like polished metal now. Also the spots where the tape was touching are distorted.


My theory was that I should have the mirror pointing up, which might make the cloudiness go away and would make using tape unnecessary.

This time I used a regular soup pan tipped on its side. I put the mirror inside so it could form to the inside curve of the pan. Left the protective plastic on. Set the oven to 250°F (that's what I had worked up to from the first attempt) and waited. And waited. And waited.

Once again, I eventually just reached in and press formed it. When I removed the sheet....still cloudy.


I watched the video again. Oh, I'm supposed to remove the protective plastic. Replay the second attempt, but this time remove the thing first.

After waiting the requisite Long Time, I could see the mirror was already foggy even before I press forming it. Aha! Not the plastic or the form!


I have small samples, so gravity isn't enough to bend them until they are very soft from being in the oven for 45 minutes or more. In that amount of time, some chemical degradation (or something) is causing the cloudiness. If I rig up some way to put a weight on top of the sample, maybe I could speed that up. Or I could just reach in there earlier and do it by hand.

But now I'm out of samples. I can bend and rebend the cloudy ones just to test out some weighting system and/or get my timing right. But I'll only be able to check if the cloudiness disappears if I buy more mirror. Which I can do, but I hate the shipping charges. Ah well.

Tuesday, December 18, 2007


  1. I had a long, long thing here about how following my plan was so easy, but it kept reading like Tighter Buns in 30 Days While Eating Pizza, so let's leave it at this: Down by almost 27 pounds.
  2. Way back when, I did some solar experiments. I said I'd come back to that. I'm still working on that. The problem is, the design I came up with is kind of crappy.

    What I want is a parabolic trough mirror focused on a central pipe. I've tried using mylar sheets on various surfaces before, but it didn't come out too well. This time I tried strips of mirror laid in a wooden parabolic form. I haven't tested it yet, but it doesn't look too convincing on the workbench. Lots of gaps, not much total area, not well focused, etc. (No picture, because seriously.)

    While I was wondering what to do about all this, I came across this video. The guy comes across as a little infomercially, but his ideas look pretty good. In particular, I didn't know you could "drape form" plexiglass (aka "acrylic") mirror. That changes everything! Almost zero work and much higher efficiency.

  3. Which brings me to the third misc item. WhereTF do you find acrylic mirror at a reasonable price? I've found it as low as $4.50/sqft, but you have to buy at least $50, not to mention shipping. Plenty of ebayers, but the price with shipping never comes out lower than ~$12/sqft and you have to buy several sqft to get that. Lowe's can special order it, but you have to buy 5 48"x96" sheets and it's still $8/sqft. McMaster-Carr, despite their awesome website, doesn't reveal shipping information even if you ask a live human being, which, HELLO.

    This kind of mirror is used in a lot of children's products because it's shatterproof, so I've considered repurposing a baby mirror, but the cost is still pretty high there due to packaging, frames, etc. I've even wandered around Home Depot and Lowe's to see if I could find a bathroom/decorative/whatever acrylic mirror on some other product. The sole success was a really, really crappy medicine cabinet with attached acrylic mirror. The whole unit was $12 and the mirror was 2 sqft.

    I would just go with that, but the fact that it's attached to something else only proves that I should be able to get the mirror alone for cheaper. Also, I hate to buy something specifically so I can throw it away. In the mean time, I ordered a set of these to experiment with. With the shipping, even amortized over several other items in my order, the price per sqft comes out at lalalaicanthearyou.

Tuesday, November 27, 2007

Tic Tac Lego

The building where I work has several "closed areas" where cellphones aren't allowed in. But of course people still bring their cells to work, plus there are visitors, random construction workers, etc and these people need a place to put their phones while they are inside. So they recently installed a cellphone cubby outside the door to the closed area. The cubby isn't just outside the door, it is also directly across from the main stairwell door that leads to it. It has a very prominent placement, is what I'm saying.

The cubby is a 3x3 array of squares. Every single time I pass it I think of tic-tac-toe. Surely I can't be the only one that thinks of this, so I thought it would be funny to put Xs and Os in there for everyone else to enjoy. But how to make them? Eventually my officemate thought of Lego. Of course!

We actually went through a few designs that were rejected because of strength issues or ugliness or size. Finally I hit on a pretty strong design for both pieces that, if I do say so myself, looks very nice.

Don't these look great? They look like very font-like, I think. Or maybe I'm overthinking it. Anyway, they are exactly the same height and width, which is also exactly the right size to fit the cubbies.

Unfortunately, cameras are even less allowed than cellphones, so I can't take a picture in situ. However, I'm posting this a while after putting it up, so here's a sample of coworker reactions:

  • nothing
  • small, confused smile
  • swapping of X for O to change outcome of illustrated game (happened many times)
  • "Niiiiiice" (in a Korean cleaning lady accent)
  • "Are you the LegoMeister? Nicely done."
  • From my boss's boss: something whispered about tic tac toe I guess he was trying to keep my identity secret?
  • I've noticed many games in progress, with one move played by each passer-by. Also, I've heard reports of some people just standing in front of the cubbies to play a whole game.

Tuesday, November 6, 2007

Tornado in a Box

1: Cut a hole in a box
2: Put

1: Make a large, square(ish), cardboard tube. Mine is about a meter high and maybe .25 m x .25 m at the base. This is actually two boxes taped together. They aren't even the same size--I just blocked the holes with cardboard and duct tape.

2: On each side, make a slit near the right edge. Or the left edge. But the same for all 4 sides. It doesn't matter which you pick, since you can reverse it by flipping the tube end for end.

The exact width and distance from the edge don't matter too much and you can see I wandered all over the place. Hey, cutting cardboard is kind of hard!

3: Boil some water inside. I went to WalMart for a hotplate but the cheapest one was $20. I tried it on the stove, but that's dangerous and it was hard to see. Then I thought of the bottom of the rice steamer.

Position the tornado box under a light to maximize the reflection from the droplets.

We found that when the steamer was going full....steam, there was too much steam in there swirling around (steam steam steam). So if you turn it on and off every few minutes it might work better. Also, we tried using a steam humidifier but we got nothing at all. I think the steam jet might be coming out too fast and hot. (An ultrasonic humidifier probably has better visibility, but since it isn't hot you'd be missing another vital ingredient.)

The payoff at the end: I asked the Numbers, now that they'd seen a tornado being made, when and where would hurricanes be most likely? In the winter at the North Pole or in the summer at the equator. Ooooooooh, I get it! they said.

Thursday, November 1, 2007


Every single year I think "I'd like to do something different than the usual triangle eyes and so forth" and every single year I fail to find a pumpkin carving kit. This year, Number Two (6 years old) was pretty excited about the idea of weird designs and we escalated awesome ideas up and up to the point that I knew I had to do something.

I had some jigsaw blades lying around. I cut the end off (diagonally, to leave a sharp point) with a wire cutter. Then I sandwiched it between two sticks of wood to make a handle and wrapped it up with duct tape. It works really well. Surprisingly well, actually. There's only two problems, one of which is fixable.

  1. The saw blade isn't long enough. I was able to cut all the way through the pumpkins in most places, but some spots I had to go back over with a knife. A longer blade shouldn't be too hard, though too much longer and it will have to be thicker, which makes fine cuts harder.
  2. Pumpkin shavings are emitted, which collect on the surface, obscuring (or even erasing) the lines drawn there. That said, none of the three of us had any major problems with it. In my case, I just worked in a consistent pattern so that I wasn't dropping goop on places I'd need to see later.
This year's pumpkins were tests of the method and of how well the pumpkin holds up with so much material removed. Here's the result:

OK, this isn't my personal pumpkin--it's a collaboration between Number Two and I. But it shows we tried.

Pumpkin PI, get it? PI (=PIE)??

You don't get it.

Tuesday, October 23, 2007

What Price A Stamp?

So stamp prices are going up again. And by "going" I mean "went, like 5 months ago". The wheels of Project Potpourri grind slowly, but they grind exceedingly fine.

Now they have a Forever Stamp. You buy it today and it will be good until the end of time regardless of future price increases. Sounds like a great way to save literally hundreds of cents, right? My wife (or maybe it was me--these human details are so much dross) posed this question: If I buy a 41 cent Forever Stamp in 2007, am I really saving money vs a 53 cent stamp in 2020 or does it come out in the inflationary wash?

IIRC, inflation is something like 3% per year, but of course we don't have the information on what future stamp prices are going to be. What about history? How closely have stamp prices tracked inflation in the past? Using a history of stamp prices and relative dollar values since 1913 I was able to answer this question. (Notes: All this is based on the first ounce only. I didn't try to go back farther than 1913. For each year, I only use the average dollar value for the year, I didn't break it down by month. For years with more than one price increase, I only report the last one. Since 2007 isn't over yet, I used the last dollar value available, which is September.)

YearApparent price that yearStamp price in 2007 dollars% diff relative to today

It used to fluctuate quite a bit, but for almost the last 30 years, they've been within a few percents of the same price. And given that even a 10% difference is only $.04, I'd call it fairly constant over the last 100 years (except for a few years).

Monday, October 1, 2007

How To: Lose Weight (And I Don't Even Mention Lettuce!)

First of all, let's define our terms. There's "losing weight" and there's "getting healthy". For the latter, you need to eat carrots and exercise. I'm not too interested in carrots and, while I don't mind incidental exercise, I don't have the time or inclination to run around for no direct reason. This post is solely about making the number on the scale be smaller. That in itself is a great step towards "getting healthy", though, as long as you aren't too stupid about it (i.e. no starvation).

The mantra in diet books is "don't diet--change your lifestyle". Partly this is just a good idea. They don't want you going on a crash diet and then fattening back up. But partly this is making a virtue of necessity. The reason they want you to change your lifestyle is that a non-starvation diet doesn't change your weight fast enough to notice it unless you try it over the long term. That is, if you only drop .4 lbs in a week, are you really going to notice it adding up even over the course of a month, if you last that long? Who is going to remember, to the tenth of a pound, what they weighed 2 weeks ago? The first secret of losing weight: You need to keep a history of your progress to refer back to.

But if you are only losing .4 lbs/week, there's another problem: Noise. The key to controlling a variable to to be able to measure it accurately. Otherwise how do you know if what you are trying is working? But diet books also tell you not to weigh yourself very often. The reason they give for this is that your weight can vary because of non-fat variables. A large meal only partially digested, extra water, etc.

That's really terrible advice, though. For instance, children's test scores vary a lot from child to child, so should you just choose one random child from each school to measure performance? Of course not! If anything, taking fewer measurements increases the noise problem. The way to fix noisy data is to remove the noise. The second secret of losing weight: Noise reduction.

One simple way to remove noise from data is via averaging. Particularly, a "moving average". Let's say I take the following daily measurements:

Mon: 201
Tue: 201
Wed: 202
Thu: 201
Fri: 201
Sat: 202
Sun: 200
Mon: 201
Tue: 200
Wed: 200
Thu: 199
Fri: 200
Sat: 201
Nothing is happening! This diet sucks!!!

But wait, let's try doing a moving average. For each day, we'll average in with the previous two days (which means we have to skip the first two since there aren't two days before them).

Mon: 201 (no avg)
Tue: 201 (no avg)
Wed: 202 (201.3)
Thu: 201 (201.3)
Fri: 201 (201.3)
Sat: 202 (201.3)
Sun: 200 (201)
Mon: 201 (201)
Tue: 200 (200.3)
Wed: 200 (200.3)
Thu: 199 (199.6)
Fri: 200 (199.6)
Sat: 201 (200)
In fact, I lost a pound to 1.3 pounds, depending on where you count from. (There are many ways to doing a moving average, including ways to weight the average more heavily towards more recent measurements. Don't worry about the specific method here.)

The difference between raw and averaged (aka "smoothed") data is even more dramatic if you look at a graph. The circles are (fictitious-but-realistic) readings from the scale. The line is the smoothed average. Some of those weigh-ins differ by as much as 2 pounds in a single day. If you wake up a day after "being good" on your diet and see you weigh 2 pounds more than yesterday, doesn't that make you want to give up? But after you smooth the data, the problem may not be so bad.

In fact, it might not be a problem at all. Say the 3 days you were averaging yesterday were 205,202,201 (202.6). All you ate yesterday was carrots, but today you got 203. The weighted average is still 202, which is down from yesterday's average. How awesome is that!

Answer: Very awesome. But not so awesome we need to make things harder for ourselves. For instance, try to weigh yourself under the same circumstances every time: Same time of day, same state of undress, same fullness of stomach and bladder, etc. Also, I have gotten into the habit of "unofficially" weighing myself at various times throughout the day and I've gotten to know exactly how much to subtract for my clothing, how much water I'll lose via respiration overnight, etc. If I weigh X when I got to bed, I will weigh between X-3.5 and X-3 in the morning, rock-solid. An unofficial weigh-in the evening before can help prevent sticker shock in the morning and will also tell you if you can afford a bowl of ice cream. (That might not work for you.)

But who wants to juggle a bunch of numbers?! That's worse than being fat! Don't worry, you don't have to do a thing. Just head on over to PhysicsDiet. Create a free account, give it some info like your starting weight (you can ignore all the stuff about percent bodyfat and exercise) and away you go. The site handles the moving average and plots pretty charts and everything.

Since I started in late March I've only been losing an average of .44 lbs/wk. That's slow enough that I would have given up after a couple weeks, especially since it's also far less than the noisiness of the data (particularly since my scale only weighs in .5 lb increments). But with the two secrets of losing weight, historical progress and noise reduction, I've managed to lose over 15 lbs so far. Also, there are 3500 calories to a pound of fat, so that's just an average of 220 calories per day, which I barely even notice missing from my plate, let alone do I have to eat carrots and rice cakes. It's like I'm not even dieting (almost).

Tuesday, September 18, 2007

Christmas Present Idea

Long have I pined for a mechanical watch where you could actually see the gears and springs and whatnot flying around. I've seen things like this with the "Fossil" brand attached, but they are always less than what I really wanted. I tried googling for "mechanical watch with visible gears" but that wasn't too helpful.

Today I discovered the magic word: Skeleton. A "skeleton" watch is one where it is purposely made to be see-through. "Full skeleton" means that even things that you'd kind of like to have on a watch, like numbers and hands, are as tiny and hard to use as possible so you can see the full glory of the gears.

Feast your image display software on THIS:

I gather it is possible to spend up to and including ONE MILLION DOLLARS on a watch like this, but, I further gather, Chinese imports can be had for under $100. Even well under $100. For instance.

I wouldn't have many requirements on such a gift. It should be as visible as possible and be actually mechanical, no hidden battery doing the work.

Monday, September 17, 2007

A New Recipe for π

I've been working on a Difference Engine in Lego. A little derivative perhaps, but still a big challenge. For one thing, there's not that much construction detail at that site. For another, what little there is I'm ignoring. I want to try to solve this on my own.

I've made some progress, but my (borrowed) video camera is being cranky so I've been unable to record and post it. (Aside to person I borrowed it from: I'm just getting a black screen in record mode. Also a little red flashing light that I think is the button battery so I thought that was it. However recording suddenly started work despite that, but only for a few minutes. ???) Thus this post isn't about that.

When the Difference Engine actually is running, I thought it would be fun to have it calculate π. NO WAIT, LET ME FINISH!!! I know π is transcendental, meaning there is no polynomial for which π is the solution.

The point of the Difference Engine is that as you crank the handle, you calculate the value of the polynomial for higher and higher values of x. What I'd like is a polynomial such that for higher and higher x, the value is closer and closer to π.

So I just google for a polynomial that does that, right? I mean, there must be hundreds of them by now. No. There are none that I can find.

There are plenty of series approximations, however. For instance:

π = 1/1 - 1/3 + 1/5 - 1/7 + 1/9 - 1/11 +....

And with some, it's possible to come up with an expression that the series sums to up to any given point. For instance, the sum of the first n odd numbers:

1 + 3 + 5 + 7 + .... 2n-1 = n2

So maybe one of the series approximations of π can be manipulated into a polynomial. Then I can use the Lego Difference Engine on that polynomial and crank out 2 or 3 digits.

However, I'm having a great deal of trouble with this (not that that indicates anything other than the fact that I'm really not that great at math). For one thing, I've concentrated my efforts on the simple-to-remember 1/1 - 1/3 + 1/5 approach. But I just realized this morning that this series alternately overshoots and undershoots the target, meaning it has an infinite number of humps and valleys. A polynomial of degree n can have a maximum of n-1 humps and valleys, AFAIK, so that series is out.

If I'm going to start from a series, I need one that's always more or less than π and never the other. Or an entirely different idea. I can think of plenty of iterative methods, but that's basically just a series. I need a single step where the accuracy is chosen by the value of x I input. Since I haven't been able to find any reference to such a thing, I'm thinking it hasn't ever been done. Is that because it's impossible?

Tuesday, September 11, 2007

You Program My Back, I'll Program Yours

If you are a math/science/computer nerd and you have a child, you have undoubtedly wondered how you can teach your child programming. I googled for such a thing more than once and found the usual suspects: BASIC, LOGO, etc, etc. The free ones were all half-finished or too hard, the good ones were all expensive or geared towards classrooms.

I tried teaching Number One Son (8 years old) some pseudo-codey stuff to do simple math problems and learn about loops. He enjoyed that, but we didn't get very far and I always had to be the virtual machine to check if his program ran.

However, MIT has recently come up with something that absolutely rules--Scratch. And it's free!

Scratch is graphical. You drag the little components around to assemble a program. For instance, to make a loop, you drag your components into a loop widget, which wraps around it like a vice. If you want to construct a conditional, you get out the "if" widget and drag and drop logical/mathematical conditions in from the toolbox. Just fill in the blanks and go.

The GUI isn't just for show, either. You don't feel like you are using the mouse to write a program, you feel like you are literally assembling a physical object. And it eliminates syntax errors, which is a major deal in the under-13 crowd. Furthermore, the graphical programming language ties right in to the very graphics-oriented programs Scratch is targeted towards and children love. Creating and animating sprites takes just a few clicks. Object collision is just a matter of checking if two colors are touching. And this is all clearly presented enough that an 8 year old can (and has) figured most of it out himself.

I think he learned more about programming in 2 days with Scratch than he did in all the previous years of my bumbling explanations. He goes off and works on a program for a while and then will come to me with a question about how to do something. And they are pretty sophisticated problems (considering his age), such as how to cycle through sprite costumes and wraparound at the end or how to keep various sprites in sync. With the concrete example of his non-working program providing the motivation, the explanations of modular arithmetic or semaphores stick much better.

So far he's created programs that simulate a robot in a maze, animate a rocket flying to the moon, teach the alphabet to his two-year-old sibling and even one generic drawing program with adjustable pen size and color. All 100% on his own.

Windows and Mac only, but:

  1. They claim they'll have a Linux version out "before the end of 2007".
  2. The usefulness, fun and polish of Scratch is more than worth setting up an old PC with Windows.
It's possible to upload your program to share with other kids, but we haven't tried that yet. Videos of Scratch in action..

Tuesday, September 4, 2007

Lego Marble Pump II: Handcranked Bugaloo

The basic idea behind the Lego marble pump is working. I cobbled it together well enough to demonstrate My Vision, but many kinks remain to be worked out. For instance, the little levers need to be worked automatically. But I'm not going to do that, I'm just going to post the video of it hobbling along.

In case that isn't clear:

  1. Marble goes in ramp at left
  2. Cam on central carriage hits lever to open gate, allowing marble into carriage (part of cam played by my finger)
  3. Central carriage lifts, eventually dumping marble into next higher ramp (another "cam" lifts lever there to make sure gate is closed)
  4. Central carriage lowers, goto 2

Monday, August 27, 2007

Difference Engineering

I've known about Babbage's Difference and Analytical Engines for a long time, but never known much about how they work. Finally I actually read a little information on the first one (in the context of Legos) and it's pretty interesting from both a mathematical and mechanical point of view. Based on the information on that page, I worked out a tiny additional step of my own (though surely Babbage himself already knew this).

First of all, the basic idea: The purpose of the Difference Engine was to pre-calculate tables of polynomials for books in the days before portable calculators. So you'd want to known 3x3 + 14x2 + 5 for all values of x from 1 to, say, 1000. As it happens, there's a clever little shortcut such that if you have a few values you can calculate the next one very simply using only addition from the previous answer (thus "Difference Engine").

So let's say f(x) = x2 + 3x.

x   f(x)   diff1  diff2 
1     4      -      -   
2    10      6      -   
3    18      8      2
4    28     10      2
5    40     12      2
See that second difference column is a constant. If we'd picked a polynomial of the 3rd degree, we'd have to work this out to the 3rd column. Fourth degree, 4th column, etc.

So to build a machine, all you need to do is set the value for x = 1 and set the Nth difference in the last column. It automatically adds that difference to the previous difference, which is cascaded upwards until f(x + 1) is arrived at. Then you go around again. All that is required is simple addition.

What isn't explained on that page (that I saw) was how to know ahead of time what that last difference is going to be. Sure, you can work out N rows to get that Nth column, but it would be nice if you could set the inputs from direct inspection of the polynomial. As a matter of fact, this is easy.

Say f(x) = ax2 + bx + c. Then the difference between two successive answers (i.e. the value in the first difference column) is going to be:

a(x+1)2 + b(x+1) + c - ax2 - bx - c
= ax2 + 2ax + a + bx + b + c - ax2 - bx - c
= 2ax + a + b

The difference between successive entries in THAT column are going to be:

2a(x+1) + a + b - 2ax - a - b
= 2ax + 2a + a + b - 2ax - a - b
= 2a

And if we look at our example, we did indeed get 2 * 1 as the constant in the last column.

Working this out for a 3rd degree polynomial gives 6a (where a is the coefficient of x3). Based on these two examples and looking at Pascal's Triangle, I predicted the value for a 4th degree would be 20. But it was actually 24.

In fact, if you work it out it should be clear that the constant difference will be a * n!, where a is the coefficient of the highest power of x and n is that power. It should be simple to prove this using induction, since all other terms always drop out and you muliply the coefficient by the power at each step on the way down.

So if I wanted to know what the constant difference was in the 5th column of differences for the polynomial 8x5 - 3x3 + 117, I just multiple 8 times 5! and get 960. I cram that, plus the initial value for x = 1 onto the machine and get cranking.

Friday, August 24, 2007

Lego Marble Pump

This is a pretty neat machine. The core of the pump mechanism is pretty genius and I built one myself based on that graphic. The problem is that the tower can only be as high as the number of marbles you have and the number of marbles your motor can lift.

The most common way of lifting balls in a contraption is with a kind of one-way elevator. But I've already built one of those. This guy has an interesting idea. It's a little hard to see in the video, but he's got the marble going both ways through the pistons. It lifts one "story" going from left to right, then another story from right to left.

That gave me an idea. First of all, why not any number of stories? And second of all, why three pistons? Probably the answer to both is: maximum height for the amount of Lego he had.

I'm thinking you could put just one piston between two towers and with a certain amount of mechanical futzing pump the marbles up to any height.

*pause for 24 hours of trying to get some kind of Lego CAD software working on any computer in my house or office to illustrate this and failing miserably*

OK, here's the basic idea: The piston in the middle has ramps inside. The marble starts off at the bottom of one of the side towers. It rolls into the piston down one of the ramps and it stopped against the wall of the other tower. The piston moves up and there's a little nook in the other tower that the marble falls into. The piston lowers. Now there's another internal ramp, this time pointed the other direction, aligned with the nook, so the marble re-enters the piston and is stopped against the wall of the first tower. Repeat.

It's a little tricky, though. The nook is the problem. The marble needs to roll out of a ramp into the nook but then roll out of the nook into a ramp. The three piston video solved this by having good timing and long ramps. I don't have long ramps or the patience to get the timing right. What I'm trying right now is a kind of teeter-totter arrangement in the nook that tips up to receive the marble and then tips down to release it.

Oh cripes. I just re-read this entry and even I was too bored by the last two paragraphs to pay attention to them. I'll just have to make it work and post a video. Or somehow get LDraw working.

Wednesday, August 15, 2007

The Temperature of What?

So I had all these posts about temperature logging and one post with the actual logged temperatures...but the temperature of what?

A solar hot box!

You probably already know what this is, but just in case you don't: It's basically a tiny greenhouse. Or like a car left in the sun at noon in August. Only it's even hotter, since it is insulated, painted black and pointed right at the sun.

Inside the box I put a jar with 250 ml of cooking oil and poked a hole in the lid for a temperature probe. That's what these temps are.

Why did I choose cooking oil? Because I didn't want evaporation to be a problem. For one thing, it would fog up the inside of the glass. For another, it would cap my max temperature at 100°C (not that that turned out to be a problem in this case). And lastly, it would change the amount of water in the bottle and I needed that to be a constant because I did some calculations with it.

Knowing the amount of oil and the temperature change (plus looking up the specific heat of vegetable oil), I can calculate the rate at which energy is entering the oil. For the above graph, I got 2.5 watts for the steepest part of the curve. However, I see that the site I just linked to has the specific heat of veg oil as 1.67 kJ/kg K and I was using 2.5. So maybe the power is really more like 3.7 watts.

Knowing the area of the collector I can also calculate the amount of power falling into the box. That's about 75 watts. So the end-to-end efficiency was only about 3-5%. Not that great.

Imagine if you put a cup of water on the table and then turn the furnace thermostat up to 90°. How much energy are you going to waste before the water gets hot? This illustrates the 3 main problems:

  1. Air passively surrounding a container of liquid isn't going to heat it very fast.
  2. There's a lot of volume of air being heated uselessly.
  3. During all this time, heat is escaping the cracks, windows, chimney, etc. In the case of the hot box, the glass front gets very hot and is radiating a lot of the energy right back out.
If a hot box is like an oven, the next version will be like a microwave. Don't heat up the air, just beam energy right into the substance.

Wednesday, August 1, 2007

Locomotive Lego Linkage

It seems like I keep having to reinvent this linkage. The basic idea is that I want to turn a crank (i.e. rotary motion) which makes something move back and forth (i.e. linear motion). You see this exact same linkage on classic train wheels, though in that case the linear motion is the primary mover and it is turning into rotary motion to move the train.

In fact, almost all piston engines do this same thing. What I keep not realizing is that you need to hold the straight part straight or it doesn't work. Not "it doesn't go straight" but not work at all.

Let me show you what I mean

I think the reason I keep forgetting this is that the movement looks so smooth. It doesn't seem like there could be that much friction there, but there must be. The piston is rubbing against the sides. Not (just) because of a tight fit, but out of sheer necessity to make the piston run straight.

There are linkages that have been invented that can convert rotary motion to linear without all the side friction. For instance, here. A 3D version of that linkage is in the Boston Museum of Science. Another picture of Peaucellier is here and the page also calls my "locomotive linkage" a "sewing machine".

Peaucellier isn't very practical because it requires so many parts, which take up space and can fail. Or can it be made simply? Can another practical, mathematically accurate, low-friction linkage be built? In Lego?

Tuesday, July 24, 2007

Ambient Orb aka Rainbow Ball

For some reason this "ambient orb" Arduino project blew me away. The basic setup is very easy: red, green and blue LEDs mixed in different amounts. (Putting them inside a diffusing cover helps the mixing.) There are only two catches:
  1. LEDs aren't dimmable the way incandescents are, so how do you control mix?
  2. Finding LEDs of all three colors in the same output is nearly impossible.
The solution to the first catch is Pulse Width Modulation. Basically, you send tiny bursts of current so it flickers on and off faster than you can see it. The more time it spends on (the "duty cycle") the brighter it seems. Doing this from the Arduino is simply a matter of adjusting a number to say what you want the duty cycle to be in the range 0-255.

For the second catch, I pored over catalogs and websites trying to find matching LEDs. I did find them more than once, but it was always coming out too expensive. I mean, I was blown away by the idea, but not to the tune of $10! (Maybe I should have called this blog "The Cheap Bastard".)

I actually do already have all three colors, but the single blue LED I have is a trillion times brighter than any of the others. Really, it's blinding. I could have just bought a new blue to match the low-level reds and greens I have, but what power are they? Is there any way to figure that out, maybe from power consumption?

Finally I realized I could just use a bunch of reds and greens and also cut the blue's power in half (i.e. never get the PWM duty cycle above 50%) and it comes out all right. Mostly. The blue is still too powerful and swamps the blue-green transition.

Why is the green almost invisible in the video? Is the CCD in the camera less sensitive to green? Is the green really a lot less powerful and my eyes just adjust to it?

Light and Fluffy as a Kitten: For Real Now

That's because I gave up and washed my hair.

It was definitely true that my hair was less oily than I expected. There were many days when each hair stood alone, unclumped from the others, and I thought I was near to fluffy kittenhood. But then the next day I'd forget to rinse it or something and I'd be a greasemop.

Also, and this may have been psychosomatic, I felt like the greasiness was starting to migrate down my head. Like maybe the hair was leaving oily trails on my forehead, on the tops of my ears, etc.

Experiment terminated after two weeks.

Monday, July 23, 2007

Guide To LEDs

Until now, I've really only understood 3 things about LEDs:
  1. They don't use much power
  2. You need to plug them in the right direction
  3. You can blow them if you apply too much voltage (or was it current?)
I think I've got it figured out now. I haven't seen it explained this way anywhere else, which could mean I'm just wrong or it could be I'm about to be nominated for the Nobel Prize in Explaining LEDs on a Blog.

Here's the deal: An LED requires a certain minimum voltage. If it gets that voltage, it turns on, otherwise it doesn't (and it doesn't drop any more than that voltage). The exact number varies by color (and other parameters?), but is in the region of 1.5-3.5V. So if you had a 1.5V LED and a 1.5V battery, you could just hook them up, right? No, because you'd get too much current. The LED drops 1.5V but has practically no resistance. (Ohm's Law is really more of a guideline.) A reasonable number to use as a first guess for the amount of current an LED can take is 20mA.

So how do we put this all together? Perhaps the clearest way is to do what I did: Figure out what voltage all the LEDs in my drawer took and label them. First, I built the very simple circuit on the right.

What value to use for R? We don't want more than about 20 mA running through the LED and R = V/I, so 9V/.02A = 450Ω. A standard 470Ω resistor should be fine. So far, so obvious. But how does this figure out the voltage the LED drops?

I tricked you. You actually build that circuit but put an ammeter in there too. Measure the source voltage carefully (well, semi-carefully--I just mean don't assume a "9V" battery is really 9V). Measure the actual resistance of R. You are going to get some measured current Im. Im will not be equal to V/R! That's because the Ohm's Law is only applying to the resistor and the resistor isn't dropping the full 9V. It is dropping only the remainder of the voltage that the LED didn't use. The current is then that remainder voltage divided by the resistor value. In equation form: Im = (V - Voltage dropped by LED)/R. Rearranging, the voltage your LED is dropping = V - Im * R.

So for instance a typical red LED in my drawer is 2.1V. So when I put it into the circuit, the voltage across the resistor is 9 - 2.1 = 6.9V. 6.9V/470Ω ~= 15mA.

Is this just arcane nonsense? Yes, for source voltages that are much higher than the LED voltage and when you are only putting one LED in the circuit. But I went through and did that with all my LEDs. Now I know how to put a bunch of LEDs together and can save power (and resistors, and circuit space) by putting them in series with the right size of resistor. I could fit 4 2.1V LEDs in a 9V circuit because 4 * 2.1 = 8.4. That leaves .6V. In order to limit to 20mA exactly, I'd want a 30&Omega (.6V/.02A); resistor in there.

One caveat: If the voltage varies you might blow something in such a tight margin. I was running my circuit off a weak 9V that was down to about 8.5V. If I really did build the circuit with 4 LEDs I'd have .1V left over, which would require a mere 5Ω resistor. But then say I put a fresh battery in and it's 9.3V now. Now suddenly there's .8V across the same 5Ω resistor which gives me 160mA. Goodbye LEDs! So it would be good to either work with a regulated voltage OR leave yourself enough extra voltage that normal variation isn't a huge change percentage-wise.

Sunday, July 22, 2007

Temperature Logging Part III: The Exciting Conclusion

Some pics of the final state: You might notice an extra button. I decided to write to EEPROM rather than an array after all. The reason was an unreliable power situation. A 9V battery lasts for a few hours and I didn't want to lose hours of data at the last second. So we have a switch for power on/off, a button for "send data" and a button for "start collecting data". The last one is I can control when the EEPROM starts getting overwritten the next time I turn it on.

That relatively minor change forced a paradigm shift in what processing was done where. Originally, I was just reading the voltage ratio from the pin and sending it to the PC that did the work to convert to degrees. The pin reports a value in 10 bits (i.e. 0-1023) but the EEPROM stores only bytes (i.e. 0-255). I could have renormalized to the smaller range, but only at the loss of a lot of precision. Instead, I now calculate the temp right on the Arduino. Surprisingly (to me, anyway), you can use the regular math library functions like log(). So then I end up with a temperature that practically speaking won't get above 255 or below 0, and even if it did I could add or subtract a constant to recenter it to my working range. I will describe what temperature I was logging in another post, but for now here's the pretty graph.

Thursday, July 19, 2007

How To Make Awesome Pizza

Until recently, my idea of awesome pizza was "lots of cheese, almost burnt". Also, there needed to be a way to hold the cheese without burning yourself, so I needed crust. I wasn't sure what the sauce is for, but tradition demanded its inclusion. Tradition definitely did not demand the inclusion of members of the plant kingdom.

However, I have changed my boring pizza ways. I now make gourmet pizza on a weekly basis. The secret....REVEALED!

Crust Ingredia

  • 3 cups flour
  • Between 1 cup and 1.25 cups water, depending on the weather
  • A dash of olive oil
  • Two pinches of basil
  • A generous helping of yeast
  • 1 bread machine with a "dough" setting
  • 1.5 hours
Stir all these ingredia until you have a bunch of dough. Meanwhile, dice a couple sausage patties a 2.25 oz can of black olives (sliced) a tomato (The role of the tomato has been played by an understudy in tonight's performance due to a grocery malfunction.) And some pepperoncini: I think the rest of this recipe speaks for itself. I'm still using boring old Sauce in a Can, though. I need a good pizza sauce recipe.

Tuesday, July 17, 2007

Light and Fluffy as a Kitten...Sprayed with Pam

I've heard this claim before: You don't really need to shampoo your hair. Your head chemistry will adjust if you stop stripping the natural oils from it.

OK, sure. However, in this article the author not only claims that his hair is "as light and fluffy as a kitten's coat" but he also gives the basic idea on how go about the experiment. So I decided to try it and compare my head to a hypothetical kitten.

Experimental Procedure

  • The article author hedges about what exactly he's putting on his head. "No de-greasant" means what exactly? Are you still conditioning? Since the only thing I use is regular shampoo (i.e. liquid soap), I decided to just use plain water. Every morning I dunk my head in the shower and scrub it thoroughly with fingers and fingernails, but use "no de-greasant".
  • I also vaguely remember some other claim about "redistributing oils", so I also combed.
Results after one week
My hair is definitely less greasy-seeming than I expected. I normally shampoo every other day and when I skip a soaping I definitely notice it. My hair feels clumpy and gross. Rinsing and combing seems to fix that so I don't really notice.

On the other hand, I wouldn't say my hair feels clean, either. If I run my hands through it they start feeling like I've been eating potato chips. OK, maybe not that bad, but I'm not squeaky clean. In fact, when I rinse in the morning I have to wash my hands with soap after.

When I started this post I thought he said to try it for a week, but now I see it says a "few weeks". OK, I can probably stick it out a little while longer. No one has commented on it, so I guess I'm not too awful to behold.

Monday, July 16, 2007

Salsa & Guacamole

This is a very basic, simple recipe. It's 100x better than the canned stuff I used to eat (which I think is actually picante sauce, so I guess I'm comparing tomatoes to peppers there) but I'm sure there are homemade salsae out there that beat this to a pulp (GEDDIT??). Nevertheless, if you've never made salsa before this is an OK place to start and a good base for experimentation.

2 green peppers
2 red onions (I like the taste vs the yellow/white)
some cilantro (you have to buy a whole bunch, but you only use a few chopped tablespoons)
several jalapeños/habañeros, to taste

Chop everything up and put it in sealable plastic bins. On Taco Night, I dice a tomato and add a few scoops of this salsa mix. The above lasts probably 3 months at the rate I use it. However, the quality seriously degrades so if you have more free time (for some reason it takes me like 45 minutes to put this together) I'd recommend making smaller batches more often.

The guacamole recipe is even dead simpler (deader simple?). The only reason I even mention it is that I never knew the awesomeness that is guacamole until recently. Here's the recipe:

An avocado
1/3 of a packet of guacamole powder

The only tricky part is choosing ripe, but not too ripe, avocados. A perfect avocado is just a little firmer than a perfect peach. If you squeeze it and it gives more than 1/16" clean off your hand and find another avocado. However, it must give at least somewhat or it is underripe. I've learned the hard way that an underripe avocado is a nightmare to get out of its skin. If that's all the store has go ahead and buy them, but store them on the counter for a couple days before enfridgerizing.

(Another way to identify avocados is by color: Black is too far gone, bright green is not far gone enough. You want a very dark green.)

Saturday, July 14, 2007

Temperature Logging Part II

OK, so I had the temperature (sorry if this reads like a novel--I'm writing this one after the fact), but I already had that with a kitchen thermometer. The whole point of this is data collection. From the docs and examples, I think most people are using the Arduino attached to a computer, which makes logging a simple matter of reading the serial port and writing to the hard drive. But the temperatures I'm going to be logging will be located far away from a USB port.

My initial plan was to write the values to the "EEPROM" (no, me neither), but:

  • It only supports 512 bytes. At one sample every two minutes, that's only 4 hours.
  • It only supports a limited number of writes. Large, but limited.
  • I don't really need the ability to save the values through a power cycle.
Instead I went with an array in RAM. I just have to be sure to get the data before I turn it off or the battery runs out.

And how do I get the data off? I have a button that tells the thing to dump the data to the serial port. This is really a simple feature, but I learned a lot while doing it. That's because, even as an electronics n00b, my analog electronics sk1llz leave my digital ones in the dust.

Here's the schematic for a digital switch. Notice that it doesn't really work like an analog switch. That's because you aren't sending electricity around a digital circuit like with a simple flashlight, you are sending voltage around the circuit. Or so this one experience indicated to me. D2 is the digital port. When S is open, as shown, D2 is HIGH (i.e. 5V) with respect to ground. If I close S, current flows (which is why R exists--to limit the current, which means R should be as high as feasibly possible, at least so I infer), but more to the point D2 and ground are electrically connected, meaning it is now LOW (0V).

Question: I think I could have had D2 at LOW by default and switched to HIGH. Would that save power? Ideally, a voltage doesn't have a current, but I don't know how the voltage comparison happens internally.

Anyway, this circuit and the previous one can be put in parallel. The thermistor one reads temps until the buffer array is full and the switch one waits for someone to press it and when someone does, it spews data.

All that remained was to make it small and robust enough to survive an afternoon outside, with light breezes, sunshine, etc. So I soldered the components onto a board (seriosly, this project is like 1/4 of all the soldering I've ever done--I'm a total, total N))B) and slapped it into a tupperware container.

Friday, July 13, 2007

Temperature Logging Part I

There have been many times when I've wanted to log temperatures. No useful reasons, I just like collecting data. The problem is that temperature logging devices are like $50 and up and of course they only do that one thing. After the orgy of temperature data collection is done, it just sits on the shelf.

But I'd been hearing about this Arduino dealie, which is an open-source microcontroller that only costs about $35. I figured that I could put a thermistor on there and make my own logger, which would not only be cheaper but I'd also have a versatile device for other projects. I've never used a microcontroller before, plus electronics above the level of a flashlight circuit confuses me, so it's been an adventure. Fortunately the Arduino is supereasy.

For that matter, the electronics of this were prettyeasy. The hardest part was doing the math to convert a thermistor reading into a temperature one. I harvested a thermistor from a broken (except for the thermistor) electronic thermometer. (It was easy to identify, since it was sticking way up away from the rest of the circuit board and and had "therm" written next to it.)

A thermistor varies its resistance based on temperature. That means that if you apply a voltage, you'll get a varying amount of current out. But the Arduino input port measures voltage level, which means you need to turn a varying resistance into a varying voltage instead. That's easy with a voltage divider.

"Th" is the thermistor, and A1 is the steak sauce Arduino analog input port. The total voltage drop across both resistors is a constant 5V, but how much drops across each resistor depends on the ratio of their values. So when the thermistor changes, the voltage at A1 also changes.

Now you just need a way to convert a voltage reading to a temperature reading. I assumed it would be a linear relationship, but it isn't, it's exponential. When you buy a thermistor, apparently they give you two numbers. A baseline resistance (at 25°C,) and a number B. Apparently you are supposed to know this equation:

RT = RTzeB(1/T - 1/Tz)

Oh sure, THAT equation! RT is the resistance of the thermistor, which you can figure out based on the read voltage and known values of the circuit. RTz is the resistance at 25°C (or whatever baseline), which is Tz. T is the temperature you want and B is the magic number.

I didn't get my thermistor from any fancy-shmancy store so I didn't have the magic number. Instead, I used the thermistor to measure hot and cold water (calibrated by a kitchen thermometer). Plugging in those readings I was able to solve for B. Just using math got me within 2 or 3 degrees (over the range 0-100°C--I haven't tested outside that range). Then a little empirical fudging got me right on the money.


Or maybe "Statement of Purpose" would be better.

I just want a place I can keep track of the many projects I'm "working" on at any one moment. My attention seems to cycle through a semi-fixed list of topics and when I come back to a topic I don't always know what's going on. Plus even if I don't have any readers, I'd like to document the things I figure out so random googlers can get a leg up.

Also, I need a place to articulate the solutions I find to problems. No matter how blinding the insight or life-changing the epiphany, I usually forget how I solved a problem the first time around.