Pulse Sensor and noise interference from LED strip

Hi pylon

thanks for the reply.

Here's a link to the code that controls the LED strip: GitHub - pololu/pololu-led-strip-arduino: Arduino library for addressable RGB LED strips from Pololu

and to the sensor code A_PulseSensor_06: Google Code Archive - Long-term storage for Google Code Project Hosting.

The LedStrip is connected to pin 12 on the Arduino and the sensor is connected to Analog pin 5. The interrupt handling
for the sensor is included in setup(), otherwise its all library code. The call to write the Led Strip (I'm only using 5 LEDs)
is done in the subroutine testLedStrip().

Here's the relevant bits from my code:

void setup(void)
{

  // this next bit will wind up in the library. it initializes Timer1 to throw an interrupt every 1mS.
  TCCR1A = 0x00; // DISABLE OUTPUTS AND BREAK PWM ON DIGITAL PINS 9 & 10
  TCCR1B = 0x11; // GO INTO 'PHASE AND FREQUENCY CORRECT' MODE, NO PRESCALER
  TCCR1C = 0x00; // DON'T FORCE COMPARE
  TIMSK1 = 0x01; // ENABLE OVERFLOW INTERRUPT (TOIE1)
  ICR1 = 8000;   // TRIGGER TIMER INTERRUPT EVERY 1mS  
  sei();         // MAKE SURE GLOBAL INTERRUPTS ARE ENABLED

...
...
...

}


void loop(void)
{

...
...
...

  delay(5000);                              
  
  testLedStrip();                      // test strip
}



void testLedStrip()
{
  rgb_color clearLed = {0,0,0};               
  rgb_color greenLed = {0,0,100};             
  rgb_color colors[5];

  for(int x = 0; x < 3; x++)           // drive all Leds 3 times with short delay
  {
    for(int y = 0; y < 5; y++)         // set all Leds to Green
    { 
      colors[y] = greenLed; 
    }
    ledStrip.write(colors, 5);  
    delay(200);
    
    for(int y = 0; y < 5; y++)         // set all Leds to Clear
    {
      colors[y] = clearLed; 
    }
    ledStrip.write(colors, 5);  
    delay(200);
  }
}

I can paste the library code here too if needed.

thanks again, Caleb