Parking!

The garage door sensor and parking sensors are now installed and calibrated on the stop light controller! I know the video below is shaky — I’m experimenting on several levels here, so there will be better video as the project progresses.

When the garage door is opened, the controller checks for an empty parking space. If a space is empty, then the left and/or right stop light turns green. Then as the car pulls into its spot, the lights turn to yellow, then red as it reaches its exact parking spot.

How a geeky bachelor gets laundry done

Let’s get this out of the way before I even get started: I do the laundry wrong.

That said, I don’t like wasting energy. Our electric company’s website has a tool that estimates your energy usage by category based on your responses to a questionnaire about what type of house you have, how many occupants, and what types of appliances you have. The questionnaire is sufficiently detailed to make me believe it presents a realistic picture of our energy use. It is an eye‐opening look into where our electricity dollars go. After heating, water heating and laundry are the largest energy consumers in our house.

Within the category of water heating and laundry, the dryer is the second‐largest consumer.

We already set the programmable thermostat to the lowest temperature we can tolerate, and the water heater is already set to the U.S. Department of Energy’s recommended 120°F. In my view, the next item that would have the most bang for the buck is to not run the dryer any more than necessary, so I take the clothes out before they start to get crispy. (Which brings me to my original acknowledgement: I do the laundry wrong. This post isn’t supposed to be about marital issues, so let’s move along.)

I thought, what if there is a happy medium? I know that there are dryers out there with moisture sensors that stop the dryer when the clothes are dry instead of just running until it hits the time you arbitrarily set at the beginning of the cycle. Since our dryer does not have a moisture sensor, perhaps I could build one.

Moisture sensors in fancier dryers have two metal strips in the drum that the clothes touch as they tumble around. Wet clothes are apparently slightly conductive, whereas dry clothes are not. By monitoring the electrodes, the dryer can determine when it is done. Since I do not have access to terminals like this, and I am unlikely to gain permission to hack up the dryer, I thought that a humidity sensor in the exhaust would be a good means to tell when the clothes are dry. I found an inexpensive humidity sensor at Sparkfun, and waited for a chance to experiment with it. With the rest of my family out of town, I have the perfect opportunity this week.

I placed the humidity and temperature sensors behind the dryer’s lint filter and connected them to the good old Arduino as a simple data logger, and then I captured humidity and temperature readings during the first load of laundry I did earlier this week. This is the humidity and temperature profile of a full 60 minute cycle (PDF, 16kB).

I learned a few things by examining the plot.

  • I thought that the heating element cycled on and off more. In reality, the heating element is on continuously for nearly 45 minutes, shown by the constantly rising temperature line. This makes sense, though, since it obviously takes a while to heat several pounds of clothes and all that extra water by 100°. Think about trying to boil a pot of water by pointing a hair dryer at it.
  • Once the load finally reaches the thermostat’s high trip point, apparently 155°, the temperature drops by 35° in 5 minutes to 120°, the thermostat’s low trip point, at which point, the heater comes on again. The difference between the trip points is called hysteresis. (Bonus word for the day. You come across this word a lot in control systems.)
  • I should listen carefully for the pop when the thermostat cycles the heating element off and take the clothes out immediately. This will maximize cat happiness when she lays down on the clothes as I try to fold them. (Using incorrect folding technique, of course. It’s okay, since the cat is fat enough to press out any wrinkles.)
  • The dryer apparently is designed to keep the heat element off during the last 5 minutes of the cycle in order to bring down the temperature of the clothes, presumably so they wrinkle less. You can see that the thermostat wants to turn the heat on at about 53 minutes, but the heater is turned off shortly afterward because the cycle will be ending soon. (By the way, what are wrinkles?)
  • The humidity of the exhaust air goes down as the cycle continues. Surprise! To me, this shows that merely sampling the humidity of the air coming out of the dryer doesn’t exactly say when the clothes are dry. Once the dryer finally got warmed up all the way, the humidity went to about 10% and stayed there. I know the clothes weren’t dry at 45 minutes, because they were just barely dry at 60 when the cycle ended, and the humidity was basically the same at those two points. (Okay, I admit it: I can tell when clothes aren’t fully dry.)
  • When the temperature line is rising, the heat element is on. For this load, the element was on for around 50 minutes. How much did the load cost in electricity use? 5600 W heater × 50 minutes = 4.67 kWh, or 47¢. I’m not sure exactly how big the motor is, probably 1/4 or 1/3 hp, so that probably brought the total to 50¢ for this load.

So, unfortunately, in this round, the humidity sensor I bought looks like it won’t useful in trying to minimize dryer use. But at least I got to teach the Arduino a new trick and to make a graph!

Taking a second look at the project, I noticed some omissions.

  1. I skipped over a detail of the humidity sensor’s datasheet specifying that I needed to place an 80kΩ load across the sensor output, so this may have affected the humidity readings.
  2. The load was really big, and the full 60 minute cycle did not get it completely dry. Perhaps a fully dry load does produce another significant drop in the humidity of the exhaust air.
  3. I should have weighed the laundry before and after running it through the dryer. How much water did it have to remove? Several pounds, or the better part of a gallon, probably.

I will have to try the experiment again later this week after making a couple changes.

Thesis on Arduino users

Among the links passing around the internets lately is a thesis by Alicia Gibb, an art history & museum, library, and information science graduate student (hey, I know some people like that) on the Arduino microcontroller platform and the people who use it to create works of art. The thesis is called New Media Art, Design, and the Arduino Microcontroller: A Malleable Tool.

I think her thesis does a respectable job of covering the origins of the Arduino platform and why people find it an attractive starting point. I certainly agree with many of her points.

