## The Electric Henhouse

This spring three lovely chicks joined our family, Betty, Penny, and Ginger. Ginger discovered her inner rooster in due time, and was rehomed—we are not zoned for the crowing half of the species. To protect the birds from freezing during our winter travels, and to let them out at the sunrise, they have been housed in the electric henhouse. At dawn and dusk the hens are released or secured by a linear actuator, locking in heat, wind and potential predators locked out.

Betty watching the installation of the electric henhouse.

The heart of the electric henhouse is a bare-chip variant of the Arduino. It connects to a realtime clock with battery backup to get the time. The time, in turn, is used with calculated sunrise and sunset so the door opens at sunrise and closes shortly after sunset when the birds have settled down for the night. The ATMega runs at 5 volts, and so a dual H-bridge is used to provide the linear actuator with the power it needs.

The overall code architecture is straightforward, every second the processor checks the time. If the time is between the sunrise and sunset, tell the motor to open, otherwise close. The motor module maintains a state so that it won’t try to open an open door. The linear actuator is cleverly designed, it won’t strain to open when it is always open and it won’t close when all the way closed.

The only code module with much complexity is the sunrise and sunset calculation, which is an approximation based on a US Naval Observatory code, with only minor modifications. I tested it by running the calculation over a series of days throughout the year and comparing with published almanac.

I purchased two separate FTDI USB-to-serial chips to program the bare ATMega chip, and was unable to get either of them working. I followed programming instructions similar to those here, and those worked every time.

The linear actuator is visible at the top. It slides the door (currently open).

You can get the code on GitHub.

## 3D-Printer and Your Coffee Grinder

Two weeks ago I acquired a 3D printer; specifically the Printrbot Simple Metal Kit and, after some warranty help, it’s printing well. The first thing I printed was the fan shroud for the 3D printer itself, as recommended by Printrbot, but the next things were for my own design. I printed a set of three sieves, to fulfill my long-time dream of quantifying the performance of coffee mills.

For those of you who read my coffee blog posts years ago, I was frustrated because nobody quantifies the grind performance. Vendors and coffee pundits are happy to talk about the merits of a conical burr grinder or fret about the cheap blade grinder you got from your lost year with Gevalia. Quantifying grinder performance should be pretty straightforward. Take a set of sieves and sort the grinds by size, the more consistent grinders will produce more grounds in a narrow range of sizes. Spoiler: I have only measured my whirling blade grinder so far, not my Capresso burr grinder or any of the commercial grinders.

The printed sieves are just cylinders with a printed mesh bottom. They don’t stack well, since I used too little taper. My finest one had holes so small that it plugged with the finest coffee dust, so there is more to do in the sieve design. Nevertheless, I started with the mesh from Thingiverse, and added 15 mm of wall height. When I get a version of these that stacks I’ll post the design to the Thingiverse too.

I arranged the sieves in a stack and shook. The sieves clogged almost immediately, so I took a small brush and worked the from the top layer down until I had good separation.

The results, in the following picture, show that almost no particles were larger than my largest mesh, less than half were larger than my medium mesh, and the rest were larger than my fine mesh.

So what are the mesh sizes? I took macro photos of the meshes and then measured them optically—you know, counted pixels. The composite photo below shows the basic idea, and below that is a zoomed-in version of the medium sieve.

The medium sieve is made from “threads”, where each “thread” is two passes with the extruder head. It should be possible to do a single extruder path, but I have not yet tuned the OpenSCAD file to get a consistent result.

 Mesh Cell Diagonal Coffee Percent Coarse 2.5 mm <0.1 g 0% Medium 1.4 mm 1.0 g 28% Fine 0.48 mm 2.6 g 72% fall through <0.1 g 0%

Whether grind consistency can actually be identified by a taster in a blind test is an open, and wonderful, question. Happy brewing!

## The Giving Tree and An Arduino Clock

When we bought our house we hired an electrician to install ceiling fans and lights. He worked, worked, and worked. My illusions of electrician’s work dissolved. Their work is a great deal more like laying bricks than solving equations. Oddly, the truth for electricians is also the truth for electronics.

Nearly two years after starting, more than 18~months after finishing the electronics, source code, and cardboard mock-up I finally finished my clock. I have recreated—nay, improved upon—the greatest alarm clock I have ever owned.

