Making a Research Prototype

Haiku UR#2 prototypes w. lanyards

The last round of user research for my project with Mozilla’s Connected Devices team threw up a ton of useful ideas and insights. We shuffled them around on a gazillion post-its and narrowed in eventually on a theme of communication - specifically simple, non-intrusive/non-interrupting ambient messages. We saw a recurring need for ways to say “I’m still here”, “I’m OK”, “I’m thinking of you”. I was reminded of the Goodnight Lamp - one of the first really nice IoT products I remember seeing.

We wanted to validate our thoughts, and dig a little deeper into this area, so we came up with another study, this time using a simple functional prototype. Not so much a product prototype, more a prop and a way to move away from the abstract and focus in on actual reactions when interacting with a thing. In this post I’ll go into some detail on what we built, how we went about it and what we learnt.

IoT Useless Box

A couple of weeks ago I wanted to look into Amazon’s IoT service and conceived a slightly less-dry “hello world” project I could build as a vehicle for this research. You have probably seen the “Useless Box” concept before - its simply a box with a switch on it. When you flip the switch, a flap opens in the box and some kind of finger comes out and switches it back. I wanted to build that, but IoT-enable it, using the MQTT broker to listen for the state change in the switch, and notify the servo-listener to kick into action and put the world back to rights.

Notes on Attiny85 and Arduino

While its fresh in my head, I jotted down some notes on some minor progress I made with a simple project I’m working on - my own take on the LED candle. I want to end up with a compact, battery powered/rechargable unit that will sit and flicker candle-ishly. Maybe I’ll write up the project in full, but here’s how I’ve finally got up and running programming the attiny85 microcontroller that is the brains of the thing:

USBAsp programmer, to flash the chip. It provides 3 pairs of pins and little jumpers to set:

  • “power” - i.e use the power provided via the programmer’s (the 5V via USB from my pc) to power the chip while we program it
  • “slow” - use the jumper for a slower clock speed (i.e 1mhz - which is how they ship IIRC) I had to remove it to program successfully once I’d set the fuse to run at 8mhz
  • “service” - is to do with programming the usbasp itself I think?

So the slightly fiddly but 100% reliable method I’m using is this:

  • insert the attiny85 into a socket on a the board I prepared with the 10pin headers wired up to the 8 pin socket
  • use 10pin ISP ribbon cable to connect usbasp to socket board. Eventually I’ll figure out how to do this in-circuit, but for now, moving the chip from the socket to my breadboard once programmed isnt so bad
  • Using Arduino 1.6.5 IDE, which now has a board manager. I got attiny boards package from, so in Arduino’s preferences, where it says additional Boards Manager URLs, I’ve added
    • Open the Boards Manager and it downloads that and its entries will now show up in Tools > Board menu.
    • Pick attiny from the boards submenu
    • Pick attiny85 from the processor submenu
    • Pick Clock 8Mhz (internal) from the clock submenu. Dont pick external clock unless you’ve got the right oscillator to hand otherwise you’ll render it unusable until you do
    • (Burn bootloader)
    • Flash the code to the chip with “upload” in arduino IDE.

In the code, bear in mind different clock speed from the bigger & faster chip the arduino uses, and calibrate delays/timing as necessary. In order to debug, I’m using SoftwareSerial library. The attiny85 must be running at 8+mhz for this to work. Basically wherever code says Serial., you do mySerial..

  • Connect physical pin 2 on attiny to rx on arduino board
  • Connect pin 3 on attiny to tx on arduino board
  • Connect ground pin 4 on attiny to arduino’s ground.
  • Connect vcc pin 8 on attiny to arduino’s 5v out.
  • Connect USB from arduino to pc, so we can monitor attiny’s Serial output in arduino’s serial monitor

Bear in mind v. limited space on attinys. Pick appropriate types for variables (e.g. use byte instead of int when you know the value will by <= 255.) Arduino’s String library and lots of its string functions & operators not available. Probably you could include it, but memory is at a premium. Mostly I was just using this for debugging anyhow, so once I figured out that my debug code was my problem, it was easy to work around.

Once code is working:

  • Remove the Serial stuff (i used preprocessor define/ifdefs to make it easy to flip all that stuff off).
  • Remove the rx/tx connection.
  • Wire up intended Vcc/ground (battery or whatever) to finally cut the cord and be free.

Soldering onto Plastic

