Code, by Charles Petzold

Andrew Milmoe of Make:SF recommended Charles Petzold’s book Code to me several months ago to help me refresh my knowledge of computer architecture as I dive into embedded systems development.  I finally finished reading it this week and thoroughly enjoyed it.  Code is both a history of the computer as well as a tutorial illustrating how to build one from the ground up using switches and gates.  Some chapters are slow reading due to the complicated subject matter, but the way he brings everything together at the end makes it a great read.  Although the book is in some ways dated (written in 1999, it talks about 128MB of memory being novel and Apple having problems in the desktop market) I found that it is still relevant.  This is particularly true for microcontrollers and embedded systems which have more in common with the 8 bit computer that is the subject of the book than a Pentium 4 in today’s desktop PC’s.

Code: The Hidden Language of Computer Hardware and Software
Charles Petzold’s latest book, Code: The Hidden Language of Computer Hardware and Software, crosses over into general-interest nonfiction from his usual programming genre. It’s a carefully written, carefully researched gem that will appeal to anyone who wants to understand computer technology at its essence. Readers learn about number systems (decimal, octal, binary, and all that) through Petzold’s patient (and frequently entertaining) prose and then discover the logical systems that are used to process them. There’s loads of historical information too. From Louis Braille’s development of his eponymous raised-dot code to Intel Corporation’s release of its early microprocessors, Petzold presents stories of people trying to communicate with (and by means of) mechanical and electrical devices. It’s a fascinating progression of technologies, and Petzold presents a clear statement of how they fit together.

The real value of Code is in its explanation of technologies that have been obscured for years behind fancy user interfaces and programming environments, which, in the name of rapid application development, insulate the programmer from the machine. In a section on machine language, Petzold dissects the instruction sets of the genre-defining Intel 8080 and Motorola 6800 processors. He walks the reader through the process of performing various operations with each chip, explaining which opcodes poke which values into which registers along the way. Petzold knows that the hidden language of computers exhibits real beauty. In Code, he helps readers appreciate it. –David Wall

DIY Light Tent

Homebrew Light Tent

I have always struggled to take decent macro photos of small objects to document my hobbies.  I finally got fed up with poor lighting and blurry shots and decided to build my own light tent to solve the problem.  There are lots and lots of examples on the web showing how to build a DIY light tent.  I wanted something cheap, small, and portable, so I merged ideas from a couple existing designs and used some scrap materials I had in the garage.  In the end I managed to make a light tent for about $35.

The major components are:

  • Light. I bought two desk lamps at Target for $9.99 ea.  I bought 100W CFL lights from Home Depot to avoid the unwanted heat and energy usage of conventional light bulbs, $9 for two.  I bought the color balanced type (3500K) which cost a little more but help accurate color reproduction in the photos.
  • Frame.  I used an old shoe rack, but almost anything can be made to work.
  • Light diffuser.  I tried bedsheets, which attenuated too much of the light.  Instead I used tracing paper (vellum) that I had left over from another project.
  • Background.  I used poster board from Target.  I bought one sheet each of 6 colors, for about $5.
  • Tripod – I didn’t have one so I bought the cheapest one Best Buy had, around $30.  Since I needed this for general use anyway, it’s not included in the total.

The results are really spectacular.  Now I can take macro shots of small objects without the glare and lighting problems I have experienced in the past.  For an example check out the photo below or see the complete set on flickr.

playing with my new light tent

New Flickr group for photos of printed circuits


Printed circuit boards can be interesting and beautiful, with their delicate traces and colorful components in all shapes and sizes.  I just created a new Flickr group for photos of printed circuits like the one shown above.  More details about the group can be found on Flickr:

Photos exploring the beauty of printed circuit boards and components, including both surface mount and through-hole PCB construction.

PID Controlled Solder Paste Fridge

PID Controller closeup

I recently decided I needed to upgrade my garage electronics bench to include capability to work on surface mount components.  I ordered a hot air reflow station and some no-clean solder paste from SRA.

Solder paste is a little tricky to handle, because most solder paste needs to be refrigerated at 32-50°F to maintain it’s shelf life.  Stored at room temp, it tends to get tacky and dry out within a few weeks.  Solder paste is also toxic (it contains lead among other things) so it’s not something you want to put in the fridge with your meatloaf.

I had an old beer cooler sitting in the garage that Kylie picked up on the street a while back.  It uses a Peltier thermoelectric cooler to cool the inside and can achieve sub-freezing temperatures.

PID Controlled Solder Paste Fridge

Since I didn’t want to leave the cooler on constantly, and below freezing is actually too cold for solder paste, I decided to add a PID controller to the cooler to create a solder paste fridge for the garage.  To do this, I needed the following items:

  • Love Controls 16A PID Controller found at a surplus store.  This one happens to run on 12V and also has a 15V output which made things simple, but other configurations are possible and almost any PID controller should work provided it supports “direct” mode (for cooling instead of heating) and has a relay or switched voltage output.
  • K-type thermocouple to measure the inside temperature of the cooler
  • power MOSFET capable of switching 12V @ at least 5A, lower on-resistance is better.
  • 1k bleed resistor to ensure the MOSFET turns off when it’s supposed to
  • a small heatsink for the MOSFET (may be unnecessary, mine doesn’t even get warm)

Since the PID controller happens to run on 12V I was able to use the existing 12V power supply for the cooler to power everything.  I configured it so that if the desired temperature is below the current temperature, the PID controller turns on the MOSFET which supplies power to the Peltier cooler and it’s associated fans.

The only hangup I had was that at first I didn’t place the 1k resistor across the output of the controller, and the cooler would stay on constantly.  It turns out that because MOSFETs have almost no gate current, once the PID controller turned off it’s 15V output, the gate of the FET would continue to float high.  The bleed resistor to ground ensures that this can’t happen, and the FET turns off properly.

Here’s a picture of the finished solder paste fridge complete with PID controller (click for a larger version).

Finished PID Controlled Solder Paste Fridge

You can check out a bunch more photos of the cooler on flickr.  It should be possible to perform this modification on a more conventional mini-refrigerator as well for better control over the temperature, provided it uses a Peltier cooler, or maybe you could even build the whole thing from scratch using a Peltier cooler off ebay.

Join the resistance.