Wednesday, December 14, 2011

New Job & Life Downtown

Today marks my first month at my new job. I recently made a career change, moving from a high-level software support role into a software development role. I am now working in an applications development team at a large law firm in downtown Minneapolis. Thus far the job is going very well. I'm enjoying the work, and getting to know my new team. I gained some great experience and worked with some great people at my last job, but I'm looking forward to new challenges and opportunities going forward in my new role.

Probably the biggest change I've experienced is the change in the environment, going from a small office in an industrial district to a high-rise in the middle of downtown Minneapolis.

Parking downtown can get expensive quickly, so I've been taking the bus to and from work. This has worked out very well, as the bus stop is less than 2 blocks from our house, so I don't have to drive anywhere, and drops me off a block from my building. Since we're fairly close to the freeway, it usually only takes 15 minutes each way. My employer lets me get a Metropass paid for with pre-tax dollars out of my paycheck, which is an added bonus. Overall this works out to be much cheaper than driving in, and best of all I don't have to worry about driving and traffic. This will be especially nice now, going into the winter months. I typically put on my headphones for the trip and relax with my podcasts & audiobooks on the iPod. Sometimes I almost wish I had a longer bus ride so I could really get into reading or watching something for more than 15 minutes. All things considered, I don't think my transit situation could have worked out much better.

The Minneapolis skyway system has been fun to explore as well. The more I explore the skyways on my lunch breaks, the more I can appreciate the 7-mile system of corridors connecting downtown. I'm still impressed with how busy the skyways get, seeing thousands of people milling about each day. I can find just about any restaurant or store I need, and I don't need to go outside. This means I don't have to put on warm clothes, wait for traffic lights, deal with the elements, or anything like that. I also find that I'm just walking more as a result, whether I'm running errands to Target or just going for a walk. It's nice to know that if I want to get away for my lunch break that I have more options than just going to eat in my car. When I leave the skyway system to go back to work, I zip up my elevator and head back to the office. I love the view of downtown from the high-rise.

So, the first month has gone well, and I'm looking forward to the months (and years?) to come!

Wednesday, December 7, 2011

Dad's Latest Cakes - Cross & Curious George

I thought I should take a moment to show off the latest cake creations of 2011 from Dad's cake shop. Partially because I'm proud of how they turned out, but also to show how simple they really were, and maybe help somebody else do the same.

Cross Cake

The first project was a basic cross-shaped cake for our youngest son's baptism. This was made from a basic 9x13 cake. The shape of the 9x13 pan lends itself well to this design. As shown in the pictures below, you can cut out the corners of the cake and they stack up to make a second layer of the cross. Essentially you make the cuts as if the cake were divided up into a 3 by 4 grid.

One thing I learned with this cake was the trouble of putting white frosting on a chocolate cake. Even though I froze the cake, I still had a large number of crumbs come off in the frosting process. I ended up having to chill and re-frost another layer to get a nice white exterior. This was also due to the fact that I used a cream cheese frosting, which is pretty thick. While tasty, the extra frosting was almost too thick for my taste. Overall the cake still got good reviews.

Curious George

Our older son loves Curious George, so when his 2nd birthday came around it was easy to pick a theme... Curious George! The cake design was inspired by ones I had seen through some Google image searches. The cake is made up of 2 round cakes stacked, and the ears were made by baking some cake batter in a muffin pan. The muffin was cut in half to produce each ear.

Frosting was done with some basic jar-frosting, using chocolate for the darker brown, and a mix of chocolate and white frosting for the lighter brown. The eyes were frosted with white frosting as well. I happened to have some black coloring, which I added to the chocolate frosting for piping the dark lines. Overall I was pleasantly surprised with how easily this one came together, and how good it turned out. Best of all, our son liked his Curious George cake, and our guests ate it up!

Saturday, November 5, 2011

and so ends the Summer of Tile

