Tag Archives: Ladyada

Building a sound-reactive (Trinket) LED color organ

A color organ was a staple of the music scene in the 1970s, although the instrument can still be seen today at various concerts and select home theaters. The principle is relatively simple: flash colored lights in step with music or other sounds.

“Color organs sample sound and flash lights based either the sound intensity or frequency. The higher end units use analog or digital signal analysis to determine the sound energy in selective parts of the frequency spectrum and flash the lights accordingly,” Adafruit’s Mike Barela explained in a recently published tutorial.

“The Adafruit Ampli-Tie project, which uses [the Atmel-powered] Flora, has two different algorithms to light a string of Neopixel LEDs according to sound intensity. We will reuse much of the first Ampli-Tie algorithm’s code. The more complex algorithm uses a good deal of floating point math, which is too large to fit on a Trinket or Gemma.”

According to Barela, the simpler algorithm fits with room to spare, using integer math. The code is slightly modified to give the effect one may want in a color organ, although Makers can easily alter the code to produce other effects for their own projects.

To kick off the project, Barela recommends starting with a breadboard and subsequently transferring the circuit to a small perma-proto board when a permanent mount becomes more appropriate.

“You may solder the headers supplied with Trinket to facilitate breadboarding. A small three-pin header was placed on the microphone breakout board for breadboard connection,” he added.

“For a more permanent circuit, you could use a servo extension cable to extend the microphone or wire your own three wires from the microphone breakout to the Trinket, power and ground lines.”

As we’ve previously discussed on Bits & Pieces, Adafruit’s recently launched Trinket is a tiny microcontroller board built around Atmel’s ATtiny85.

“We wanted to design a microcontroller board that was small enough to fit into any project – and low cost enough to use without hesitation,” said Adafruit’s Limor Fried (aka LadyAda). “[It is] perfect for when you don’t want to give up your expensive dev-board and you aren’t willing to take apart the project you worked so hard to design.”

Fried describes the Attiny85 as a “fun processor,” because despite being so small, it boasts 8K of flash and 5 I/O pins – including analog inputs and PWM ‘analog’ outputs.

Want to learn more about building a sound-reactive LED color organ using the Atmel-powered Trinket? You can check out Adafruit’s detailed tutorial here. Additional information about the Atmel-powered Flora is available here.

Adafruit’s Gemma has Atmel under the hood

Adafruit has debuted Gemma, a tiny wearable platform board packed in a 1″ diameter package. The device – powered by Atmel’s versatile Attiny85 – is easily programmable with an Arduino IDE over USB.

“We wanted to design a microcontroller board that was small enough to fit into any project, and low cost enough to use without hesitation,” Adafruit’s Limor Fried (aka LadyAda) explained in a recent blog post. “Gemma is perfect for when you don’t want to give up your Flora and aren’t willing to take apart the project you worked so hard to design. It’s our lowest-cost sewable controller!”

Fried described the Attiny85 as a “fun processor” because despite being so small, the device boasts 8K of flash and 5 I/O pins, including analog inputs and PWM ‘analog’ outputs.

“We designed a USB bootloader so you can plug it into any computer and reprogram it over a USB port just like an Arduino (it uses 2 of the 5 I/O pins, leaving you with 3),” Fried continued. “In fact we even made some simple modifications to the Arduino IDE so that it works like a mini-Flora. Perfect for small and simple projects – the Gemma will be your go-to wearable electronics platform.”

In addition to Atmel’s ATtiny85, key hardware specs include:

  • 1.1″ / 28mm diameter and 0.28″ / 7mm thick.
  • Easy-to-sew or solder pads for embedding in wearable projects.
  • 8K of flash, 512 byte of SRAM, 512 bytes of EEPROM.
  • Internal oscillator runs at 8MHz.
  • Ultra low power, only 9 mA while running.
  • USB bootloader with LED indicator programmable with the Arduino IDE
  • Mini-USB jack for power and/or USB uploading
  • Rugged and foolproof bootloader process
  • ~5.25K bytes available for use (2.75K taken for the bootloader)
  • On-board 3.3V or 5.0V power regulator with 150mA output capability and ultra-low dropout.
  • Up to 16V input, reverse-polarity protection, thermal and current-limit protection.
  • Power with either USB or external output (such as a battery) – it’ll automatically switch over
  • On-board green power LED and red pin #1 LED; reset button for entering the bootloader or restarting the program.
  • 3 GPIO – The 3 independent IO pins have 1 analog input and 2 PWM output as well.
  • Hardware I2C capability for breakout and sensor interfacing.

Interested in learning more about Adafruit’s Gemma? You can check out LadyAda’s detailed Gemma tutorial here.

Adafruit launches ATtiny85-powered Trinket

Adafruit has launched the Trinket, a tiny microcontroller board built around Atmel’s ATtiny85.

“We wanted to design a microcontroller board that was small enough to fit into any project – and low cost enough to use without hesitation,” Adafruit’s Limor Fried (aka LadyAda) explained.

“[It is] perfect for when you don’t want to give up your expensive dev-board and you aren’t willing to take apart the project you worked so hard to design.”

Fried describes the Attiny85 as a “fun processor,” because despite being so small, it boasts 8K of flash and 5 I/O pins – including analog inputs and PWM ‘analog’ outputs.

“We designed a USB bootloader so you can plug it into any computer and reprogram it over a USB port just like an Arduino,” Fried continued. “In fact we even made some simple modifications to the Arduino IDE so that it works like a mini-Arduino board. You can’t stack a big shield on it but for many small and simple projects the Trinket will be your go-to platform.”

There are currently two versions of the Trinket: 3V and 5V. According to LadyAda, both work the same but have different operating logic voltages.

“Use the 3V one to interface with sensors and devices that need 3V logic, or when you want to power it off of a LiPo battery. The 3V version should only run at 8 MHz. Use the 5V one for sensors and components that can use or require 5V logic, [as] the 5V can run at 8 MHz or at 16MHz by setting the software-set clock frequency,” she added.

Key specs include:

  • ATtiny85 on-board, 8K of flash, 512 byte of SRAM, 512 bytes of EEPROM.
  • Internal oscillator runs at 8MHz, but can be doubled in software for 16MH.z
  • USB bootloader with a nice LED indicator looks just like a USBtinyISP and can be programmed with AVRdude (with a simple config modification) and/or the Arduino IDE (with a few simple config modifications).
  • Mini-USB jack for power and/or USB uploading.
  • On-board 3.3V or 5.0V power regulator with 150mA output capability and ultra-low dropout.
  • Up to 16V input, reverse-polarity protection, thermal and current-limit protection.
  • Power with either USB or external output (such as a battery) – it’ll automatically switch over.
  • On-board green power LED and red pin #1 LED.
  • Reset button for entering the bootloader or restarting the program. No need to unplug/replug the board for reset or update.
  • 5 GPIO – two shared with the USB interface. The three independent IO pins have one analog input and two PWM output as well. The two shared IO pins have two more analog inputs and one more PWM output.
  • Hardware I2C / SPI capability for breakout & sensor interfacing.
  • Mounting holes.

The Trinket can be purchased here for $7.95 here, while an extensive guided tour is available here.