Trip to home depot to get various odds and ends to see what I can mash together.
Lots of bolts, a form for a concrete lolly column, and some metal bits.
PI has the default installation of rasbian, added mpg321, ipython, and emacs to it.
Prototyping:
First I'm trying to get all of the various ideas to work in a coherent manner, get
the PI making noise and controlling a single stepper motor.
Stepper Motor Testing/Setup:
POC code written to drive the stepper motor from my rasberry pi here: steppertest.py
I've also wired up the audio amp and speaker to my rasberry pi, it managed to work first
shot which surprised me.
Sounds:
Next, I searched for various steam engine mp3s (focussing on the Union Pacific Big Boy which is what my son really wants). Downloaded several and trimmed some effects (chuff, bell, whistle) and converted those to mp3.
Audio Configuration of PI:
With help from http://iwearshorts.com/blog/raspberry-pi-setting-up-your-audio/
I found a set of low power routines which let me reduce power usage down to ~5ua when not running the LEDs and about 8ma when using them.
Caveats:
1) hacking a basic circuit board like I did is somewhat a recipe for pain. One likely would do well using fritzing and making their own logic board up. I didn't do this, and somewhat regret not having done so.
2) the attiny85 is insanely durable. After burning off a pad during assembly (price of having a 5 year old help) and then doing a godawful job fixing things up, I later managed to inadvertantly put my programmer on it backwards which heated the processor up enough to desolder it from the board causing it to land and melt into my tablecloth. Oopsie! Worse, it bent/broke a leg, fortunately the cpu still worked (really), I had to build a solder bridge to cover for the broken leg on pin0, otherwise no apparent harm.
A) Solder the attiny85 to your circuit board. It is a lot easier to program it with a test clip after it is mounted. If you are test oriented, have a breadboard ready for testing.
I then drilled a set of holes into the circuit board to wrap wire around to act as a strain reliever to keep wire pulling from harming solder joints. Very useful if you aren't very good at soldering small stuff.
Here is my board after soldering the power switch and attiny85:
B) Prepare the circuit board for power.
You want to run positive power from one side of the slide switch to Vcc (pin 8)
Run a lead from pin 4 (GND) out to the edge. You'll then want to connect that pad via the two 220ohm resistors (in parallel!) or single 110ohm resister (if you have that), to another set of pads (I ran around most of the outside) to have a place to land the cathode leads from the LEDs. I hoped that a single pair of resistors would probably be able to move enough power to cover all LEDs on at once. This worked, likely one resister would be sufficient, too.
C) Program and test the attiny85 make sure that it is doing what you want. I have it blink through all of the pins in sequence on startup so that it is easy to debug loose/failed connections.
This is my board hooked up to my prototype via a debug clip:
D) Next, solder about 6-8" of wire to both legs of each LED. This is a bit of a pita.
E) Glue each LED into the center of a flower.
I used a hot glue gun, dipped the back of the LED into hot glue, then landed it into the flower and held it in place using electronics tweezers. This worked really well. Make sure that you have a way to distinguish the anode from the cathode. This will help later on.
I chose to debug everything at this point by hooking it all together via a breadboard
ignore the DIP8 attiny85 on the breadboard, it is not in use.
F) Prepare the battery pack by glueing a 6-8" piece of wire to both positive and negative leads
G) Glue the battery pack into an appropriate gap in the headband.
H) Run all of the wires back to the circuit board.
I ran them through the drilled holes a few times so that strain wouldn't pull on the solder joints. Then solder the leads into place
here is my board after soldering the LED anodes into place, if you look in the lower left, you'll see the two resistors creating a ground bus for the LEDs across the left and top of the board.
Here is the board with all wires except the battery soldered in. I attached it to external power to test:
I) Verify that you've got the LEDs in the order you want.
I ended up with 0/1 swapped; The easy fix is to adjust the array defined in shira-headband.ino rather than resoldering. For 0/1 being swapped, the following diff adjusted the ordering: