Tiny Arduino Music Visualizer



Similar documents
Adafruit MCP9808 Precision I2C Temperature Sensor Guide

Adafruit SHT31-D Temperature & Humidity Sensor Breakout

Adafruit BME280 Humidity + Barometric Pressure + Temperature Sensor Breakout

2.2" TFT Display. Created by Ladyada. Last updated on :15:09 PM EDT

DS1307 Real Time Clock Breakout Board Kit

Arduino Due Back. Warning: Unlike other Arduino boards, the Arduino Due board runs at 3.3V. The maximum. Overview

1.8" TFT Display Breakout and Shield

A REST API for Arduino & the CC3000 WiFi Chip

TSL2561 Luminosity Sensor

Arduino ADK Back. For information on using the board with the Android OS, see Google's ADK documentation.

QUICK START GUIDE FOR DEMONSTRATION CIRCUIT BIT DIFFERENTIAL ADC WITH I2C LTC2485 DESCRIPTION

PHYS 2P32 Project: MIDI for Arduino/ 8 Note Keyboard

SainSmart UNO R3 Starter Kit

Arduino Lesson 1. Blink

INTRODUCTION TO SERIAL ARM

PN532 NFC RFID Module User Guide

Arduino Lesson 16. Stepper Motors

Arduino Lab 1 - The Voltage Divider

Arduino Lesson 13. DC Motors. Created by Simon Monk

TEECES DOME LIGHTING SYSTEMS

Android Controlled Based Interface

User s Manual of Board Microcontroller ET-MEGA2560-ADK ET-MEGA2560-ADK

CAN-Bus Shield Hookup Guide

Arduino DUE + DAC MCP4922 (SPI)

Matrix and 7-Segment LED Backpack with the Raspberry Pi

Adalight Project Pack. Created by Phillip Burgess

ARDUINO SEVERINO SERIAL SINGLE SIDED VERSION 3 S3v3 (REVISION 2) USER MANUAL

DIY Pocket LED Gamer - Tiny Tetris!

Arduino Lesson 14. Servo Motors

Adafruit Si4713 FM Radio Transmitter with RDS/RDBS Support

Building a Basic Communication Network using XBee DigiMesh. Keywords: XBee, Networking, Zigbee, Digimesh, Mesh, Python, Smart Home

Wireless In-Ear Audio Monitor

Pololu DRV8835 Dual Motor Driver Shield for Arduino

Adafruit Music Maker Shield

Eric Mitchell April 2, 2012 Application Note: Control of a 180 Servo Motor with Arduino UNO Development Board

MCP4725 Digital to Analog Converter Hookup Guide

RN-52 Bluetooth Hookup Guide

AC-PG-USBASP USBASP AVR Programmer

Electrical Engineering Department College of Engineering California State University, Long Beach Long Beach, California, 90840

Controlling a Dot Matrix LED Display with a Microcontroller

The basic set up for your K2 to run PSK31 By Glenn Maclean WA7SPY

Arduino Lesson 0. Getting Started

Arduino Lesson 9. Sensing Light

Tutorial. replace them with cell-phone operated module. The advantages of a cell-phone operated bot are:-

How to program a Zumo Robot with Simulink

Battery Power for LED Pixels and Strips. Created by Phillip Burgess

An Introduction to MPLAB Integrated Development Environment

All About Arduino Libraries

Implementing a Digital Answering Machine with a High-Speed 8-Bit Microcontroller

Real Time Clock USB Evaluation Board V3.0

Data Acquisition Module with I2C interface «I2C-FLEXEL» User s Guide

POCKET SCOPE 2. The idea 2. Design criteria 3

AVer EVC. Quick Installa on Guide. Package Contents. 8. Mini Din 8 pin MIC Cable 9. HDMI Cable

C4DI Arduino tutorial 4 Things beginning with the letter i

FREQUENCY RESPONSE OF AN AUDIO AMPLIFIER

Web Site: Forums: forums.parallax.com Sales: Technical:

MixMeister EZ Converter Setup & Troubleshooting Contents:

Adafruit ATWINC1500 WiFi Breakout

1.5" & 2.1" Monochrome 128x64 OLED Display Module

Surveillance System Using Wireless Sensor Networks

Lab Experiment 1: The LPC 2148 Education Board

EARTH PEOPLE TECHNOLOGY SERIAL GRAPH TOOL FOR THE ARDUINO UNO USER MANUAL

LEN s.r.l. Via S. Andrea di Rovereto 33 c.s CHIAVARI (GE) Tel Fax mailto: len@len.it url: http//


THRUST CURVE LOGGER V-4.200

GSM Interfacing Board

PCAN-MicroMod Universal I/O Module with CAN Interface. User Manual. Document version ( )

