Sunday, 6 January 2013

Vacation Lessons: Iterative isn't Always Good

As a dedicated fan of iterative development in software, I naturally try to apply this approach to other spheres. Lesson learned: iterative approach to real-world crafting leads to wasted time, materials and nerves. And the end result will still carry the marks of pain.

To be more specific, by iterative approach I mean a draft-review-refactor loop. And by crafting - working with soft metals and a bit of electronics.

So, the task was: Make a model traffic light using 3mm LEDs and Arduino to control them. The body should be made of brass. Excited by the simplicity of Arduino, I've added a bonus task: make the system modular by using a shift register IC in every light post and allow serial connection of them.

Designing is for schoolgirls, so after a short run-through in my head and a brass soldering test (I've never done it before), I started implementing.

The thing about real world, which really is obvious, but wasn't so for a guy that has started working on something he wanted for ages; the thing is that refactoring costs much more, and every iteration leaves a scar on the final product. It's not quite like shifting bytes in that programming thing of yours! What a revelation.

Well, if you're still with me, enjoy the graphical story:
1. Electronics prototype and a soldering test. Everything seemed nice and easy.

2. Body, alpha version. After soldering it completely shut, I discovered that one of the LEDs doesn't work. And the body wasn't designed to be serviceable. After cutting it open and seeing that a LED contact has just de-soldered, it was clear that the body should be made serviceable after assembly. Refactor!

3. Body, beta version (current state). It kinda holds straight, but the maintenance door at the back doesn't stand firmly in place.

4. Shift register IC. The initial idea was to do the breakout by myself ('cause it's fun!). After soldering 3 connections out of ~16, it became clear that it's going to be an ugly mess that will never work. So I had to get a ready-to-use breakout from Sparkfun. And then found out that they didn't provide a ground output header, so I had to add it separately at the back. Doesn't it look like code?

5. Tools used (forgot to add a drill to the composition).

So the lesson is: when you're dealing with physical stuff, you have design the whole thing first. Yes, it's boring, but then you'll have a chance of getting something done. Unlike me and my traffic light that has stuck on the beta stage.

No comments:

Post a Comment