Difference between revisions of "Miffy surprise"
Line 25: | Line 25: | ||
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. | 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 === | === Disclaimer === | ||
− | Basically, I don't have time nor mood to answer/respond_to | + | Basically, I don't have time nor mood to answer/respond_to time-wasting /useless comments. E.g... |
* code is not perfect, ... | * code is not perfect, ... | ||
* note-frequencies are not perfect, ... | * note-frequencies are not perfect, ... | ||
Line 36: | Line 38: | ||
* electronics are crude, and may hurt the delicate designer's feelings. | * 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 | + | So there. Really, I'm a nice guy, but really, get off my back. But constructive comments are of course always [[User:Michai|welcome]]! :-) |
+ | |||
+ | Oh, and [[CBA]] to make a schematics. It's so very simple - all relevant things are explained in normal English below, anyway. | ||
== Hardware == | == 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 [http://www.phy.mtu.edu/~suits/notefreqs.html|note-frequency table]. Since toggle-delays are in discrete steps, | ||
+ | |||
+ | === Light === | ||
+ | |||
+ | .. | ||
+ | |||
+ | === Power supply and control(s) === | ||
bla | bla | ||
== Cardboard-ware == | == Cardboard-ware == | ||
+ | |||
+ | === Fold-together box === | ||
+ | |||
+ | .. | ||
+ | |||
+ | === Other stuff === | ||
bla | bla | ||
== Painting, drilling, sandpapering etc == | == Painting, drilling, sandpapering etc == | ||
+ | |||
+ | === Spraypaint === | ||
+ | |||
+ | ... | ||
+ | |||
+ | === Sandpapering etc === | ||
bla | bla | ||
− | |||
== Conclusion == | == Conclusion == | ||
.. | .. |
Revision as of 14:44, 2 February 2009
Contents
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
..