Tag Archives: library

Mozzi creates complex sounds for Arduino



Doarhan recently kicked off a project with the Mozzi library to create a wide range of complex sounds for Atmel-based Arduino boards – which are typically tasked with generating only simple tones.

Aside from an Atmel-powered Arduino board and the Mozzi library, key project components include:

  • 100K potentiometers – x5
  • Male headers
  • Female headers
  • 1/8″ audio jack
  • Audio cable
  • Speaker

“Currently your Arduino can only beep like a microwave oven. Mozzi brings your Arduino to life by allowing it to produce much more complex and interesting growls, sweeps and chorusing atmospherics,” Doarhan explained in a detailed Instructables post.

“These sounds can be quickly and easily constructed from familiar synthesis units like oscillators, delays, filters and envelopes. You can use Mozzi to generate algorithmic music for an installation or performance, or make interactive sonifications of sensors, on a small, modular and super cheap Arduino, without the need for additional shields, message passing or external synths.”

On the hardware side, Doarhan recommends Makers begin by configuring the potentiometers.

“The middle output of the potentiometer is always the analog output. The other two outputs on the left and right are either power (5V) or ground. Solder your red, black and white wires on to the potentiometers,” Doarhan instructed.

“Solder the male headers to the ends of each wire. This will make it easier to put it together on the Arduino afterwards. The reason that I did not solder the wires on a proto shield is to make it removable so it can be replaced with a different kind of input like sensors.”

Next up? Getting your audio jack and soldering a white wire to one of the positive outputs, then soldering the black wire to the negative output. Then, configure the female headers, connect all the pieces, link the audio and upload/run the Arduino sketch.

Interested in learning more? You can check out the project’s official Instructables page here.

This SD card logger library fits on an ATmega8

David Gironi has designed an SD card logger library – with log rotation – that neatly fits on an ATmega8 microcontroller (MCU). Precise date and time are obtained via a DS1307 chip.

“This library implements an SD card data logger that runs on [an] ATmega,” Gironi explained in a recent blog post.

“It has a small footprint, so it can be loaded on an ATmega8, leaving space for user code; [while also] supporting SD and microSD cards formatted with FAT16.”

According to Gironi, the “Petit FAT File System Module” by ChaN is used to facilitate write capabilities to the SD card.

“We had to format the card we would like to use with FAT16 and then load it with a predefined number of empty files of a know dimension,” Gironi continued.

“Once we have files on the card, we can write on those files. You can create empty files by using the python helper provided in code.”

Configuring file dimension and number is executed on the firmware side, although the file dimension cannot be greater than 2^16 bytes as a uint16_t type variable is used to store this information. Similarly, the max number of files is limited to 256, because a uint8_t variable is employed.

“Given the number of files used by the logger and every file size, we just have to record the last written position and the file number we are using to implements the log rotation,” added Gironi. “When a file is filled up with logged data, it skips to the next one, if the file is the last one, we go back to first.”

Interested in learning more? You can check out the project on David Gironi’s official page here.