I'm happy to report that as of a few weeks ago the tile work is finally finished in our basement. After last summer's water damage we had to pull out the carpet and some of the sheetrock, and we left it open for the winter and spring to make sure we had the water issues taken care of. Lucky for us the new gutters and the landscape fixes worked. We did have a little water get pushed up through the floor after a heavy rainstorm, most likely as a result of all the clay around here and hydrostatic pressure. Since we can't completely rule out the possibility of water in the future, we figured tiling the entire basement was the best idea, labor intensive though it may be.

After 3 months of nights & weekends, 510 sq feet, and over 2000 pounds of tile, it's finally done.

To keep the basement from feeling too hard & cold, we found some simple carpet rugs to use in the family room. This helps keep the space comfortable, and makes it easy to take care of in the event we get water in there again. I'd say it turned out really well.

Here are a few progress photos taken along the way:

And here is the finished product. Nathan really loves all the new play space!

Saturday, August 20, 2011

Welcome Andrew James

Just wanted to take a moment to welcome my new son, Andrew James into the world - or at least the world of my blog. Andrew was born just over a week ago on Friday August 12th, 2011, at 6:59 pm. He weighed in at 7lbs 5oz and was 21 inches long. Overall he's very healthy and doing well in every aspect.

The past week has been a busy one, bouncing back and forth between the hospital for my wife & newborn son, and back home to spend time with Nathan and sleep in my own bed. We came home from the hospital on Sunday and introduced Nathan to his new little brother. Thanks in part to our work preparing Nathan for a new baby, he took to Andrew very well. Nathan loves to say hi to Andrew, urges his mother to "feed the baby" more often than necessary, and has been known to get upset if he can't see Andrew well enough from time to time.

Thus far Andrew has been a great baby. He rarely cries, only if he gets really hungry or needs a change, and he's been sleeping well at night between feedings. We thought we lucked out with Nathan being a good baby, and I think we lucked out even more with Andrew. I'm sure some of the ease is due to the fact that we've done this all before, and we're pretty easy-going parents. Either way, in the short week he's been with us, I think we've all adjusted to being a family of four fairly well.

I took two weeks vacation from work, and the first week has flown by already. One more week to go and we'll step back into real life. Although judging by our first week together, I think we'll be alright.

Now I'm looking forward to raising my two boys to be happy healthy and well-adjusted young men. Not sure yet how exactly I might accomplish that but I'll do my best, and if nothing else try to set a good example.

Friday, April 29, 2011

Fabrication brings TinyChuck5 to life

After some time spent re-acquainting myself with circuit board manufacturing and laser cutting, my "TinyChuck5" project is complete, looking more like a finished product than a breadboarded mess of wires. Here it is, happily blinking away:

At the time of my last post, I had finished my circuit board design and had some boards on order. The circuit boards were manufactured overseas through the Seeedstudio Fusion PCB service, great for small prototyping runs of small boards. Thankfully my design just barely fit within the 5cm x 5cm maximum size. To get 10 boards for only $20 is a steal, much cheaper than just one board through most other services. They also have a 10cm x 10cm option for $40. Despite the low price, the boards turned out quite well, the only drawback being the long lead time. They also added some identification/serial numbers to the silkscreen on each board to keep track of the order, but that's hardly anything to be concerned over. I also ended up with some additional boards, 12 in all, with 8 of them tested (they promise at least 50% testing, 100% costs extra). All in all a perfect service for the hobbyist engineer.

With boards in hand, I headed for the workbench to assemble my first prototype. After much soldering and clipping of leads, it was time for the ultimate test... would it work? Was my circuit board designed correctly? With the programmed chip pressed into its socket I hooked up power through a couple alligator clips and viola! It worked! Blinking lights! Not terribly exciting I know, but it was personal validation for the work and attention to detail I had put into my little trinket.

Next step was to give this little piece of electronics a proper enclosure. I wanted to have it set up on my desk and look nice & clean. While the exposed electronics look was interesting in its own right, I wanted to take it up a notch.

