Pulse sensor + LilyPad Arduino 328

Hi everyone,

I’m trying to set up an e-textil project involving a PulseSensor (http://pulsesensor.com/) and a lilypad. My problem is the following :

The pulse sensor gives its best output when powered at 3.3v and when analogReference(EXTERNAL) is enabled.

The problem is that I can’t figure out how to use the aref pin on the lilypad. It seems to be somewhere when you look at the schematics, but it’s linked to other pins so if any one of you guys would clarify the situation regarding that issue, it would be wonderful !

I tried using the pulsesensor at 5v. It works (not as well, but it could be enough) except that when I power it externally (AAA battery) vs from usb, it doesn’t anymore. My guess is that :

  • when powered from usb, the sensor receives precisely 5.05V.

  • when powered from battery, it receives 4.90/4.95V.

Since in that case the analog reference is internal, my guess is that it is set to 5v and that’s why it doesn’t work when I’m running at 4.90.

I’m new to electronics and arduino so please excuse me if I misunderstood everything about how to get it working smiley-wink

link to the project : http://www.twitter.com/LetHitBeat

amatelin:
The pulse sensor gives its best output when powered at 3.3v and when analogReference(EXTERNAL) is enabled. The problem is that I can’t figure out how to use the aref pin on the lilypad. It seems to be somewhere when you look at the schematics, but it’s linked to other pins so if any one of you guys would clarify the situation regarding that issue, it would be wonderful !

The Aref on a LP 328 mainboard is tied to the LP supply voltage so there's no functional difference btw the default INTERNAL and EXTERNAL settings. I'll guess it's the same on the LP simple board.

https://www.sparkfun.com/products/9266

amatelin:
I tried using the pulsesensor at 5v. It works (not as well, but it could be enough) except that when I power it externally (AAA battery) vs from usb, it doesn’t anymore. My guess is that :

  • when powered from usb, the sensor receives precisely 5.05V.

  • when powered from battery, it receives 4.90/4.95V.

Since in that case the analog reference is internal, my guess is that it is set to 5v and that’s why it doesn’t work when I’m running at 4.90.

When the Aref is INTERNAL it means that 1023 ADC counts = the supply voltage, whatever it may be. I find it near impossible to believe 4.9v vs 5.05v could make or break the machine. They do mention tweaking 2 pots to get the LED output correct and gain.

http://pulsesensor.myshopify.com/pages/open-hardware

The only thing left to say about the electronics, on this inaugural version, is that it is optimized for both 5V and 3V. The circuit can be tuned by changing R1 & R3. R1 determines how much current goes to the LED, and R3 is the load resistor on the APDS output. To optimize for 5V, use higher R1 and higher R3 (R1:1K, R3:22K). For best results at 3V tweak the other way. 470 is as low as I have gone with R1. The super-brightness of the LED will saturate the sensor at higher currents, and it does get warm even when it’s running at 20mA. Better to stay cool.

I note that the code shown here has the setting of Aref commented out.

http://pulsesensor.myshopify.com/pages/ … ino-v1dot1

The do say …

note2: Check out section 17. ‘8-bit Timer/Counter2 with PWM and Asynchronous Operation’ in the ATmega328 datasheet: http://www.atmel.com/Images/doc8161.pdf. The sample rate we use is mentioned most in our research. Use of Timer2 has the least conflicts with libraries and shields, That’s why we picked it. If you are using a FIO or Lilypad other Arduino that runs on 8MHz (instead of 16MHz), adjust the interruptSetup so that TCCR2B = 0x05.