In some ways my clock was started about thirty years ago, when some foresighted person planted a lovely little apple tree in what is now my back yard. The lovely little apple tree was a gorgeous mature giant shady apple tree until the spring of 2012. The spring came warm and early but also trisected by two severe cold spells. The frost killed several of my trees major limbs, and may eventually kill the tree.

One of the major limbs became firewood. Then one of the firewood logs became boards, and finally one of the boards became the main faces of the clock. Making a board from firewood is, no doubt, ancient. For me it was a new experience with old techniques. I used a hand powered bow saw, affixed the firewood in the vice, and ripped boards by hand. It is a tiresome process and the boards were not machined to the parallel faces you get in dimensioned lumber. No matter, hand planes helped me get one face smooth and flat. I marked a constant thickness, flipped the board over, and planed the uneven face. The finished board was smooth, clean, and beautifully figured.

The original vision for the box of the clock had hand-cut dovetails visible on the front. However, the apple wood was unsupportive. It was brittle, and prone to fracturing on detail peices. It was also almost too small. The cherry boards I selected for the sides were not long enough to dovetail join the front and back.

The final result is lovely to me. It has a lid so the interface is not visible on the bedside, and the lid showcases the figure of the apple wood. The display is a simple red that does not keep me awake at night. The plain box design weighs enough to keep from migrating around the nightstand, and the interface is actually good.

# Design and Use

I set out to imitate the functions of my beloved but deceased clock, see Behold! A number pad. I started the design with a set of use cases, Set Time, Set Alarm, Turn on Alarm, and Turn off Alarm. The notes below are from the original design before I bought the first part, with no edits but formatting.

### Set Time

User opens decorative lid. User sets mode switch “set time” mode. The display is turned to current time. User enters numbers starting with most significant digit, in 24 hour time format. After entering the first number, only that digit is displayed.

If user enters a mistake, he hits “clear (#),” and the process restarts at “user enters numbers”. Clear: display is blanked. To keep the setting, user leaves the “set time” mode. On error, the time remains unchanged. Error conditions are:

• User exits "set time" mode without entering a new time at all.
• User exits "set time" mode without entering a valid time.

### Set Alarm

Same as “Set Time,” but using “set alarm” mode.

### Turn on Alarm

User turns on alarm. Display flashes time the alarm is set for about 5 seconds. Display resumes normal operation. The “alarm on” LED lights. When the time reaches the set alarm time, a beeper will sound. The beeper will sound until the alarm is shut off.

### Turn off Alarm

Alarm LED is turned off. If the alarm is currently beeping, the beeping ceases.

# Electronics Design

I ended up with a Sparkfun keypad, and care of Andrew’s diligent work I was able to configure the Arduino microprocessor to use the keypad almost painlessly. I arranged the pinout as follows:

 Pin Use 0 not available 1 not available 2 keypad 0 3 keypad 1 4 keypad 2 5 keypad 3 6 keypad 4 7 keypad 5 8 keypad 6 9 alarm on/off switch 10 alarm tone (PWM) 11 12 13 14 (A0) 15 (A1) display brightness potentiometer 16 (A2) 17 (A3) mode switch (3-state) alarm/time 18 (A4) i2c – display and realtime clock 19 (A5) i2c – display and realtime clock

Pin A3 was used for analog read to determine the state of a simple resistor network. Switching the mode switch changes the resistors in a voltage divider. I designed this before I learned about the Arduino’s internal pull-up resistor, so the analog electronics are more difficult than I would make them today.

In case anyone wants it, the code is here also.


#include &lt;Wire.h&gt;
#include &quot;RTClib.h&quot;

RTC_DS1307 RTC;
DateTime now;

#define PIN_ALARMSWITCH 9
#define PIN_ALARMTONE 10
#define PIN_MODE3STATE A3

#define PIN_BRIGHTNESSPOT A2 // on the left

#define COLON 2
#define PM 8
#define ALARM 4
#define EXTRA 16

int brightness( void){
// the analog reading is between 0 and 1024, so divide by 64 to get the
// values between 0 and 15
}

class ClockDisp : public Adafruit_7segment {
uint8_t alarmOn;
uint8_t pmOn;
uint8_t colonOn;
public:
void writeState( void);
void alarm( bool);
void pm( bool);
void colon( bool);
void toggleColon( void);
void printTime( DateTime now);
void blank( void);
};

void ClockDisp::blank( void){
print(10000, DEC);
writeDisplay();
}

void ClockDisp::writeState( void){
writeDigitRaw( 2, alarmOn | pmOn | colonOn );
writeDisplay();
}

void ClockDisp::alarm( bool newState ){
if( newState){
alarmOn = 4;
}else{
alarmOn = 0;
}
writeState();
}

void ClockDisp::pm( bool newState){
if( newState){
pmOn = 8;
}else{
pmOn = 0;
}
writeState();
}

void ClockDisp::colon( bool newState){
if( newState){
colonOn = 2;
}else{
colonOn = 0;
}
writeState();
}

void ClockDisp::toggleColon( void){
colonOn ^= 2;
writeState();
}

void ClockDisp::printTime( DateTime now){
//DateTime now = RTC.now();
int hour = now.hour();
if( hour &gt; 12){
pmOn = 8;
hour %= 12;
} else{
pmOn = 0;
if( hour == 0) hour = 12;
}
int decimalTime = hour * 100 + now.minute();
print( decimalTime);
writeState();
}

const byte ROWS = 4; //four rows
const byte COLS = 3; //four columns
//define the cymbols on the buttons of the keypads
char keys[ROWS][COLS] = {
{'1','2','3'},
{'4','5','6'},
{'7','8','9'},
{'*','0','#'}
};
byte rowPins[ROWS] = {7,2,3,5}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {6,8,4}; //connect to the column pinouts of the keypad

//initialize an instance of class NewKeypad

ClockDisp clockDisp = ClockDisp();
int alarmNum = -1;
bool isAlarming = 0;
bool hasAlarmed = 0;

void setup(){

Serial.begin(9600);
Serial.println(&quot;Clockit&quot;);

Wire.begin();
RTC.begin();

if (! RTC.isrunning()) {
Serial.println(&quot;RTC is NOT running!&quot;);
// following line sets the RTC to the date &amp; time this
// sketch was compiled, except on Mac.
}

clockDisp.begin(0x70);
clockDisp.setBrightness( 10);

clockDisp.blank();
}

void loop() {
Serial.println(&quot;Top of loop&quot;);
now = RTC.now();
Serial.print(&quot;Brightness pin: &quot;);
clockDisp.setBrightness( brightness());
// Print the time, and update the colon
Serial.print(&quot;Time decimal: &quot;); Serial.println( now.hour() * 100 + now.minute());
clockDisp.printTime( now);
if( millis()%1000 &lt; 500){
clockDisp.colon(1);
}else{
clockDisp.colon(0);
}
delay( 20);

/* The alarm function is actually a little bit complicated. It is
easy to test if the current time is equal to the alarm time. We
want the alarm to start beeping and not to stop until the switch
is thrown. However, if we immediately turned the switch back on,
the current time would still exceed the alarm time, and it would
start beebing. Therefore, I created the hasAlarmed variable, which
records that the alarm has gone off. hasAlarmed will reset to FALSE
when the time is less than the alarm time, indicated that we've come
around the clock again.
*/

clockDisp.alarm( 1);
if( isAlarming){
if( millis()%1000 &lt; 500){
tone( PIN_ALARMTONE, 1000);
}else{
noTone( PIN_ALARMTONE);
}
} else if( hasAlarmed){
if( (now.hour() * 100 + now.minute()) &lt; alarmNum ){
hasAlarmed = 0;
}
} else {
// See if we need to turn on the alarm
if((now.hour() * 100 + now.minute()) == alarmNum){
isAlarming = 1;
}
}
}else if( isAlarming){
clockDisp.alarm( 0);
noTone( PIN_ALARMTONE);
isAlarming = 0;
hasAlarmed = 1;
}else{
clockDisp.alarm(0);
}

// Contol of setting state switch
if( mode &gt; 900 ){ // set the time
Serial.println(&quot;Setting the time&quot;);
// blank the display
clockDisp.blank();
int numDigits = 0;

// wait for keys, display them, check state
// wait for entry of time
if( customKey &gt; 0){
if( numDigits &gt; 0){
}else{
}
numDigits ++;

clockDisp.writeDisplay();
}
}
// Test to see if we got a valid time:
}else{
// An error, flash bars at the user
clockDisp.print( 10000);
clockDisp.writeDisplay();
delay( 300);
}
}else if( mode &gt; 490){ // state 2
clockDisp.print( alarmNum);
clockDisp.writeDisplay();
int numDigits = 0;

while( 1 ){
if( (ar &lt; 490) || (ar &gt; 900)) break;

// wait for keys, display them, check state
// wait for entry of time
if( customKey &gt; 0){
if( numDigits &gt; 0){
alarmNum = alarmNum*10 + (int)(customKey - '0');
}else{
alarmNum = (int)(customKey - '0');
}
numDigits ++;

//clockDisp.print( (int)(customKey - '0'));
clockDisp.print( alarmNum);
clockDisp.writeDisplay();
}
}
// Test to see if we got a valid time:
if( (alarmNum &gt;= 2500) || (alarmNum &lt; 0)){
// Invalid time entered, flash error bars at user
clockDisp.print( 10000);
clockDisp.writeDisplay();
delay( 300);
} else{
hasAlarmed = 0;
}
}
}

