In the opening day Google I/O Keynote, Android announced numerous cool new products. I had the pleasure of introducing our new Movie Rental Service for Android Market, and we also talked about our new Music Beta service as well as the Accessory Development Kit for the first time. Combining devices with cloud services is a Chocolate & Peanut Butter experience – each benefits from the other to create a whole larger than the sum of their parts, so I wanted to try out the ADK and do a project that captures this. My buddy Joe hooked me up with an ADK board a week before I/O so I could play around with the ADK and I did a project that combines the coolness of devices and hardware with the awesome new Music Beta service.
First a little background on the ADK. The board that Google was handing out at I/O is based on Arduino and has a built-in Circuits@Home USB Host shield. The details can be found at the Android Open Accessory page at the Android Developer portal. A library is provided for the Arduino board that allows you to identify your device and very easily detect when an Android Device is connected to it and transfer data.
I already had a box of Sure Electronics LED matrices left over from Maker Faire last year. That plus some ShiftBrite RGB LEDs and the judicious application of a laser beam to build an acrylic enclosure was sufficient to get the basic sign up and running. It sported a two-line display (64×8 pixels each) driven by my LED Matrix Library and a Music Beta by Google logo backlit through a diffuser panel by 6 ShiftBrites.
Then I linked to the Android ADK library and it was literally just a few lines of code to detect a device connection and read some data. The other very cool feature of Android Open Accessory is you can provide a URL in your device description metadata. When a user plugs in their Android Phone, if there isn’t a compatible application for your device the user can follow the link to download the supporting application directly from Android Market. In my case, I needed a simple service application that listened to the Intents the Music App sends when it changes track metadata. Then, the app writes the metadata to the Arduino board. So the end-user experience is seamless – anyone can walk up to the sign and plug in their phone and be up and running in a few seconds.
Once I’ve decompressed from I/O a bit, I’ll publish the source code and CAD files so others can put one of these together. For now here’s a video of the Music Beta Now Playing accessory in action. The fun spectrum analyzer animation is just for effect – it’s not actually analyzing the audio, but maybe some clever person can make that part more real.
When I was younger I was a big fan of Peter Sellers in The Pink Panther as Chief Inspector Clouseau. One of my favorite running gags was his butler, Cato, who in addition to answering the phone and preparing meals was also responsible for attacking Clouseau without warning. These attacks were designed to keep Clouseau vigilant and in fighting shape, and there were many epic battles between them. Several decades later I’ve come to realize that I have my own personal Cato in the form of my cat. Our cat is sweet and loving with everyone else in the family, but with me her favorite thing to do is attack me when I least expect it. She will literally wait by the door for hours and when I come home she jumps at me with her back arched waiting to be chased around the house. Like Clouseau, I am responsible for my attacker’s behavior – having trained her to attack me with our games.
A Heartless Killing Machine
As a result, when I think of the cat I don’t think of a cuddly little pet but rather a vicious killing machine. My wife took a picture of her that captures the cold depths of the cat’s evil soul and I really like it. So I decided to make a big version of it to hang on the wall using my CNC router and some custom software I wrote.
The idea was to do a halftone-style picture by cutting circles of varying size in a panel of wood that would show through a black background. I modified my Paper Pixels software to take a picture of the cat and sample the average brightness in a grid pattern and then turn this into an array of circles. Large circles for dark areas (which thus show more of the black background) and small circles for light areas (which thus show the light birch wood I was planning to use). The picture on the left below is the original image I started with and the one on the right it the output after my software processed it.
We Love Constraints
My CNC router has a table size of 24” x 16” and I wanted the resulting picture to be larger than that. I was going for 3 feet square, so I chopped the picture up into 6s panels of different sizes that I would assemble to make the finished picture. I’ve spoken many times about the fact that constraints like these can be used to improve the result. So rather than try to hide the fact that I cut the image up I accented it by splitting the panels up with space between them. I used 1/4” thick birch plywood sheets and finished them with several coats of amber Shellac to give a nice warm color. Then I cut each panel out with the router, after producing toolpaths with CAM software. Some of the holes ended up with ragged edges depending on how worn the tool was but some light sanding fixed things up quickly.
Once all 6 panels were cut, I sprayed the back with tacky adhesive from the local art supply store and glued thick black posterboard to the back. I mounted the panels to the wall right above the bed where the cat sleeps. The result is a nice combination of a geometric/abstract form with a somewhat photographic effect the further away you get from it.
For my birthday last year I decided to get a new toy for my workshop – a laser cutter. I spent a fair amount of time researching various options and eventually decided on a 40 Watt CO2 laser. I purchased an inexpensive Chinese laser cutter from Full Spectrum Engineering. FSE imports them and then sells them from their US offices, which means you get to deal with a local US-based company. For just under $2K at the time you got a 40 Watt CO2 laser with approximately 12″ x 11″ cutting area. The specs have only improved since then. Mine also came with an upgraded controller card that allows the laser to be driven from Mach3 or other CNC control software.
My machine needed a bit of TLC after unpacking. The mirrors and laser lenses needed alignment, which I fixed using thermal imprint paper and a very low power setting to figure out where the laser was pointing at each point along the path. At times the answer was — pointed directly at my hands. Good times. This is pretty typical of these imported machines, but the good news is it’s quite straightforward to get them set up and working well.
Once I was done and got it running, I tried the included software and was horrified by what I saw. The circle I drew to test cut out of paper had jagged edges looking like it was at about 75 dpi resolution, which was much worse than the stated 1000dpi. It turns out the included software (NewlyDraw) is complete junk, and the machine is capable of much better results.
By switching out the controller card with the upgraded Mach3-compatible card and driving it with Mach3 I was able to get it running very accurately and smoothly. But there wasn’t a great solution for creating GCode files from CorelDraw or other vector art, so it was tedious to prepare cutting jobs for the laser.I ended up writing software to make this pretty seamless. My software takes an SVG file and converts it to GCode usable by Mach3. When I used it to test the same circles picture I did before the results were stunning. Everything was smooth and the steppers even sounded happier and less jerky being driven by Mach3. So you can edit directly in CorelDraw and then save as SVG and the LaserCAM software spits out GCode.
The pictures below show the software running and then the final results cut from 3mm white acrylic. The file as I edit it in CorelDraw is upright, but it shows up flipped vertically in the LaserCAM software because of how my Y-Axis is mapped on my laser cutter.
The software is available on my GitHub athttps://github.com/yergacheffe/lasercamand could be adapted for other brands of laser cutters. It’s still a far cry from the nice printer driver interface that an Epilog laser cutter provides, but at 1/10th the cost this is a pretty good alternative for the hobbyist.