|
|
fun with Arduino Saturday, September 23 2006
Gretchen went off to the local synagogue this morning to ring in the Jewish New Year, a festivity completely lacking in champagne, confetti, and the kissing of random strangers. This year, though, it actually coincided with a real planetary milestone: the Autumnal Equinox. (Further along this line, I think it would make more sense if January began on the Winter Solstice. The adjustment, perhaps carried out over the course of several decades without leap days, would be painless.)
While I was working on cleaning up some clunky PHP code, four friends from Brooklyn randomly showed up unannounced. They were Linda (Nancy's sister) and her husband Adam, along with their friends David and Michelle. (The latter two are the folks we routinely loan our car to while traveling overseas.) I always feel a little socially awkward around people I don't know extremely well, and the effect is intensified when I'm coming out of programming. Usually I can outsource the social effort to Gretchen, but she was gone. I tried offering drinks but nobody was interested so I gave them all a tour of the solar deck instead. I think it experienced a record of people on it at one time.
When Gretchen came home she acted like more of a proper host, and by now the majority was interested in drinking something, so two thirds of us had bloody marys, one of the two drinks that non-alcoholics enjoy when it's still too early to drink alcohol. (The other is mimosas.)
Of our guests, David turned out to be the biggest geek to visit us so far. He does various programming jobs, and he must be hardcore because he talked about how sometimes it's easier to go into the C++ source of Firefox to fix the browser than it is to fix your bombing Javascript. (Okay, I admit, this makes no sense: obviously the fix to your personal browser isn't going to help the poor sucker out on the internet, unless of course you contribute your fix back to Mozilla, they incorporate it in the latest release, and the poor sucker upgrades.) David had a little GPS gizmo that I'd love to use to map the Stick Trail. He brought it into the laboratory and we determined that we were at 41.93110 North, 74.10730 West. (You can drop coordinates like those directly into the search engine of Google Maps. Unfortunately, doing this yields useless results on MSN's Virtual Earth, which has the better satellite images.)
Meanwhile Gretchen had baked a wheel of challah bread, its circular shape a quasi-Buddhist Rosh Hashana tradition of Judaism, which tends to view history as more linear than cyclical. The bread, though somewhat undercooked, was so delicious that Gretchen had to sternly order me to stop eating it. It was good that she did because it continued expanding in our stomachs.
This evening I took delivery of a package of toys I'd ordered from Sparkfun.com. I'd learned about them from Make Magazine (the only magazine I receive regularly) because they're the American distributor of the Arduino microcontroller board. The Arduino, I learned, is a simple $30 controller board that can be attached through a USB cable to any computer (Mac, PC, Linux) and programmed in a simple C-style language. The software parts of the Arduino (the compiler, development environment, and computer interface) are all open source and are still early in development. I had a little trouble getting the development environment working on my computer, but once I had it running it was incredibly easy to write routines to control the pins of the Arduino, which includes six analog inputs, 13 digital outputs, and several digital outputs that can act as low-frequency analog outputs. I'd always been a little intimidated by the hassles of microcontrollers, particularly back when they required ultraviolet light to erase and high voltages and special sockets to program. The Arduino has none of these issues - you just hit its reset button and upload a new program and it begins executing it about ten seconds later. My plan is to use an Arduino to create a more intelligent controller system for my solar collector. With the Arduino, I could cover all the possible scenarios, including several not currently addressed:
- When to stop circulating hydronic fluid after the collected reservoir is very hot (though not as hot as is allowed) but the sun has begun to sink or clouds have moved in, meaning that the hydronic fluid has begun to cool
- When to not bother circulating hydronic fluid because it is probably too cold to flow
- How long to wait between pump cycles when supplying hot water to an extremely needy heat sink
I could also use it to report temperature data back to a computer, where it could be logged and analyzed for further improvements in the various algorithms.
With its macroscopic well-labeled pins and modest needs, the Arduino reminds me of the early days of personal computers, when someone could write routines in BASIC and then solder wires to buses to control real world objects. Of course, the Arduino is a bit more advanced than the full-scale computers of my teenage years. Its ATMega8 processor executes instructions at a brisk 16 MIP/S, four times the speed of a Mac Classic II. Though the Arduino only has 8 kilobytes of on-chip program space, I'm reminded that I wrote a complicated character editor for a VIC-20 that could do many Photoshop-type things to a monochrome 8 pixel by 8 pixel grid, but it only used 3K of space. My solar panel algorithms will be far less complicated.
For linking purposes this article's URL is: http://asecular.com/blog.php?060923 feedback previous | next |