int getDecimalTime(){
DateTime now = RTC.now();
int decimalTime = now.hour() * 100 + now.minute();
return decimalTime;
}


## Wiring an Arduino to a Five-state Guitar Switch

I am rebuilding my Arduino-based data collection system. Named the RIMU for some long-forgotten and pointless acronym. My old one used a momentary switch—a button—to change which sensor is displayed on the LCD. It is awful because if the Arduino is busy when you push the switch then nothing happens. I’m fixing it with a 5-position switch sold for changing the pickup combinations on electric guitars.

I was thinking about some really good machine interfaces, and some really bad. I walked about the house with a camera. Below are some photo collections of good and bad interfaces around the house.

Good interfaces control devices unambiguously with touch. You should not have to look at the device to know what mode you have changed it to. Really great interfaces, like a light switch, reveal their state by touch.

My switch is almost as good as a light switch. With five states it is hard to tell which state it is in by feeling its position; however, it is easy to change state. Even better, its position is an absolute indication of its state. There is no issue of the Arduino being busy when the state changes, because the state is fixed by the switch. It is not toggled by some transient state.

I bought my switch from Sparkfun, and also lifted this product image from them.

If you can find old rotary switches with detents you can use the analog read function of the Arduino to get all the states with a single pin. In this case, though, I will use three pins to represent the states. I believe it is possible to configure this switch with a  few resistors to represent all its states with a single analog input, but it is more complex to figure out and I am not short on pins. My definition of pins. The ones with wires are the only ones I need to use.

With just three digital inputs, the Arduino can read all five switch states. The Arduino’s microprocessor includes built-in pull-up resistors. These are easy to use, but a little bit confusing. A pull-up resistor means that if the pin is not attached to anything, the Arduino will read the pin high.

In the following table I show a Y to indicate how the switch is connected internally. However the ABC column shows what you would read from the pins in the Arduino.

 Pos 1 2 3 ABC 1 — — Y 110 6 2 — Y Y 100 4 3 — Y — 101 5 4 Y Y — 001 1 5 Y — — 011 3
// Define the spins to read the switch
#define pinSwitch1 2
#define pinSwitch2 3
#define pinSwitch3 4

unsigned char switchState( void){
unsigned char state=0, in;

state |= in &lt;&lt; 2;
state |= in &lt;&lt; 1;
state |= in;

switch( state){
case 6:
return 1;
case 4:
return 2;
case 5:
return 3;
case 1:
return 4;
case 3:
return 5;
};
return 0;
}

void setup( void){
pinMode( pinSwitch1, INPUT);
pinMode( pinSwitch2, INPUT);
pinMode( pinSwitch3, INPUT);
digitalWrite( pinSwitch1, HIGH);
digitalWrite( pinSwitch2, HIGH);
digitalWrite( pinSwitch3, HIGH);
Serial.begin( 57600);
Serial.println( 'Started');
}

void loop( void){
Serial.print( &quot;Switch: &quot;);
Serial.println( switchState());
Serial.print( &quot; &quot;);
Serial.print( &quot; &quot;);
Serial.print( &quot; &quot;);
Serial.print( &quot; &quot;);
delay( 1000);
}


## Chutes and Ladders Infinite Loop

I play Chutes and Ladders with my kids sometimes. It isn’t a game of skill. Many months ago I was involved in a game that went on and on and on. As soon as someone would get close to the end he or she would land on a chute and be shunted nearly back to start.

