I just came across a documentary series about… Japanese Video Game Music. And I think I’m in love.

This stuff really gets me going!

The T-Shirt is DONE.
I’ve hot glued an ear clip to the pulse sensor and it’s much more reliable than before. I can move my head around and it won’t pick up any noise or anything. The T-Shirt is DONE.
I’ve hot glued an ear clip to the pulse sensor and it’s much more reliable than before. I can move my head around and it won’t pick up any noise or anything. The T-Shirt is DONE.
I’ve hot glued an ear clip to the pulse sensor and it’s much more reliable than before. I can move my head around and it won’t pick up any noise or anything. The T-Shirt is DONE.
I’ve hot glued an ear clip to the pulse sensor and it’s much more reliable than before. I can move my head around and it won’t pick up any noise or anything.

The T-Shirt is DONE.

I’ve hot glued an ear clip to the pulse sensor and it’s much more reliable than before. I can move my head around and it won’t pick up any noise or anything.

Pulse Sensor on Adafruit GEMMA

For the T-Shirt I’m making, (link) I needed a way to measure someone’s pulse. The pulse sensor Adafruit sells has some example code that runs on a regular 5 volt Arduino, but GEMMA isn’t your everyday Arduino clone. It runs on an ATtiny85 (vs ATmega328) and has some limitations. It runs at a lower voltage and has less timers.

To get the timers working, this is what you need to do. Find the following code in Interrupt.ino:

void interruptSetup(){     
  // Initializes Timer2 to throw an interrupt every 2mS.
  TCCR2A = 0x02;     // DISABLE PWM ON DIGITAL PINS 3 AND 11, AND GO INTO CTC MODE
  TCCR2B = 0x06;     // DON'T FORCE COMPARE, 256 PRESCALER 
  OCR2A = 0X7C;      // SET THE TOP OF THE COUNT TO 124 FOR 500Hz SAMPLE RATE
  TIMSK2 = 0x02;     // ENABLE INTERRUPT ON MATCH BETWEEN TIMER2 AND OCR2A
  sei();             // MAKE SURE GLOBAL INTERRUPTS ARE ENABLED      
}

ISR(TIMER2_COMPA_vect){                         // triggered when Timer2 counts to 124

And replace it with this:

void interruptSetup()
{
	// Initializes Timer1 to throw an interrupt every 2mS.
	// The ATtiny85 datasheet (pages 89-92) really helped me out here - and lots of trial and error: http://www.atmel.com/images/atmel-2586-avr-8-bit-microcontroller-attiny25-attiny45-attiny85_datasheet.pdf
	TCCR1 = 0;
	TCCR1 |= _BV(CTC1);             //clear timer1 when it matches the value in OCR1C
	TCCR1 |= _BV(CS12) | _BV(CS11) | _BV(CS10);    //set prescaler to divide by 64 - 8MHz/64 = 125kHz frequency for each timer tick
	TIMSK |= _BV(OCIE1A);           //enable interrupt when OCR1A matches the timer value
	/**
	 * We can do some simple math here for timer calculations
	 * GOAL: We want a 2ms trigger, which in Hertz is 500Hz (1/2ms)
	 * What we have: 125khz timed clock (thanks to the 64 prescalar)
	 * 125khz/500Hz = 250, so we need to count from 1 to 250 (or 0 to 249) and then execute our interrupt service routine
	 */
	OCR1A = 249;                    //set the match value for interrupt - 125kHz/250 = 500Hz = 2ms (don't forget we start at a zero count, not 1)
	OCR1C = 249;                    //and the same match value to clear the timer - otherwise it will continue to count and overflow
	sei();             // MAKE SURE GLOBAL INTERRUPTS ARE ENABLED
}

ISR(TIMER1_COMPA_vect){                         // triggered when Timer1 counts to 254

With this, your timer should fire as expected. Here’s a link to the entire Interrupts.ino file.

I hope this helps anyone trying to port over the code to work with GEMMA. I didn’t go through everything you need to do to convert the code, but this was the biggest hiccup I encountered.

As an aside, another pain in the ass was figuring out that the input from pin 2 is read in through pin 1 via analogRead(1). I figured this out late.

If requested, I can write a post outlining the entire process. Good luck!

The heart monitor LED T-shirt is coming along!

The pulse sensor code uses interrupts that the Gemma doesn’t have. I’ll have to find another way… The heart monitor LED T-shirt is coming along!

The pulse sensor code uses interrupts that the Gemma doesn’t have. I’ll have to find another way…

The heart monitor LED T-shirt is coming along!

The pulse sensor code uses interrupts that the Gemma doesn’t have. I’ll have to find another way…

Heart Rate T-Shirt
Here are some sketches showing what I had in mind for the heart rate monitor t-shirt with heart shaped LEDs that pulse.
I learned from my last wearables project that having conductive thread showing on the outside of your clothes makes it look kinda messy, so this time I plan to make it clean. The idea here is to assemble all the components on a separate piece of fabric and attach it to the underside of the t-shirt so that you can’t actually see the components when it’s off and not blinking. When it’s on, you should be able to see the light from behind the fabric. It’s like a sandwich with the electronics in the middle.
Maker Faire here I come!
Get more info and buy your tickets for Las Vegas’ Mini Maker Faire at http://makerfairevegas.com/ Heart Rate T-Shirt
Here are some sketches showing what I had in mind for the heart rate monitor t-shirt with heart shaped LEDs that pulse.
I learned from my last wearables project that having conductive thread showing on the outside of your clothes makes it look kinda messy, so this time I plan to make it clean. The idea here is to assemble all the components on a separate piece of fabric and attach it to the underside of the t-shirt so that you can’t actually see the components when it’s off and not blinking. When it’s on, you should be able to see the light from behind the fabric. It’s like a sandwich with the electronics in the middle.
Maker Faire here I come!
Get more info and buy your tickets for Las Vegas’ Mini Maker Faire at http://makerfairevegas.com/

Heart Rate T-Shirt

Here are some sketches showing what I had in mind for the heart rate monitor t-shirt with heart shaped LEDs that pulse.

I learned from my last wearables project that having conductive thread showing on the outside of your clothes makes it look kinda messy, so this time I plan to make it clean. The idea here is to assemble all the components on a separate piece of fabric and attach it to the underside of the t-shirt so that you can’t actually see the components when it’s off and not blinking. When it’s on, you should be able to see the light from behind the fabric. It’s like a sandwich with the electronics in the middle.

Maker Faire here I come!

Get more info and buy your tickets for Las Vegas’ Mini Maker Faire at http://makerfairevegas.com/

Maker Fair is next week!

I need something to show! I gave away the LED hoodie and the vending machine is kinda large to bring.

I think I’ll make another wearables project!

How about a heart rate monitor t-shirt with heart shaped LEDs?

Get more info and buy your tickets for Las Vegas’ Mini Maker Faire at http://makerfairevegas.com/

Secret Project - LED Hoodie Sweatshirt

I’ve been working really hard at getting everything to work and now that is has, I’ve gone ahead and shown you what it looks like (on my last post)

But I wanted to show all the parts I missed before I forget. This isn’t a how-to, just more of a “what I did”.

My niece is turning 15 and I thought she needed a more sophisticated/advanced present this year. What better way to show off her uniqueness than with a walking light show? LEDs were a hit recently in New York fashion too, so this fit perfect.

Every step from beginning to operational:

Secret Project Update

We have light! It took me forever to sew in the NeoPixels but they finally work.

I’ll make another post later about the steps in between but for now, enjoy this video.