I love microcontrollers
Saturday, June 15 2013
For the past several days Gretchen had been making a fancy wedding cake and today she drove it down to the City, where it would be devoured by the attendees at a vegan lesbian wedding. Gretchen ended up spending the night down there, and I did my usual solo thing, including a recreational dose of pseudoephedrine, which I took relatively late in the afternoon (it was probably the reason I stayed up until 3am doing little except drinking wine and instant messaging with Sara Poiron).
This afternoon I took delivery of devices designed to satisfy two ends of my interest in microcontrollers. One of these was a programmer allowing me to easily flash AT Tiny microcontrollers from within the Arduino development environment. I also got a couple AT Tinys to experiment with. They're little eight-pin devices that can do the very small-scale projects that don't require more than six pins of input and output. One good project would be a TV-B-Gone. Being so small, they would make it possible to shrink down even a handmade device to something that could live on keychain. AT Tinies can also be the basis of simple USB projects. As a proof of concept, I uploaded an LED flashing program to an AT Tiny and it worked perfectly. Usually a project that simple is handled by a 555 timer (I've made that circuit), but an AT Tiny is almost as cheap, doesn't require any support electronics at all, and could theoretically drive six different LEDs pulsing in completely different phases.
The other device I received comes from the other extreme of microcontrollers. It was Model B Raspberry Pi, a complete 700 MHz computer that costs about $40, fits on a credit-card-sized board, and boots off from an SD card. It has a bare minimum of frills (for example, no real time clock or SATA connectors), but it does have an ethernet port, two USB ports, HDMI video, and video electronics capable of producing high definition video. It also has arrays of pins that can easily be controlled by software similar to the way pins are driven on an Arduino. The difference, of course, is that a Raspberry Pi can boot a Linux installation and run as fast as a computer from 1999 (but with better video). An Arduino will never be much more than a dongle at the end of some sort of serial cable. I've had to do some work to make it possible to reflash and interrogate my Arduino-based solar controller across a serial link, but if the controller were based on a Raspberry Pi, I could just ssh in and type Linuxy things like sudo apt-get install. Admittedly, an Arduino uses a lot less power, but at two-to-five watts, a Raspberry Pi's power requirements are nothing like those of even a modern netbook. Arduinos still make sense for simple projects that don't require connectivity, but some fun projects (like remote autonomous probes) can't be done any other way. Until I delved into the Raspberry Pi today, I had no clear way forward for implementing computers that easily interacted with their environments. It's possible to have computers with attached Arduinos doing things, but the effort involved in getting a computer to autonomously control an Arduino has always seemed overwhelming. In the world of Raspberry Pi, it's all done with Python modules. Now all I have to do is overcome my habit of terminating each line of code with a semicolon.
It didn't take long to get the Raspberry Pi booting, communicating over WiFi (the basis for any remotely-operated probe), and interfacing with a webcam. Just getting such a small computer to work with a webcam is a huge upgrade from struggles I've had using laptops to FTP webcam photos (for remote monitoring and assembling stop-action sequences). More recently I've had better luck using IP-webcams for such purposes, but the quality of those cameras hasn't been good and I've wanted better-quality images. It's looking like the Raspberry Pi attached to a good webcam is a cheap low-power solution to that problem.
Another project I worked on today was the woodcart project that I began last winter and soon abandoned. The idea behind that project was to build a whole new woodcart by welding together bits of stock metal and scrap. First, though, I tried to fix my old woodcart, the one I'd bought on Harbor Freight and that had actually served me well over the course of several modifications and fixes since early 2008. But its metal didn't seem to want to be welded; it kept falling apart when I hit it with the arc. I eventually I just gave up and turned my attention to the new cart, which I made out of thicker steel usually having L-shaped cross-sections.
I eventually got the cart to the point where I wanted to try a maiden voyage. I took it to the place at edge of the Greenhouses' field, where I started salvaging a downed tree back in the Spring of 2012. Most of that wood has been retrieved, but there were still a few pieces, so I loaded up the new cart and started pulling. Right away I saw that some metal I'd left sticking out on the side was running into things, so I knew I'd have to cut that off. Also, the frame of the cart was flexing badly, which I knew would eventually break the welds. I'd have to add some more struts and cross members. Furthermore, the clearance on this new cart was lower and its wheels set further apart than the old cart, and while this made it impossible to pull through much of the Greenhouses' boulder-strewn field, it made it much easier to pull anywhere I'd made any minimal attempts to set up a trail. It also balanced more comfortably, suggesting I'll be able to pull heavier loads.
This evening I went on something of a television-watching marathon, though eventually I tired of it and went back to my computer. As always when Gretchen is away, I drank way too much.
A fly I saw on the laboratory deck. Click for a wider view.
For linking purposes this article's URL is:feedback
previous | next