I was left wondering just how long a game would last. So this week my son and I implemented a simulator in Python to calculate how long any one person’s game would last. Each person’s play is independent in Chutes and Ladders, the characters do not interact. Therefore, simulating an entire game is almost as easy as simulating a single player’s experience.

First, the board is 100 cells long and the spinner gives you a value between 1 and 6, just like rolling a die. A fair die will have an average roll of 3.5, so on average it would take about 100/3.5 = 28.6 turns to finish a game if there were no chutes or ladders. The histogram of game length without chutes and ladders is below. The longest plausible game is about 35 turns in this scenario and the average is 28.6 turns, estimated from 10,000 random trials.

The addition of chutes and ladders stretches the histogram radically. Instead of the longest single-person game being about 35 turns, it is now over 200 turns. Fortunately, a 200-turn game is not very likely. Surprisingly the average is not a hundred million years. At 30.8 turns the average game with chutes and ladders is only a little longer than the average game without.

Pretty cool.


import random
import pylab as plt
import numpy as np
d = {}
for i in range(1, 101):
d[i] = i

cl = {1: 38,
4: 14,
9: 31,
16: 6,
21: 42,
28: 84,
36: 44,
48: 26,
49: 11,
51: 67,
56: 53,
62: 19,
64: 60,
71: 91,
80: 100,
87: 24,
93: 73,
95: 75,
98: 78}
d.update(cl)
numturnsa = []
for t in range(10000):
numturns = 0
pos = 0

while True:
numturns += 1
pos += random.randint(1,7)
if pos &amp;gt; 100:
break
# To &quot;play&quot; without chutes and ladders, comment out the next line.
pos = d[pos]
numturnsa.append(numturns)

plt.figure(figsize=(5,3))
plt.hist(numturnsa, 60)
plt.xlabel(&quot;Number of turns&quot;)
plt.ylabel(&quot;Count&quot;)
plt.savefig(&quot;chuteshist_nochutes.png&quot;, dpi=200)
numturnsa = np.array(numturnsa, dtype=&quot;f&quot;)
print &quot;The average number of turns is&quot;,np.mean(numturnsa)


## Monsoon

In the desert it almost never rains. I know, you know. When I lived in upstate New York, in my foolish youth, I bought a motorcycle in the beginning of April. I was anxious to learn to ride. Too bad, because it rained every day for an entire month. Now I live in New Mexico. Two years ago we had not one drop between the end of December and July.

Where you live the weather turns with a unique step. Here, the summer breaks in July when the monsoon comes. Moist air from the Gulf of California and the Gulf of Mexico flow north over the state and give rise to afternoon thunderstorms. It is the most beautiful weather of the year here. The clouds rise miles—literally—into the sky and continuously billow in fractal glory.

Last week I configured my Raspberry Pi computer with its PiCam to take time-lapse video out my back window. The view is to the east over the Sandia Mountains. I took pictures about every six seconds from 10:30 am until dark, around 8:30 pm. The whole day compressed into four and a half minutes. The best video was from July 14, others are below.

It is hard to understand the desert if you have never lived in one. In the picture below you can see what it would be like if Leeds were in Albuquerque. A nation that ruled the world for a few hundred years fits comfortably in the desert southwest.

The rest of the videos I created are here, with the most interesting at the top.

July 11

July 13

July 8

July 7

July 10

July 16

July 15

## The Spiraling Shape

The Spiraling Shape will make you go insane
Everyone wants to see that groovy thing

–They Might Be Giants

The chambered nautilus is sometimes called a living fossil. It is the closest living relative of the ammonoids, and cross sections of its shell are familiar to every adult in the western world. Most kinds of ammonoids lived a long time ago. They started appearing in our Devonian strata around 415 million years ago. Pretty cool, since modern humans have been around 0.195 million years. If you consider the chambered nautilus close enough, then you might say that these critters have been around 2000 times longer than humans. That is real staying power.

In June my wife and I visited San Francisco for a vacation. A delightful city for touring because it has such a mix of old turn of the 20th century buildings, awesome bridges, a cool sea breeze, great parks and museums, shopping, cultural diversity, and enough hipsters to feed Cthulhu for an eon. Unless someone can find a more suitable use for hipsters.

In Chinatown we saw all the usual junk. But there was also a rock shop that had a nice assortment of cross-sectioned fossil ammonoids or nautiloids. I dug through and looked for one with the most open inner spirals. And here it is.

I scanned it at absurdly high resolution, the largest diameter is 1.6 inches. The construction of the nautiloid is fascinating. The spiral is logarithmic, as you can find asserted all over the web. Of course, in my entire life I have never seen anyone actually measure the spiral and show its logarthmic nature. But it looks like it a logarithmic spiral.

The structure is self-similar. It is hard to tell how big this little shell is because it would like basically the same to your eye at ten times the size. I love that: fractal without fragmentation.  The creature, I suppose, could grow large just by repeating the same basic step—grow a new chamber. The genetic code to scale up must have been quite an innovation, evolutionarily speaking.

Distilling the spiral of the shell to its simplest shape shows awesome, but not perfect, consistency.

I have never seen a discussion of how the maximum and minimum buoyancy of the creature might have changed as it grew. You can bet that there is a clever relationship between the mass of the cephalopod’s body, the mass of its shell, and the volume of each successive  chamber, at least for those that can move vertically. Seafloor-dwelling species might be marked by a faster-opening spiral that keeps their shell from rising. Why is that a safe bet?

I understand that the nautilus spends the day deep in the ocean, and rises near the surface to hunt at night. They control their depth by pumping water in and out of their shell chambers. A nautilus’ chambers are connected by a little hole, and I can’t see any holes between chambers in my fossil so maybe mine wandered about on the seafloor or floated at a constant depth.

I measured my trace for the distance between spirals. I divided them all by the smallest one and produced the measurements

 1 1.3 2.9 5.6 12 25 49
And this spiral does indeed show logarithmic growth. The plot shows the plot of the natural logarithm of the same measurements. Its consistency is so very, very good. I suppose that’s what makes the shell so pretty.

## Ear Tips for Noise Canceling Headphones

Most people have never tried in-ear headphones. They get ear wax on them, so to don’t share well. Wearing them on stage, musicians can hear their own instruments without going deaf. Since musicians use them for performance in-ear headphones are also called monitors, just like the speakers that point toward the band from the front of the stage.

Distraction, from airplane noise, office noise, maybe your own keyboard, annoys. Three headphones solve the problem. Most famously, Bose’s active noise canceling Quiet Comfort line and similar products by other makers. Passive noise reduction from sealed over-ear headphones is about 10 dB. In-ear monitors offer passive isolation between 20 and 30 dB.