Yun Shield Quick Start Guide VERSION: 1.0 Version Description Date 1.0 Release 2014-Jul-08 Yun Shield Quick Start Guide 1 / 14

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Electronic Circuits Spring 2007

Adafruit LSM9DS0 Accelerometer + Gyro + Magnetometer 9-DOF Breakouts

User Manual. Please read this manual carefully before using the Phoenix Octopus

2.3" Monochrome 128x32 OLED Display Module

Board also Supports MicroBridge

KTA-223 Arduino Compatible Relay Controller

Hardware Connections between Arduino and IMU Nori Wilkins Apr. 5, 2013

- 35mA Standby, mA Speaking pre-defined phrases with up to 1925 total characters.

UniPi technical documentation REV 1.1

Work with Arduino Hardware

1. SAFETY INFORMATION

Marantz PMD660 Digital Recorder Guide

Introduction. Getting familiar with chipkit Pi

Karaoke Circuit Building Instructions

2013 G Miller. 3 Axis Brushless Gimbal Controller Manual

Adafruit LED Backpacks

Getting started with the Super Brain Palm computer interface.

AVer EVC. Quick Installation Guide. Package Contents. 8. Mini Din 8 pin MIC Cable. 1. Main System. 9. HDMI Cable. 2. Camera. 10.

By: John W. Raffensperger, Jr. Revision: 0.1 Date: March 14, 2008

An Arduino Controlled GPS Corrected VFO

Adafruit Proto Shield for Arduino

Intro to Intel Galileo - IoT Apps GERARDO CARMONA

Quick Start Guide. Installing. Setting up the equipment

Accurate Measurement of the Mains Electricity Frequency

Arduino Lesson 17. Sending Movement Detector

Ingar Fredriksen AVR Applications Manager. Tromsø August 12, 2005

1 Coffee cooling : Part B : automated data acquisition

Using Computer Audio in Adobe Connect Meetings Metropolitan Community Churches Office of Leadership and Development

FlowKit in-circuit debug system

DAS202Tools v1.0.0 for DAS202 Operating Manual

COBRA. Audio Box Detailed User Guide

Transcription:

Tiny Arduino Music Visualizer Created by Phillip Burgess Last updated on 2014-04-17 09:30:35 PM EDT

Guide Contents Guide Contents Overview Wiring Code Troubleshooting Principle of Operation Ideas 2 3 4 7 7 7 9 Adafruit Industries https://learn.adafruit.com/piccolo Page 2 of 10

Overview (Music: The Owl Named Orion by Dan-O at DanoSongs.com) Here s an easy-to-build project that really packs a lot of blinkenlight for the effort: a little pocket-size music visualizer we call Piccolo. Set Piccolo next to the telly or some speakers and you ll see the lights respond to music and sound lowest notes toward the left end of the graph, highest notes toward the right. Technically this would be called a spectrum analyzer, but as this is not a precision scientific instrument, we re more comfortable labeling it a visualizer. It s strictly for show. This intermediate Arduino project shows a clear progression from input to processing and then output in a package that s appealing and easy for minds to grasp: music and lights. It s not abstract or science-y unless you choose to peel back the layers Adafruit Industries https://learn.adafruit.com/piccolo Page 3 of 10

