12. Output devices

Assignment

Individual assignment: Add an output device to a microcontroller board you’ve designed, and program it to do something.

Group assignment: Measure the power consumption of an output device.

Simple Arduino audio samples

simple playback of less than 4 second, low-bitrate (8 KHz) audio samples from Arduino using only a speaker. It’s based on the PCMAudio code by Michael Smith.

Component needed:

  1. An Arduino Uno
  2. A speaker with wires soldered to it.(I broke an unused toy to get one)
  3. The Arduino software
  4. BC547 transistor

as showing in the picture bellow.

Editing Audio

Audacity is an easy-to-use, multi-track audio editor and recorder. Audacity is used in this assignment to reduce audio record size by decreasing bit rate and sample rate. After having my voice recorded in mp3 I followed the steps in the picture bellow.

  1. Open the Mp3 file
  2. Formate 16 bit PCM

  1. Project rate 8000 Hz
  2. Trim to reduce size

5. Finally Export as Mp3

Arduino software PCM

Arduino software. From File > Examples > PCM, I opened the playback example, with the board connected. I Uploaded the example to Arduino board, and it played “Arduino Duemilanove”.

(incase you don’t have the example, you could download it from Sketch > Include Library > library manager > type “PCM”)

To convert the Mp3 audio record file to numeric values, I used the EncodeAudio application. This is a simple Processing program that reads an audio file and copies its audio data to the clipboard in numeric form. Lunch the EncodeAudio application guide it the mp3 file and it will copy audio data to the clipboard.

then paste and replaced the example.

PCMAudio

Results

Audio Translation : welcome to Fablab