Years ago, I was fortunate enough to have access to a laser cutter/engraver in my high school's metal shop, and I was appointed to be the resident expert and operator of the machine. I learned a lot that year and had fun cutting and engraving all sorts of parts and materials. Having access to that kind of creativity-driven hardware was a lot of fun. So when it came time to make an enclosure for this project, I wanted to laser cut something. Thanks to their partnership with SparkFun Electronics, I found out about a company called Ponoko, an internet-based "digital manufacturing" service that creates parts from digital files. 2-dimensional designs can be cut from a variety of materials, and 3D designs can be turned into physical parts using 3D printing technologies. They make it easy and affordable. In college I also got to use the rapid prototyping machine to "print" 3D objects, but that's a different story. Needless to say I love the whole digital fabrication concept, and the creative freedom it enables.

For laser cut parts, I simply had to upload my design as an SVG file, and choose the material I wanted. I opted to do my design work in AutoCAD where I feel most comfortable, having made mechanical drawings in the software for four years at college. I saved my design to an AutoCAD R13 DXF format, imported it into Inkscape, placed it within Ponoko's design template, and sent the design off to Ponoko to be cut from 3mm thick white acrylic plastic. Some time later the parts arrived at my door, and it was back to the workbench.

One thing I noticed after assembling my first unit was that my LEDs didn't all line up perfectly in their 4 x 5 grid. The holes in the PCB were bigger than the LED leads, so each LED had some wiggle room. This resulted in a few LEDs that looked "off" from the rest of their respective rows. I had some space available on my Ponoko design, so I had them cut me a template for placing my LEDs. I cut holes for each LED just big enough to fit the lens, and included mounting holes that lined up with the circuit board. This let me place all 20 LEDs in a near-perfect grid and hold them solid while I soldered each one. The results look much better than my first attempt, with perfectly aligned rows & columns of lights.

With soldering complete, I began assembling the new enclosure:

Here's a view of the back of the unit. The back piece included cutouts for my power cord (a USB cable), and for a small T-shaped button I made for pressing the reset button inside on the circuit board.

And here again is the finished product. These days it sits on my desk at work, quietly blinking away, occasionally drawing me into a hypnotic zen-state, and serving as inspiration for my next more ambitious project.

Sunday, February 6, 2011

Diving into Microcontrollers - My Tiny Charlieplexed Display

Welcome! Thank you HackADay for publishing my project, and thanks for coming and reading :-)

For those of you who are used to reading about my usual exploits in cooking, fixing things, and family, be forewarned this post gets a bit long, technical, and geeky! :-)

I've been interested in electronics since I was a kid, and have always enjoyed experimenting, building, and learning something new along the way. With the growing popularity of microcontrollers in the hobbyist community, it's become easier to get started in what used to seem too complicated to approach in my spare time.

Since microcontrollers are essentially tiny computers in a chip, you can do much more than you would be able to do with a handful of passive electrical components, and making changes to your device usually only requires making changes to the software that runs on the chip. While I can write software on the computer to work with data, there's something more satisfying about being able to write software to control objects in the physical world like sensors, motors, lights, etc.

I've actually been picking away at this project for several months, in the limited time I have available to me as a parent of a 1-year-old. I'm intrigued by how much can be accomplished by some of the tiny chips available. I decided to start learning with something small, the ATTiny85, with a mere 8 pins to work with. I was also intrigued by what I had read about Charlieplexing LEDs. Basically controlling many LEDs with only a few pins. For simplicity, I wanted to avoid any extra hardware/chips for my first project. To see how much I could do with only a few pins, I decided to take the 5 output pins available to me and make a charlieplexed LED display. Technically I could have used 6 pins, but that would mean losing my ability to reprogram the chip easily. By wiring up my LEDs just right, I could control up to 20 LEDs with only 5 pins.

So I have a tiny chip driving 20 LED lights, but I have no source of input since I used up all my pins. I might as well try doing something interesting... random blinking isn't very intellectually stimulating. I decided I would make a small 4 by 5 grid which could run Conways Game of Life, a simple simulation of cellular life invented by a mathematician in 1970, and a simple programming exercise for me to learn to program my microcontroller in C. By turning on a set of random LEDs, you can let the "colony" evolve based on a set of rules, and see how long it lasts. Sometimes the colonies die off quickly, sometimes the right configuration will get into a loop and survive forever. It's a bit abstract, but interesting to watch.