I demoed the Bose phones years ago, and they hissed with the noise cancellation on. The sound quality was neither exceptional nor awful, but was poor for a $300 price. World-class sound quality is available from makers like Etymotic and Westone with in-ear monitors that provide as much isolation as active noise canceling models. But in-ear monitors have one major drawback, they go in your ear canal. That means that they can get gross with ear wax, can be painful or itchy, and they can wear out. In my nine years using in-ear monitors I only ever found the foam tips from the manufacturer comfortable. The three-flange silicon tips isolate amazingly, but itch like fire after twenty minutes and hurt like a drill after sixty. The foam tips are comfortable, almost as isolating as the three-flange tips, but cannot be fully cleaned and wear out after three months. The most recent time I wore out a pair of foam tips, I decided it was time to look at the alternatives. I hoped to find, ideally, a comfortable silicon tip with the isolation of the foam tips or an inexpensively replaceable foam tip. It seems to be sort of a niche market, and I failed to find any useful comparisons on the web. So, I did my own. I purchased a sizing kit from Westone, another from Monster, and a pack of the universally-liked Comply foam tips. Testing included a few leftover tips from the headphone’s original purchase, and I included those in the comparison. I evaluated each tip for fit, seal, pain, itching, sound quality, isolation, and microphonics. Fit, seal, sound quality, and isolation are all related. With in-ear phones a poor seal means poor isolation and poor bass response and poor sound quality. Good fit depends on having the correct size tip for your ear. Medium tips from most manufacturers fit my ears well. The calipers in the picture below show a base diameter around 0.465 in (1.18 cm). Most of the tip designs are old. Grubby among my grandfather’s shooting supplies, foam and triple flange tips were familiar to me twenty-five years ago. Recently Westone introduced a single-flange tip focusing on good seal and comfort. These, along with other single-flange tips, suffer from awful microphonics. When cables rub against anything, like your arm as you move the mouse, the motion travels along the cables and makes loud popping noises. Single-flange tips have the worst microphonics. The best overall tips for me are Comply’s T-100 PLT medium foam tip. They cause no pain or itching, seal great and offer very good isolation, have low microphonics, and sound very good. Like all foam tips, they will wear out in three months and get waxy and gross. And they are neither the most isolating nor the quietest. The best sounding tips are the Westone silicone three-flange tips, which offer by far the best isolation and by a small margin the best sound. After twenty minutes they also offer crushing pain and infernal itching. The three-flange tips have a place in my kit, but I don’t use them long. Westone’s single flange tips are silicone, and are comfortable. My notes describe the itching from Westone’s silicone three-flange tip as extreme. After that, finding any silicone tip bearable was a surprise. The Westone Star tip is comfortable. It has poor microphonics, and poor isolation; it has no place on an airplane or a noisy office. On the other hand, Star Tips are cleanable and provide some isolation, so they are candidates for the gym. These also have a place in my kit. The rest of the tips are unsurprising. Everything from Monster had poor isolation and had distracting microphonics due to a poor design. All of the other fitting foam tips are acceptable, but none are as good as Comply’s. All the other silicone tips are unacceptable for me, too painful, too itchy, too microphonic, and sound too poor. The results for all tips that fit reasonably well are in the table at the end. I tested these tips with an hour-long playlist from mixed genre, seven songs in all. It starts with D. Barenboim/Berliner Staatskapelle recording of Beethoven’s Symphony 9, included to show dynamic range of symphonic instrumentation. The next two songs have typical mid-pitch-heavy pop songs including Adele’s One and Only off her album 21, and Erica Badu’s Four Leaf Clover from Baduism. Next, Erica Badu’s Rimshot shows the performance with an extreme deep bass opening line. Sweet Jane from the Cowboy Junkies is more typical pop. A mid-heavy but delicate sound and detailed sound from Miloš Karadaglić’s album Mediterráneo with his performance of Granados’ Danzas españolas, Op.-No. 2 Oriental. Finally, a very detailed song from Rush, The Necromancer off their album Caress of Steel has shown the weaknesses of many sound systems. I chose an hour-long playlist because in my experience in-ear monitors often lead to such itching and pain in the ears that I want to claw them out of ears screaming after forty minutes. Monster produced the only foam tips I avoid. To fit my earphones you put the tiny red rubber rings around the earphone and then slide the tip over the top. The result was poor isolation and poor microphonics.  Tip Size Fit Seal Sound Iso. Mic. Pain Itch Westone Classic Foam Med G G G G G G G Westone Silicone White 3-flange — G E E E G M VP Comply Foam T-100 PLT Med G G VG VG VG VG VG Westone Star Silicone Black 1-flange Med G G VG P P VG VG Westone Classic Foam Med-Long G G G G G VG G Westone Truefit+ Foam Med G G G G G G VG Westone Silicone Black 1-flange Med G G G G P G G Westone Star Silicon Black 1-flange Med-Long G G VG P P P G Weston Truefit+ Foam Med-Long G VG G VG G G G Westone Silicone Clear 1-flange Med G P P P P P G Westone Classic Foam Small-Long G P P P G VG G Monster Foam Med G G G P P G G My wife put me onto Bloglovin for those who follow with an aggregator. If you like, Follow my blog with Bloglovin. Finally, I have had no contact with the makers of these products, and I wasn’t compensated or paid in any way. Quite the contrary, I bought all the equipment reviewed here. ## Some Curious Micrographs We have an old microscope and a camera adapter for it. Occasionally we dig it out, and light some small stuff up. Several weeks ago my son’s science workbook had a multiple choice question, roughly “which of these would look different under a microscope” • salt in water • sugar in water • pollen in water An experiment seemed in order. After exploring those boring solutions we explored other things. The first is the tip of a technical pen. I believe the narrow diameter part is the wire, and the large diameter is the tube. I suppose the fillet is a meniscus of ink. Rotring Technical Pen Tip The feather is cool enough to look at, but within the feather is a single fiber from a blue yarn that my wife was crocheting with. A Feather and a Colored Thread At the request of my son, I plucked one of my precious head hairs. I had hoped to see the surface structure of the hair, a tiny scaled surface. It is visible, but not clearly. Still, pretty cool. A Hair at the Root We looked at paper, too. But paper was not that interesting until we compared three different types. Notebook paper, a Kleenex, and slice of technical drawing paper (like vellum). The difference between the fibers is amazing. A Tissue and a Strip of Technical Drawing Paper My son wanted to look at candle wax too, but the toothpick we used to get it is far more interesting. Toothpick with Candle Wax You think that milk has been homogenized and so it should look like a smooth, uniform material. I was fascinated to observe a sandy or granular structure under an optical microscope. The microscope cannot really resolve the individual particles, but it can show that the particles are there. Milk The final picture is shows the microchip inside a slow-fade RGB LED. This LED fades through the gamut of colors, and macroscopically looks identical to any other LED. The picture is blurry because it is imaged through the acrylic body of the LED. Nevertheless, the microchip structure is visible. At the bottom you can see four solder joints, one for ground (or Vcc) and red, green, and blue components. Microchip Inside a Slow-fade LED ## Typefaces Updated February 5, 2014 to correctly display the LaTeX screenshot, minor prose edits, and added discussion of font styles. I do not know if you have a favorite font. I do. I really like Microsoft’s Calibri font because it is very readable on screen and paper and it looks professional. With that in mind, it has several huge shortcomings for much work. Let me list • You don’t have a right to use the font unless you have purchased it (for$120) or acquired with a legal license of a Microsoft product that includes it.
• Calibri does not have small caps family member
• Calibri does not have a corresponding math font

