Sound Generation

THIS week we experimented with output devices: getting our boards to act upon the outside world. In other words, allowing bits to interact with atoms.


Beginning with a 'hello world' design for a speaker (left), I laid out a circuit in Eagle with an added power LED and button.


The circuit uses the MISO pin to trigger current flow to the speaker through a useful, transistor-based switching component called a MOSFET.





Traces about to be milled on the Modela, with toolpaths generated by FabModules (at fabmodules.org).


My final speaker output board.


Here is the code used to generate sequences of tones. In the future, I would like to modify the code to play precise/known tones (for example, sounds of animals communicating, or simple voices), but this was difficult because of chip memory limitations and challenges with simple representation of tones in C.


Here, the video on the left shows oscilloscope readings from the speaker input illustrating how the code generates sound: extremely fast pulses (pulse-width modulation- PWM- size) effectively control power level delivered to the speaker. The intervals between on and off, semi-randomly selected, then produce a series of pseduo-random tones whose frequencies are related to the idea of bitshifting. Play dischordant sound at your own risk!

Next Project Coming Soon!