Introduction: CuckooTankard: a New Approach on Beerable Computing
Build Night time in the Fablab Aachen. We got a bunch of Spark IO boards and Spark Buttons - and if we made a cool project with ist, we might even keep it. So what to do? I decided to build an improved beer mug - adding the functionality of a cuckoo clock with the power of the spark board.
It could be use also as a clock if you tend to loose track of time on e.g. an octoberfest, with the eleven leds as clock and the cuckoo classic for tick every hour.
(And as an expended version later: You can add a compass module and gps to your spark board below your beer mug, so if you are too drunk to find your car for driving home, your tankard can show you the way, with the leds pointing in the right direction :-)
... or you might do something useful with the board...
Anyways. Since the spark board allows easy access to WLan, the plan was to add a world-wide prost function to the tankard: If someone lifts his tankard straight upwards, a signal is send to all followers all over the world to cheer (which means lifting up the tankard and moving it forward in a certain time). Then, a cuckoo will hammer against the mug as feedback for succesfully cheering.
Technical, I use the accelerometer on the Spark board for the movement detection, the buttons on the lower side are used for checking, if the mug stands on the table (pressing the buttons together) and the led ring is used for enlighten the beer in different colors. Addditional a servo from the spark maker kit is used to move the bird, which is enligthend with 6 3mm leds: Two of them enlighten the chest (red) and the wings (blue). The other four form a cross as eyes, which allows additional feedback for the state of the bird: a successful cheer will produce an "happy" eye ^^, while waiting for a cheer will give the upper two leds as feedback `´ `´, and if the cheering is not happening in time, the bird will hang backwards with dead eyes xx.
The housing is made with lasercutted 3mm acrylic, but since it is not very complicated, e.g. cutting with a fretsaw will also work (In fact, because of lack of time some adaptions are made with a proxxon saw & drills).
Step 1: Make the Leds Smaller...
After making first size tests with cardboard the standard 3mm leds seems to be to big for the eyes. Therefore i made each led a little bit smaller by sandpapering two opposite sides (parallel to the two wires - one of them coming later out of the front, the other on the backside of the acrylic) and sharpened the top of the led to a triangle. Each led is than wrapped into black isolation sticky tape for removing cross talk between each led (otherwise one active led will enlight the passive ones, which makes showing different forms impossible). After insertion in the acrylic the tape on the top and bottom side is removed with a cutter.
That was the first point which worked not very well for the first try-out. Should be done better in the next version, but one-night-project, no time for reworking (Nice excuse for bad craftmanship :-)
Step 2: Lasercutting...
Ok that was straigt forward: Just cutting the layouts with the laser cutter of the lab. No problem. The parts are than assembled with plastic glue. Just mount the servo before assembling, otherwise it will be much harder (That was already late at night, therefore i choosed the other way).
The bird is a free Vector-Clipart, slightly modified (removed legs and tail, etc.), use one that looks nice. Add cutouts for eyes and maybe the chest and wing led. I think it might even look better if there are some kind of photorealistic engravings better, lighting up with the led. Another point for more time and future work.
Template for the leds are (now) attached.
Step 3: Electronics...
Ok, no really good pictures here, but it was quite easy: Two rows of pinheaders (i used bent ones, but straight ones shouldn't be a problem) Connectors are inserted i n the female plugs on the spark button board (Well designed, by the way, the only disadvantage of this board is the missing 12th led - just my opinion). The two wires from an 3*AAA battery back are the soldered to VIN and Gnd, the servo also to this two pins and to A0 as control line, the leds are soldered to together to GND on the other side of the spark board and then - with a 150 Ohm resistor on the connector - Upper eye (two leds parallel) to D6, Lower eye to D5 (again two leds parallel), the front led (chest) to D0 and the back led (wing) to D7. Or some other way around, just need to change the pins in the program corresponding.
The front and back led's are always on at the moment, might also be connected to VCC, but since some pins are still free no need to sacrifice future possibilities.
Step 4: Next Ugly Fix: Hot Glue and Saw
At the beginning i just wanted to mount the bird ont the servo with a thin wire through the 3 holes in the servo arm (which should act as some kind of leg). First problem was that the wings of the bird were to long and touched the ground - after a little rework with the saw the bird was smaller and the problem fixed. The next problem was that the above mentioned wire connection was not strong enough - the bird could break himself free. Good for the bird, but not for me. A buch of hot glue fixed that - for a future version screws or at least a transparent glue would be better.
Step 5: Claim a Core Upload Program...
... Time was running out, so no Cheernet. Instead you can only cheer yourself at the moment. Of coursem, that's kind of sad. But at least it is running...
Until a better version comes out, the code is in the attached file. Just copy that into a new Spark app, add the SparkButton and ElapsedMillis1 library to the app (and remove the additional automatic added #include "elapsedMillis1/elapsedMillis1.h" and #include "SparkButton/SparkButton.h")
Upload the code to your Spark core. Then check if the bird moves in the right positions (otherwise change the myservo.write(xx); values).
If everything seems to work as expected tape the spark board at the bottom and the tankard on the top. And start cheering yourself... until the battery runs out. Should have added a power switch and make the battery back accessible from the outside without removing the mug. Not such a big problem, since the tape can be easily removed (which is also necessary for cleaning the mug), but would be nicer.
Anyways: Cheers & Have fun.