I'm trying to debug a circuit that's having either a frequency- or pulse-width dependent glitch. We're using a hall-effect sensor to measure RPM on the Boldsprints equipment and under mysterious and hard-to-reproduce circumstances, the microcontroller that bridges the sensors to the software crashes. Maybe we're exceeding the frequency input of the micro. Perhaps the sensor isn't triggering for long enough. Maybe there's excessive noise on the line. Well, at least the first two conditions are easy enough to rule out or verify by swapping out the sensor input for a function generator. The only problem is - this isn't for work, and I don't own a function generator. So, I took the day to make one.
The ckt:

The scope shot:

It's a straight-forward circuit using two LM555s. I cascade an astable 555 into the trigger of a monostable 555, and sweep the Ra of each to vary frequency and pulse width, respectively. In retrospect, I should have used LMC555s - a CMOS version that has full-swing TTL output... but more on that below the notes. As it is, I can dial the pulse width from 110uS to 12.5mS and sweep the frequency from 12Hz to about 2.5kHz using the two 100k potentiometers. I can generate negative and positive pulses (by exploiting aliasing!). The signal swing is from 0V to 3.7V. The overshoot is minimal.
And because there's nothing sacred in engineering... the notes:


Congrats - you made it to the bonus geek-out portion. Why should I have used an LMC555 over the LM555? Well, it's the difference between CMOS architecture and old-school bipolar processes. Here's the schematic for the National LM555. For the purposes of this discussion, we only care about the output stage - specifically the pull-up transistors Q27 and Q28.

The LM555 is old. In addition to being incredibly cheap, it uses a very old-school bipolar process. Now, a modern bipolar process typically has comparably good P- and N-type transistors, so you'll often see a push-pull output stage that has pretty good output swing. However, Back In The Day, the P-type transistors (PNPs) were really crappy compared to the N-types (NPNs). Specifically, the P-type had really low beta (low gain), and couldn't slew a lot of current. So, a push-pull output wasn't an option for the LM555 designers. Instead, the LM555 has two NPNs (Q27 and Q28) configured as a totem pole to slew a lot of current at the output (which is necessary if you want your square wave to look square). When the LM555 is driving high, Q27 is always on, and the maximum output voltage is one Vbe down from the rail (Vbe is typically 0.6 Volts, give or take) plus the voltage drop across R12. When the load current is high enough so that the voltage drop across R12 (3.9k * Iload) exceeds the Vbe of Q28, then Q28 will turns on, which increases the current drive capability of the output but has the trade-off of limiting the output swing to within 2x Vbe of the top rail. My function generator circuit is driving a 50 Ohm resistive load (which requires a fair amount of current - 3.7 Volts / 50 Ohms = 74 mA), so it's no surprise that the output of my circuit settles at 3.72V instead of 5V.
In the CMOS-based LMC555, the output is driven by a beefy inverter - an inverter being a P-type MOSFET stacked on top of an N-type MOSFET. Once nice thing about FETs is that you can design them to have very low on-resistance (Ron), and the output of such an inverter will be able to swing to within Ron * Iload of either rail. So, in order to improve on the LM555, all the C555 designers had to do was specify the "max" output current load and the output swing to exceed the specs of a bipolar 555, having already sized the output FETs accordingly.
Praxis \Prax'is\, n.
1. Use; practice; especially, exercise or discipline for a specific purpose or object. "The praxis and theory of music." -- Wood. 2. An example or form of exercise, or a collection of such examples, for practice.
Practical \Prac'ti-cal\, a.
1. Of or pertaining to practice or action. 2. Capable of being turned to use or account; useful, in distinction from ideal or theoretical; as, practical chemistry. "Man's practical understanding." -- South. "For all practical purposes" -- Macaulay. 3. Evincing practice or skill; capable of applying knowledge to some useful end; as, a practical man; a practical mind. 4. Derived from practice; as, practical skill.
Combine the two at 3,146 RPM and -40C for 4 minutes and 32 seconds, and you get praxical. As conceived of on 1/26/2009 with previously generated content ported over and back-dated appropriately.
I recently found myself killing time in NYC, which means a visit to the good folks over at Adafruit Industries. Cue dramatic voice over, "This time, it's not social." Limor had wrapped up the prototype for her Vacuum Florescent Display (VFD) clock, but was still in need of an enclosure. I was in need of something to do. Thus - over the weekend - I had a Makeation.
It began, as all things must, with an engineers' pad, some graphite, an eraser and some high-precision calipers.


After I was thoroughly sure of the dimensions (on paper), I started sketching up the pieces to cut on the laser cutter in Illustrator. No, it's not the right tool for CAD, but you can monkey around and get center-to-center drills if you sufficiently abuse some of the alignment and grouping features. And it worked well enough to yield a first-time-right design (although one that required exactly 0.125" acrylic).
Here's the front:
The back:
And the bottom:

The final kit won't be called 'iceb0x,' but I couldn't resist. It's only a prototype run so far, but the layout of Limor's board is clean and very compact. The VFD itself is also nice. You can see from the photos that the color is a cool aqua, that's a nice contrast to the warmer tones of the highly-fetishized Nixie tubes. The other upside(s) to using a VFD over a Nixie is that it's multi-digit, not nearly so rare, and it runs at a significantly lower voltage. A VFD takes less than 40V as compared to Nixie tubes, which need 80V to 100V. I know that voltage is cool (it's current that kills) but why use a BEEFY transformer when a cute SMT core will do?
Another nice detail of the clock is that Limor has the VFD mounted on a daughter board via a right-angle header so that the tube "floats" above the PCB. That made for the trickiest part of the enclosure design -- placing the "nipple" drill in the North face that keeps the tube in place. It worked on the first pass, but I admit to tweaking it so that the tube was perfectly parallel to the PCB. There's less than 1/16" of wiggle room in the long dimension in this version of the case. I'm especially proud of the fact that it's fully-interlocking on 5 of 6 faces (the top being held on by compression from two nuts) and assembled using 6 x 4-40 screws.
If you're psyched about the VFD clock design, and can't wait for the Adafruit Industries kit to come out - it's the sort of project that's been multi-sourced by rsw and Make Blog, among others.
My favorite exercise in holiday cooking is to make brined turkey. Use any clean, water-proof storage container and a cold environment (such as a refrigerator or Boston) and soak the turkey in the brine for an hour per pound of bird. The recipe for the brine I use is roughly 1 gal cold water to 1 cup of the following: kosher salt; raw sugar (or 1/2 white sugar and 1/4 molasses); rough whiskey. I like to use Wild Turkey. It makes a man mean and meat delicious. (Hi Mom, meet Delicious. Mmm.) You can add any combination of aromatics or other flavors to the brine. After soaking: remove the bird; dry it; rub with spices and stuff if desired; roast according to size and stuffing.Now, you can stuff a brined turkey with anything, or nothing at all - it comes out delicious either way. This year, we decided to experiment with some mild aromatics: we applied a salt-and pepper rub and stuffed the bird with a mix of Gala apples; red onion; garlic; rosemary; thyme and celery salt.
My method of roasting a turkey is to cover it with a clean dish towel and roast it at 325F for 3-3.5 hours. I soak the towel with low-salt chicken stock every half hour.

Once the time is up, I uncover the turkey, turn it around (breast to the front) and baste while roasting at 350 for another hour to crisp the skin. It usually comes out looking delicious.
For the side-dish, we cut up a single enormous butternut squash to roast with sweet potatoes, carrots, apples and Morrocan spices.
Delicious Spice Mix (we upgraded to tablespoons):
2 tsp. ground cumin
1 tsp. ground coriander
1/2 tsp. chile powder
1/2 tsp. sweet paprika
1/2 tsp. ground cinnamon
1/4 tsp. ground allspice
1/4 tsp. ground ginger
1/8 tsp. cayenne pepper
and a pinch ground cloves
To prep, just toss the chopped squash and sundry with a few tablespoons of olive oil and a few teaspoons of the spice mix (enough to provide reasonable coverage). Now the recipe I cribbed said to roast the squash uncovered at 450 for 45 minutes; but we were roasting the turkey simultaneously, so we roasted the squash covered at 325 for 1.5 hours. Good thing, too! It was delicious.
There was a mad rush this week to get basil from the farm share before the frost hit and all the plants turned brown and unfortunate. I'm not entirely sure of the basil variety they plant, but the leaves are smaller than grocery-store basil, and it smells spicier. I will update this post with the varietal information at a later date. What's more important is that making pesto was a moral imperative, but whenever I use raw garlic (as most recipes call for) the pesto always turns out much too strong and sharp.
The solution: Roasted Garlic Pesto
Step 1. Roast a whole head of garlic ala Warren Ellis (He writes like my Papa, which is disturbing. Even more so, he seems to follow the same hard road in cooking -- so ignore him about scraping yourself bloody trying to peel sweet potatoes. One day, someone brave will tell him that the right way to make sweet-potato mash is to boil the potatoes first, quench them in ice water, and then rub the skins off). I used Otter Creek Copper Ale as my beer of choice. Nice and sweet. I wanted my garlic in between sweet and sharp, so I only roasted it for 30min on 400F.
Step 2. Clean and pack 2c fresh basil into a food processor.
Step 3. Add 1/2c of EVOO - use a tasty variety. I like to use Trader Joe's California Estates Extra-Virgin Olive Oil, in the black bottle. Ask for it by name.
Step 4. Add 1/2c+ of grated Parmesan.
Step 5. Add a double-handful (1/3c) of pine nuts.
Step 6. Add salt and pepper (a pinch of each), or forget to add the salt and pepper like I did, and add it as a garnish later on. If nothing else, it gives you an excuse to summon Heavy Metal Guy.
Step 7. Add the roasted garlic.
Step 8. Q: Will it blend? A: Yes it will.
Step 9. Sever over pasta with fresh tomatoes.
There has been some recent deliciousness occurring in my kitchen. The cause: This summer, I am participating in a local farm share, a privileged activity of the socially-conscious green (and maybe, young and urban) professional, which was recently featured in the NYTimes. You pay in advance for produce. Every week, one person picks up that week's allocation of vegetables harvested from the farm. We then struggle to consume the fresh produce without having any of it rot. It is wonderful.
If you are lacking the time (or more importantly, RoHS-compliant soil) to grow your own food, a farm share is the next best thing. You pay (in my case $150) in advance for what turns out to be about 4 months worth of vegetables. That's $10/week for enough vegetables to stuff yourself silly on. Onions. Beets. Turnips. Carrots. Chinese cabbage. Lettuce. Spinach. Tomatoes. Kale. Garlic (and skates). Squash. Zucchini. Cucumbers. You get all of the joys of the earth without any of the labor, birds, cutworms, deer, mites, droughts, storms, winds or thieving neighbors. It's then an exercise (in my case, a serious learning exercise) to learn how to cook what you have, make it tasty, and most importantly, just eat or preserve all of it. We've had good luck with all our recipes this week... so far.
Saag/Korma Hybrid (a.k.a. I disavow any knowledge of regional Indian cuisine):
- Saute finely chopped onions with pressed garlic in a fair amount of rapeseed/canola oil and butter (as a substitution for clarified butter or ghee).
- Once the onions are translucent, fold in about a pound of washed, finely chopped spinach.
- Add delicious spices, such as coriander, ginger, cumin, fennel, cinnamon and chili powder. Saute. Do not steam.
- Separately, wash and dice up summer squash (we had a variety that half-hybridized with zucchini and was quite sweet).
- Fry the summer squash in hot canola oil, and as they start to cook spice them with mace, paprika, salt and cinnamon.
- Add yogurt to the spinach-onion-spice mix. Reduce.
- Fold in the spiced fried squash. Reduce until creamy.
- Serve over rice.
Beet and Cucumber Soup (a.k.a. I love cold cucumber bisque):
- Start out peeling the beets (save the greens). Dice a cup's worth of them and cook in boiling water.
- Juice half a lemon into a blender. Add some salt, some pepper and a handful of chopped onion.
- Peel a large cucumber, and cut into medium-sized pieces. Add this to the blender.
- Add the cooked beets (drain the water).
- Blend!
- Add a cup of sour cream to the mixture. Blend!
- Add milk and blend until the texture is appropriate.
- Serve chilled with sour cream.
Vegetable Ragout (a.k.a. One eats what there is to eat.):
- Saute chopped onions with pressed garlic in a fair amount of olive oil.
- As the onions are partially cooked, add vegetables in the order of most flavorful/slowest-to-cook (mushrooms, carrots, broccoli, celery, peas, corn, peppers, whatever you have on hand). We added broccoli, beet greens and lemon juice. Saute.
- Add tomato sauce and spices (thyme, rosemary, oregano, salt, pepper) (and optional things like tomatoes and meat). Stir, then cover and let steam. If you need more liquid, add vegetable stock or bullion and water.
- Fold in chopped cabbage and cover.
- Serve as is, with rice, or over pasta.
To make some excellent Eastern European peasant food, start with the ragout, skip steps 2 and 3, go straight to 4 (folding cabbage into sauteed onions and steaming) and then add a pile of cooked lentils. It doesn't look like much, but it is very simple, tasty and filling.