Wiring Begin by assembling the LED matrix and backpack board as described in the Adafruit LED Backpacks tutorial (http://adafru.it/asp). If using the LED matrix for the first time, we very strongly recommend working through that full tutorial first. This will let you test and confirm that the Matrix is properly assembled before moving on to this more advanced project. If working with a breadboard as we show below, solder row headers on to the microphone breakout and LED matrix backpack boards (three pins on the former, four on the latter). You can optionally use 90 degree headers if you d like either component to be positioned standing up. Thanks to the smarts of the LED matrix backpack, this whole project requires fewer than a dozen connections total: Connect the Arduino s 3.3V pin both to the mic amp VCC pin and the Arduino s AREF pin. We use one of the power rails on the breadboard to route 3.3 Volts to both locations. The AREF connection is very important don t overlook this! Connect the Arduino 5V pin to the LED matrix + pin. Connect Arduino GND pin to both the mic amp GND pin and the LED matrix pin. You can use a breadboard power rail, or the Arduino has multiple GND pins available. Connect Arduino analog pin 0 to the mic amp OUT pin. Connect Arduino pins SDA and SCL to the matrix backpack D (data) and C (clock) pins, respectively. Earlier Arduino bo ards do n t include SDA and SCL pins instead, use analog pins 4 and 5. For a current R3 Arduino board (such as the Arduino Leonardo or more recent Arduino Uno and Mega boards), the wiring should resemble this: Adafruit Industries https://learn.adafruit.com/piccolo Page 4 of 10

If using a classic Arduino board an Arduino Uno version R1 or R2, Arduino Duemilanove or Diecimila (with 328P chip), the matrix data and clock lines should be connected to analog pins 4 and 5: Adafruit Industries https://learn.adafruit.com/piccolo Page 5 of 10

Piece of cake! You can power the Arduino from the USB connection or using a battery or power supply connected to the DC jack. The LED matrix draws a couple hundred milliamps at most, so we can safely power it through the Arduino. Adafruit Industries https://learn.adafruit.com/piccolo Page 6 of 10

Code Begin by downloading the Piccolo repository from Github (http://adafru.it/asq). Select the download ZIP button. Once this is finished, uncompress the resulting ZIP file on your hard drive. There will be two folders inside: Piccolo should be moved to your usual Arduino sketchbook folder. ffft should be moved into your Arduino Libraries folder (inside the sketchbook folder if it s not there, create one). If you re unfamiliar with installing Arduino libraries, please follow this tutorial (http://adafru.it/ayg). And never install in the Library fo lder adjacent to the Arduino application itself the proper location is always a subdirectory of your home folder! If you haven t already installed the Adafruit LED Backpack Library (http://adafru.it/ali) (for using the LED matrix), please download and install that as well. Once the folders and libraries are situated, restart the Arduino IDE, and the Piccolo sketch should be available from the File->Sketchbook menu. With the Piccolo sketch open, select your Arduino board type and serial port from the Tools menu. Then click the Upload button. After a moment, if all goes well, you ll see the message Done uploading. The project should now be responsive to sound try clapping your hands! Troubleshooting If there s no response from the device, try the following: Double-check all wiring against the diagrams. Did you include the 3.3V-to-AREF connection? D and C pins from the matrix backpack should connect to SDA and SCL on newer Arduinos, or analog pins 4 and 5 on older boards. Test the matrix using the example code from the Adafruit LED Backpack Library. If there s no response, the matrix may have been soldered to the board backwards. The gain on the mic amplifier may be set low. There s a dial on the back of the board that can be adjusted with a small screwdriver. Principle of Operation Using the normal Arduino analogread() function would be much too slow for sampling audio. Instead, a feature of the microcontroller s analog-to-digital converter called free-run mode is utilized. This automatically takes repeated analog samples at precise intervals about 9.6 KHz for this project, the maximum a 16 MHz Arduino can handle with 10-bit samples. The raw audio samples are converted into a frequency spectrum using a fast Fourier Adafruit Industries https://learn.adafruit.com/piccolo Page 7 of 10

transform (http://adafru.it/asr) or FFT. There are a number of Arduino FFT libraries out there, but we keep finding ourselves returning to the venerable ELM-ChaN ffft library (http://adafru.it/ass) for its speed and good looks. The FFT output still needs a bit of massaging to make for a good presentation on the limited 8x8 matrix. Several tables of scales and weights de-emphasize certain frequency ranges as they re reduced to just eight columns. The software works at keeping the graph interesting, but some columns will always be less lively than others, especially comparing live speech against music of varying genres. If everything seems to stick toward one end of the graph, try another musician, musical genre, or different speakers. Adafruit Industries https://learn.adafruit.com/piccolo Page 8 of 10

Ideas Our wiring diagrams illustrated this project with a half-size breadboard, but for a smaller package the parts can also fit on an Arduino breakout shield: Depending how you choose to orient the LED matrix, the matrix.setrotation() function can be used to keep the graph upright. Just a concept this is not functional but it s interesting to note that an Arduino Micro, the LED matrix and the microphone amplifier are almost perfectly matched to the dimensions of a 9 Volt battery: Adafruit Industries https://learn.adafruit.com/piccolo Page 9 of 10

If you do attempt an extra-compact build like this, please keep in mind that the Arduino Micro includes a 5 Volt regulator, allowing it to be powered from a 9 Volt battery. Most small formfactor Arduino-compatible boards do no t include a regulato r, and will be damaged if you attempt to power them directly from 9 Volts! For such boards, either add your own regulator to the circuit, or use an appropriate battery pack: three alkaline AA or AAA cells in series, or four rechargeable NiMH cells. Additionally, the code may need adjustments for some alternative Arduino boards most likely the analog channel number, which may be mapped to different pin numbers on different boards. Finally, because ADC registers are accessed directly, specific interrupts are used, and the FFT code is in AVR assembly language, this software will no t run on upscale boards like the Arduino Due, ChipKIT or Teensy 3.0. It is strictly for classic Arduinos. Adafruit Industries Last Updated: 2014-04-17 09:30:37 PM EDT Page 10 of 10