Many people, including me, got to know Calibri because it is the default font in Microsoft Word. I am trying to find a way to leave Word because it has poor support for equation numbering, mediocre bibliography support. It is also difficult to automate updated graphics using non-Microsoft work flow. For example, I often generate graphics in Python with Matplotlib and write them to a file. I would like my document workflow to pick up the picture automatically when it changes but have not found a reliable way to do this in Word.

Microsoft Word is fundamentally poor at rendering documents compared to a display tool like Adobe Reader. Consider the following screenshot comparing a default Word document snippet in Calibri with Word’s rendering of text in the TeX Gyre Bonum OpenType font. Next screenshot is from a Word display at 100% zoom.

The shading in the Bonum section is appalling. Look at the dot over the letter i in pi. Word renders the compatible TeX Gyre Bonum Math and TeX Gyre Bonum fonts differently depending on whether it is in equation mode or body text. The shading in the top paragraph is good; however, the overall construction is horrible. In Word a number in equation mode is displayed in the default math font Cambria. Calibri does not match Cambria and the two numbers can’t look the same. Furthermore, the fraction in the middle of the paragraph causes the line spacing to expand just on that line, making it look almost like there are more paragraph breaks than there should be. Distracting and unattractive.

The next picture is screenshot from Adobe Reader X at 100% zoom viewing a LuaLaTeX generated LaTeX document.

First, the TeX Gyre Bonum snippet is readable and reasonably good looking. The math font and text font are indistinguishable, as they should be. LaTeX handles even Microsoft’s pet font Calibri better than Microsoft. The fraction renders clearly and readably. It does so without creating a large horizontal gap.

The ideal faces, from my point of view, should:

• Be embeddable in your electronic documents
• Not cost much to install on every system you want to use (eleven computers at least)
• Work on Windows, Linux, and MacOS
• Include regular, bold, italic, bold italic, small caps, and math families
• Be functional with Word or other non-LaTeX tools.

The license problem is unquestionably the most limiting factor since OpenType now seems to allow fonts to work across platforms. The GUST project has created a series of libre fonts called the TeX Gyre fonts. Among these fonts, only three have the math family, and all three of these satisfy the other requirements.

 TeX Gyre Bonum Based on URW Bookman L TeX Gyre Pagella Palatino-like TeX Gyre Termes Times-like

There are several other Gyre fonts that are quite attractive and potentially useful but lack the math fonts. TeX Gyre Schola seems to be planning a math font which is not yet ready. If you don’t need to have a math font, or don’t need a matching math font then there are many other fonts to consider. Fontsquirrel has a lovely list of libre fonts. There are other fonts available for LaTeX that can produce good results but do not seem to have a functional method to work with other tools.

Wikipedia describes Calibri as a “humanist sans-serif typeface”. The closest TeX font with math support, to my eyes, is KP Sans-Serif. The strokes are not as modulated so the KP looks less refined than Calibri. I do not see how to use that typeface outside of LaTeX. If you are interested in other LaTeX fonts, consider looking at the LaTeX font project fonts with math support.