LED soldering onto copper tape on plastic container lid

Backstory: I was thermoforming some more bits for my bottle light project and picked a clear plastic food container out of the recyling bin. I popped it into my jig and in the toaster oven at 250F for 5 minutes - which is normally enough to hit the glass transition point where it takes the new form. This one didn’t. I jacked up the heat a bit, and again. Even at over 300F it really wanted to spring back to its original form. It struck me that this was a solution for a different problem I’ve been mulling over. I want to create the little joule thief circuit I’m using for the bottle lights directly onto the cylinder structure. Or as near as possible. When I apply foil traces to the plastic and solder components to them, the heat badly melts and distorts that substrate. I had some limited success applying foil traces to heavy duty greenhouse tape and soldering components to that. But getting the tape off my work surface and transferring to the plastic structure bends it too much and the tape lifts in places and the solder joints are put under a lot of stress.

The new plastic is a polypropylene, and the container was marked as microwave and top-shelf dishwasher safe. As a quick experiment I put down copper traces to hook up a SMD resistor and LED. It worked great. I flux where the solder needs to flow on the tape, add a dab of solder, place the component and re-melt the solder to flow onto the contacts. I’m using a normal iron with chisel bit that I would use for through-hole soldering and there was no distortion. The quick video shows the result.

As I’m wanting to make each component - the battery holder and switch, the LED driver (joule thief), the LED string - modular, this should work out nicely. I can pre-shape a piece of the heat-safe plastic (at a higher temperature), apply copper foil traces and solder up the circuit (I think manually, I don’t expect reflow techniques to be practical here) and join it to the main cylinder structure with double-sided tape or a rivet/eyelet or some other adhesive.

Bottle light update

I’ve been working on variations of the Joule-Thief -based bottle lights I’ve been making. I made a couple using strip board for the through-hole components but its clunky. Better yet would be SMD components stuck directly onto the structure…

Small moments

As if to underline the already bleeding obvious, today my desk clutter hit the point of self-destruction when I exitted my chair and pulled the headphone cord with me. It snapped at the plug. Worse would have been to break the actual jack in the laptop (or maybe drag the laptop off the desk). It wasn’t a happy moment though.

I was undaunted. Radio Shack sold me a new plug, I scoffed at the assistant when he apologized that the only one he had required soldering, and set it aside at home for later.

Later, I snipped off the broken plug and explored it a little. There’s 3 wires in there - red, orange (uncoated?) and green. It was just possible to determine which had gone where, and the new plug was similar in form. Some fiddly work later, I had all 3 wires hooked into their little holes and ready for soldering. The paint/laquer seemed to be all that was insulting the wires (from each other), and I scraped some of that off. I started to sweat when the solder wouldnt take. The gold plated terminals loved it - the wire didnt. I dont think the result would get me a diploma anywhere, but after some more scuffing it took. Not quite in that nice flowing way where the wire sucks the solder onto it. But good enough.

I screwed the thing back together, and held my breath as I fired up iTunes and plugged the headphones back in. Sods Law (or Murphy’s Law in these parts) holds sway always at these moments: If It Can Go Wrong It Will. When did you ever lurch over-confidently into any project not really knowing what the hell you were doing and pull it off first time? Especially when there’s expensive equipment at stake. So I was pleasantly surprised when I got audio. My little grin got wider when I listened hard to a cd and discovered no hiss, no crackle or fuzz. A happy moment.

Then and only then did it occur to me to Google. First hit: How to Replace a Headphone Plug. Always RTFM - preferably before - but if its already worked you get the added bonus that it will actually make sense, and maybe pick up a couple of tips for next time.

Sun Chimes

I’ve been really getting into BEAM robotics.. most of the examples I’ve seen are mobile edge-finding / line-following / light-seeking critters. This is a whole nuther species - a solar activated chime - a very sweet idea.

Here’s one I made and sent over to my brother in Hawaii:

Human Power

It’s another project I’ll put on the end of a very long list. Last year I picked up a stationary excercise bike to this end - it has a stable frame and a built in fly wheel that I thought might get me part way there. Of course, efficiency is not a design concern for these machines - they are supposed to make you work - so who knows. I purged my project list and put it back out on big trash day unfortunately. Another time.

My plan was to power a lathe with a simple belt drive, and maybe put an arbor on there for things like sanding, buffing, grinding. I still like that plan.