Showing posts with label sound waveform. Show all posts
Showing posts with label sound waveform. Show all posts

Tuesday, June 4, 2013

motion-detector frog

frog RJH bought me a motion-detector frog* (yes, you read that right) the other day, at the dollar store (yes, believe it or not there are a large number of motion-detector frogs there) to cheer me up. See, this is a pretty demented, simple, electronic product, and its existence and unexpected availabilty amuses me. I mean, who knew there was a demand for motion-detector frogs? He didn't seem very sensitive and at first did not ribbit until poked (the frog that is, not RJH). He was happily sitting, silently in my studio, until he decided that my every tiny move was cause to ribbit. So, I decided to place him outside to scare squirrels from my herb garden. Sadly, he's now responding to every tiny breeze and I think I had better go move him before he drives the neighbours mad.

*Not exactly as illustrated. That's a actual, real-live frog I photographed in NB. The motion detector frog is sort of like that, except more plastic, and prone to sporadically playing a recorded ribbit.**

**'Ribbit' is a Canadian word for the sound made by a frog, used also as a verb. I recall hearing a CBC radio interview with the OED who had recently decided to include it in its new editions. Apparently, outside of Canada, frogs just croak, which is weird if you've ever listened to the wide array of frog song. Strangely it was also the name of our high school mascot.

Friday, March 30, 2012

Prototyping the Bumblebee



This is another project in progress. I love the idea of paper computing or paper electronics. I'm planning a print (à la Italian-speaking polar bear) which interacts with the viewer by making sound when approached. So I want the print itself to act as a (capacitative) sensor and a speaker. I've been sourcing electrically conductive paints and inks and even tried to make my own with graphite and block printing medium. I settled on Bare Paint which seemed the most user-friendly (though it is only available in black, I suspect because it's full of graphite). It's slightly tempermental as a block printing medium, but only slightly - which is great news as they never claimed it could do this. They have examples using it as a screenprinting medium, but usually screenprinting ink is less viscous. This 'paint' is quite thick and viscous so I'm really pleasantly surprised at how it performs in a block print. (They also produce an electrically conductive body paint so you can be a circuit and have blinkie LEDs shining on your skin, or your body can be a MIDI interface, if you so desire.) They even have a tutorial for how to make a capacitative sensor, which I followed. I combined their Arduino code (basically the CapSense library with slight tweaks) with some advice from Lady Ada's tutorial on using switches with Arduinos and Leah Buechley's Simple Arduino Audio Samples tutorial and the tutorial for paper speakers from the Kit-of-No-Parts by Hannah Perner-Wilson. There's no point in re-inventing the wheel, people. You'll have to turn your volume up to hear the buzzing, but it's there*. I believe the weird noise at the beginning, is because the start of the sample is being triggered repeatedly; I should be able to write better code to avoid that and go straight to the buzzing bumblebee.

As you can see, it worked in my demo, but it isn't yet very robust. Sometimes if I restart the Arduino it gets caught in a loop, constantly re-triggering the start of the sound sample. I plan to work on the code, and maybe play with the resistance accross the two pins to sense and receive the varying capacitance, and maybe add a small capacitor for stability. The other issue at the moment is power. I seem to be going through 9V batteries at an untenable rate**, so I hope to be able to switch to rechargeable AA batteries (and lowering the voltage, because no one want to deal with 6 batteries). Alternatively, I might get a 9V adaptor to power both the Arduino and the FET which switches the speaker on. That might be the way to go for the final product. Eventually, I'd like this to work with some very small parts; just the chip from the Arduino***, the FET, some resistors, maybe a capacitor, minimal wires or conductive thread or copper tape, a magnet, and power. I also need to find out if there is any difficulty having the sensor printed on one side of the sheet and the speaker on the other; after all, two conductors with paper sandwiched in between is by definition a capacitor so I wonder if I need any shielding or anything.

Also, I trained it to play the Ode to Joy (badly, from a musical perspective) employing the Tone function which outputs square waves at the frequency of notes. Now, don't you want to see what you could make your art do?

Note: If you're just here for pretty pictures and such and cannot make heads or tails of my descriptions of software or hardware, feel free to ask. I hope the above is comprehensible. If it isn't, feel free to let me know.

*thanks again Synap for the sound sample
**why don't they mark Amp-hours on these things?
***I think I'll have to use an ATMega chip, because the ATTiny only has 2K of memory and I don't think I can write a program and store 3 seconds of sound data in that little space.

Monday, March 19, 2012

Today I made a polar bear speak Italian

aurora detail It's true - though very briefly. I took one of my polar bear proofs and used copper tape to make a spiral on the back, following this tutorial for paper speakers from the Kit-of-No-Parts by Hannah Perner-Wilson. I hooked up the controlling circuit for high current loads with a digital pin on my new Arduino Uno microcontroller (ciruit design by Tom Igoe, shown below, though I ignored the potentiometer, so my simple speaker has no volume control... though I could add one - the speaker is connected where the motor would otherwise go). So the parts needed are: Arduino with power (I used USB connection to my laptop), some jumper wires, a transitor, an extra 9V battery, the print with its copper tape spiral and a magnet (I used the magnet from within an old junked harddrive, because this is both free and a very strong magnet). Then after trying some simple tones, and basic modifications to C programs which come as examples with the Arduino, I tried running Leah Buechley's Simple Arduino Audio Samples tutorial. It's a software solution which lets you play a 4 second sample, so long as it is only 8 kHz and mono - without adding anything else to your microcontroller. It comes with a sample of someone saying 'Arduino Uno' with a proper Italian accent. It is rather cool to hear the print itself vibrating to make the sound of an Italian woman speaking. Now, I know that some of the above may read as goobledegook to anyone unfamiliar with basic electronics or programming, however the point you should take away from this is that it is now very posible for anyone to buy some simple open source parts (for about $25 - $30), follow some on-line tutorials and make their 2D artwork itself produce sound! It is in fact posible to do this even if you do not understand the circuit or the software (though, I would encourage anyone to try to follow that too, as with most things, it's easier than you think).



The next step to make some prints which interact with the viewer (listener?) audibly! Thanks to Synap for helping me get some appropriate sound samples! There will be more of this to come (I cannot bring myself to say 'stay tuned' as it is just too corny a pun).