Gibb states that the Arduino was designed for a non‐technical audience, people without deep knowledge of engineering or computer science. This design goal explains four factors that differentiate the Arduino platform from many others:

  1. It is inexpensive. An Arduino board costs around $30 (better than half the cost of most other similar microcontroller boards), so it is cheap to pick up and learn. It is also cheap to integrate into a project, leave there, and move on to the next project with a new Arduino board.
  2. It is packaged with an integrated development environment (IDE). The IDE is easy to install and get started with, even for non‐technical users.
  3. It is programmed via USB, so additional programming hardware is unnecessary. While most microcontrollers communicate via traditional serial port, the Arduino’s USB port is more useful for communicating with a modern computer that is likely to have no serial port. (I would add the additional point that the USB port supplies power, so no additional power supply is necessary. Even when away from the computer, the USB port can be used for power, thanks to the ubiquity of spare USB wall‐wart power supplies and cables.)
  4. It is supported by a community.

However, the Introduction page on the Arduino website adds and expands some other details that have also been important in its success:

  1. The IDE runs under Windows, as do nearly all other microcontroller platforms, but also under Mac OS and Linux, bringing a wider audience
  2. The software is open source and extensible, encouraging sharing, so people can easily add new features and borrow from the work of others
  3. The hardware is also open source and extensible. While there is official hardware that can be purchased, the design is documented and available for anyone to modify, improve, and extend.

Interactive embroidery project by Becky Stern

Gibb goes on to highlight some high‐profile Arduino work done by artists and designers, as well as exhibitions that have featured them. She summarizes interviews that she conducted with members of the Arduino community, why they used the platform, and how it enhanced their creative work. There is a lot of artist‐talk, and I found myself switching my brain to a more creative mode as I read along.

There are a lot more neat projects that need to be done, especially in workshops where young people can channel their enthusiasm and creativity. I am trying to hint that Emily should think about developing a program like this, though I know it is easy to volunteer someone else for more work. Reading Gibb’s thesis sparks the imagination, and I continue to look forward to seeing the next application that some tinkerer comes up with.

Why it rules being an engineer

I’m told that I had a fascination with stop lights when I was little, watching them intently from my car seat in the back of our yellow Vista Cruiser station wagon. My dad decided that I should have one of my own, so he somehow obtained an old decommissioned unit from the Illinois highway department. I have no idea how exactly this was arranged, and I have purposely never asked to hear that specific story. I guess the transaction was legitimate, since there are plenty of stop lights for sale on eBay.  I have a very sketchy memory of backing the car up to a warehouse early on a grey Saturday and returning home with a beat up 100 lb stop light in the trunk. This was a very long time ago, so this memory could even be a fabrication. I also have vague memories of my dad in the basement refurbishing and painting it, fabricating shrouds to replace the mismatched, broken, and missing ones, and replacing broken lenses.

It has always been a goal of mine to give it an upgrade. There were any number of things that could be done, whether turning it into some kind of game, automating it, putting it on a timer, replacing the individual pushbutton switches with something fancier… this was a big project just waiting to happen and begging to have something done to it.

At some point last year I happened to learn about a project someone did, and it provided a spark of inspiration. This person had modified his Rancilio Silvia espresso machine, the same model we have, outfitting it with an LCD display, microcontroller that automated the brewing process and precisely controlled the boiler temperature, all controlled from a repurposed Wii Nunchuck. This was the project that led me to discover the Arduino community.

(I’d love to do the same thing to our espresso machine, but I don’t want to become the kind of person who requires my espresso to be brewed precisely at 196 degrees and at a pressure of 8 bars, and so forth. But it sure would be fun project to take on!)

On a more personal level, learning about other people’s Arduino projects assured me that this was the time to fix up that stop light and start having some fun! I learned about a handful of outfits on the web that cater to hobbyists and found some great arcade‐style buttons, missile switches, and distance sensors, as well as a source for fabricating single copies of printed circuit boards. My dad, who originally indulged this whole stop light thing three decades ago, gave me an Arduino board for my last birthday, and so restarted the snowball.

After some initial tinkering with the Arduino to learn about how it all works, it was time to build a printed circuit board that would interface between the Arduino microcontroller and the stop light. I produced a schematic and PCB layout in Altium Designer, which is admittedly overkill, but if the tool is available, why not use it?

After an agonizingly long wait for BatchPCB to return the bare board (as they say, cheap and fast do not go together), I assembled the board and tweaked the microcontroller code that flashed the lights in sequence. The relays make a satisfying clicking sound when switching.

Currently, the controller implements six modes.

  1. The sequence mode turns the two sets of lights in a timed pattern, just as if at a regular intersection. The dwell time of each state is not currently programmable, but it will be eventually.
  2. A random flashing mode
  3. A railroad crossing mode that alternately flashes the left and right red lights
  4. A manual mode that is controlled via my MacBook’s serial console through the Arduino’s USB port. What’s the next logical step, a web interface? Emily will be thrilled!
  5. A parking mode that turns the lights from green to yellow to red as either of our two cars approaches its parking spot in the garage. The ultrasonic distance sensors are sensitive to about half an inch, and the current code allows the thresholds to be saved. Soon the cars can be parked farther back in the garage so as to maximize available space in the front of the garage. The parking mode is entered when the garage door is opened, tripping a magnetic switch attached to the garage door frame. No more hanging tennis balls from the ceiling!

Inspired by a “busy box” that my grandfather built out of dangerous old light bulbs, switches, buzzers, and motors, the brains of the stop light controller are visible through a Lexan cover. Connections to the button box, sensors, and indoor garage door open indicator are all color coded cat‐5 cables. There’s still more work yet to do, but it’s exciting to see progress on a project that has been 30 years in the making. Who knows, perhaps this old stop light was the toy that predisposed me to become an engineer?