Miffy surprise

From Electriki
Revision as of 14:44, 2 February 2009 by Michai (talk | contribs)
Jump to navigationJump to search


Fig.1: real bunnies. Once upon a time (in a galaxy far, far away), Miffy emerged as the next evolutionary step out of these proto-rabbits.
Fig.2: Miffy.
Fig.3: "what is playing now" bush, front. While Miffy performs on stage, the viewers would surely like some indication of which song is currently playing. Hence, this bush; LEDs indicate 1 out of 3 'main' tunes, or an 'intermission'-tune.
Fig.4: "what is playing now" bush, back. Wiring is modest; 4 wires for 4 LEDs, with common kathode.
Fig.5: Coke. When time is a factor and sleep a luxury, Coke is vital.
Fig.6: lightshow-bush, front. Nice LED 'walklight' (what's this called in English?) is displayed here with a few different modes.
Fig.7: lightshow-bush, back. Wiring is slightly less boring, with 4 series-chains of 4 LEDs each.
Fig.8: the board. Not extremely interesting, is it: a relais, an MCU, a transistors for each of the 4 'walklight'-channels, a zener, and a few resistors.
Fig.9: a snug fit. Everything is designed genau wie die Profis as they say in France, to fold together into a box-shape. Electronics is hidden under the 'floor' on which Miffy stands.
Fig.10: action! So ok, victim opens/unfolds the box, presses button, and is amazed. Mission accomplished. Congratulations.

So... WTF?!

As a surprise-gift for some combined events (among which, a birthday), I thought it was fun to make something that involved electronics at least to a minimal extent. It was not until later that I found out that such a thing is called a music-box and is available in the stores - but ok, this would be a customised music-box.

Of course, why repare while you still have lots of time, while you could wait until deadlines become a factor, and stress yourself? This was no exception; 16 hours to go until I physically had to leave the house and catch bus/train/plane to deliver the result (whatever it would be), so let's go.

Disclaimer

Basically, I don't have time nor mood to answer/respond_to time-wasting /useless comments. E.g...

  • code is not perfect, ...
  • note-frequencies are not perfect, ...
  • my cardboard-skills suck a bit, and...
  • yes, the used tints of spraypaint are way off from what was intended, ...
  • it still smells of spraypaint even now, and of course...
  • electronics are crude, and may hurt the delicate designer's feelings.

So there. Really, I'm a nice guy, but really, get off my back. But constructive comments are of course always welcome! :-)

Oh, and CBA to make a schematics. It's so very simple - all relevant things are explained in normal English below, anyway.

Hardware

Faithful workhorse is Atmel ATtiny 2313 (2kb flash, 128 bytes RAM) with internal 8 MHz RC-oscillator. Its main task is to play some tunes in a row when a button is pressed, while performing a simple lightshow.

Sound

For sound I used literally what was closest at hand, namely a speaker from a PC within 50cm reach. I think it's connected to a digital out of the MCU, with a 220 ohm (or something) resistor in series. Even googled a bit as to make it nicer a bit, then decided to CBA and leave it at this.

Notes are played by using a timer (I think 8-bit) which toggles the corresponding output pin 'from hardware' (so, no ISR) on counter overflow or reaching TOP (I forgot which - who cares).

After (stupidly) 'trying' to come up with some nice note-frequencies, finally got smart and used an existing table. Since toggle-delays are in discrete steps,

Light

..

Power supply and control(s)

bla

Cardboard-ware

Fold-together box

..

Other stuff

bla

Painting, drilling, sandpapering etc

Spraypaint

...

Sandpapering etc

bla

Conclusion

..