Setting up the wiring was a bit tricky. I wanted 20 LEDs in a 4x5 grid, all aligned the same direction on the board, and had to run 5 wires to the 40 different connection points. I ended up running bus-lines for each wire on the top and bottom of the board. One side of the board would run to the positive side of each LED, and the other side to the negative leads. After some sketching I ended up with my basic concept for wiring the array and it ended up conceptually simpler than I had expected.

Next step was prototyping. I did some simple experiments with 2 or 3 pins and a breadboard to prove out the charlieplexing concept. Only one LED can be lit at a time. To do this, you have to set one side of the LED high on an output, set the other side to ground on an output, and set all other pins on the array to an input mode. Setting the others to inputs prevents current from flowing and thus keeps all the other LEDs dark. This was perhaps one of the more complicated prototypes I've built, since it involved so many jumper wires on the topside of the board, and such complex wiring in a tight space. I could handle it for 20 LEDs, but probably wouldn't have the patience for much more.

Programming was a new challenge in itself. I've written software in a variety of languages and knew enough to start playing around with some low-level C language with the help of other people's sample code. Getting the programming on the chip required some extra hardware. Awhile back I picked up the USBTinyISP AVR Programmer from Adafruit. The kit was easy to build and in the end I had a top-notch programmer for getting software into my chips. I downloaded the WinAVR development environment and got familiar with it, and after much reviewing of datasheets and other people's software posted online, I started to get simple programs running on my ATTiny85. One big drawback was in-system programming. The AVR chips allow you to program the chip while it's plugged into the rest of your circuit. However, due to the wiring of my board, where basically every output pin is connected to every other with little in between... this interfered with the programming data. I could only get programming to work if I pulled the chip and put it in my dedicated programmer. Not a major issue, but a bit of a nuisance. This also meant I wouldn't be able to include a programming header on my final board design.

I actually started developing my Game of Life software while on vacation in northern Minnesota. I had the WinAVR software working on my laptop, had my prototype hardware built and working, and with this vacation I had plenty of pockets of free time where I wasn't responsible for doing anything in particular. I developed some routines for lighting specific LEDs, storing the current grid, calculating the next generation, and did a little "software PWM" to make it look like the LEDs were fading in and out. I'm sure there are dozens of ways my code could be improved/optimized, but as a first project I'm pretty proud of what came out of it.

As I am always learning, and willing to learn from others, I've posted my code & schematic as an open-source project on GitHub:
I just installed Git and just signed up for GitHub, so hopefully I did it right! But my files are there, so that's a good sign.

Detecting when to reset the simulation was an interesting programming exercise as well. The simple ways didn't take much effort. If the next generation has all lights out (dead), then reset. If the next generation matches the current one (steady state) then reset. Detecting a loop was a bit more complex. I didn't want my device to get into a loop and stay there until the power was reset. I didn't have the memory to store an endless record of previous grids to compare to. So, at a certain interval, I saved the grid, and subsequent generations would be compared to that past one. Once the software detected that it's next grid matched one we had seen before, it would know a loop had occurred, and would reset. But how often should I record the grid? How many generations back should I look? I wanted to know how long of a loop I could expect. Since I was only dealing with 20 LEDs, my grid could only display 1,048,575 (2^20) possible combinations of lights, relatively small for a computer to deal with. I wrote some software in VB.NET to run through every possible combination and see how each would play out in the Game of Life simulation. What I found was that about 8.13% of the possible combinations would loop in one way or another, and the longest loop I could expect was 18 generations. Based on this, I knew that if I looked at every 20th generation, I should be guaranteed to catch every possible loop eventually. If my grid were larger I'm sure it would get much harder to analyze every possible configuration, but this worked well for my small setup.

Here's how it looks running on the breadboard:

Now I could have stopped here, but there was more to learn, and after all, I like to make things. I wanted to turn this into a little trinket I could have running on my desk that looked nice & clean. It was time to tighten up the design and put it on a circuit board. Moving my project off the breadboard into a finished product is the perfect way to wrap it up. I haven't done any circuit board designing in about 7 or 8 years since I created my VU-Meter Kit back in 2003. I designed that in ExpressPCB, a proprietary software package, so this was the perfect excuse to teach myself Eagle CAD, with some help from the excellent tutorials at Sparkfun. Once I got rolling, Eagle turned out to be a nice piece of software, and was easy enough to use. Bringing my schematic to a board design was a smooth intuitive process. I arranged my LEDs into a tighter grid, and added some extra circuitry to regulate a 9v power supply to an even 5 volts, and added a reset button. The whole thing fit into a board just 1.95 inches square. Since my board was a charlieplexed LED display running off 5 pins of an ATTiny, I named the board design "TinyChuck5". In the future I can modify my software to do other things besides the Game of Life simulation.

Before committing my design to a board, I ran through some checks to make sure it would work, besides double-checking my traces in Eagle. I printed out my design on paper and taped to a piece of styrofoam, and proceeded to insert the components. This allowed me to make sure everything would physically fit, and that everything lined up properly. I then generated my gerber files for having the board manufactured. As a last check, I viewed the gerber files with ViewPlot, and discovered that my voltage regulator included a drill-hole that I wasn't aware of, which put a hole right through one of my traces. I didn't see this in Eagle, so was thankful I could catch it by reviewing the gerber files. I moved my trace to avoid this hole and the design was finished!

At the time of this writing I have a few boards on order. Once they arrive I can solder some together and make it look nice. I'd like to put my LEDs behind some semi-transparent white plastic. In the end I may have a useless blinking gadget, but at least I can say I created it from scratch, and I have the ability to make it do whatever I want. With the knowledge I've gained in this experience, I can move on to another more elaborate, more interesting project.

Monday, January 17, 2011

Inside Dad's Toy Workshop - Toy Repair and Creation

While my basement workbench has served many purposes from wine making to laptop repair, I periodically find myself at work in the basement on one of our son's toys.

Tonight I set out to repair a music-playing toy shaped like a star. Each point of the star is supposed to play sound or music, but one hasn't worked since we got it. Even though he's only one, he knows that button should work. So, as The Dad, I need to fix it! Not sure if it came from a garage sale or the thrift store. The offending item was a squeezable cloth item, so it could be tricky getting at the switch inside the plush part.

Fortunately this one wasn't too difficult to diagnose. After removing a few screws, I was able to test the working switches with my multimeter. This gave me a basis for comparison to the broken switch. While prodding around the problem showed itself... a broken wire. Oddly enough this seems to be a trend. I fixed a musical toy book some months ago which also had a broken wire. This one I was able to strip and solder back together. In a pinch the strands of CAT5 ethernet cable works well as a small gage wire. Thankfully my wife knows me well, and has brought home other non-working toys from garage sales, knowing that I'll enjoy working on them, and hopefully getting them to work. Lucky for me the last one was only dead due to some battery acid corrosion on one of the battery contacts. A little sanding & scraping and we have a nice electronic drum and Nathan loves it.

Speaking of things Nathan loves... he loves turning light switches on and off, and loudly exclaiming "ON!" when the lights come on. I headed to the hardware store a couple weeks ago with the goal of giving him a way to play with light switches where we don't always have to lift him up. What I ended up finding was a WireMold light switch and enclosure made for mounting to brick walls. It's a small enclosure that holds the light switch and has just enough room inside for a little more. I had considered a normal electrical junction box, but the switch plate sticks out far and this presents a number of sharp edges. Not so kid-friendly. I drilled out a hole in the switch plate for a light. The light was purchased from Radio Shack as a 12 volt automotive indicator light, but I only bought it for the nice plastic lens which snaps easily into a 1/2" hole. I tore out the bulb and wired in a blue LED, a resistor for limiting current, and hooked it up to 2 AAA batteries in a battery enclosure I had in my bin of electronics supplies. Normally I wouldn't call so much attention to something as simple as wiring up an LED to a switch, but the application as a kids toy made it more fun.

With the enclosure snapped together, the electronics soldered up, and the switchplate screwed on tight, it was done! Nathan loves his personal light switch. I have some ideas for a better design if I could custom-manufacture the toy, but for now it works well and he enjoys it, so that's what matters.