I have an Arduino Uno R3. I have a paddlewheel waterspeed sensor that I use on an ISR on pin 2. The power supply is approximately 8v stepped down to 4.92v with a circuit yanked from the phone charger. I have also tried this with the arduino 5v.

The pin returns the correct values with digitalRead(), so it's cycling between 1 and 0.

The ISR works fine on pin3. Why does it work on pin 3 and not pin 2 ISR?

void itest() {
    Serial.println( "test" );

void setup() {
    attachInterrupt(0, itest, FALLING);
  • Have you compared the disassembled code when using each pin? Commented Mar 31, 2014 at 1:21
  • Can you show us the code of the ISR and how you registered it?
    – jfpoilpret
    Commented Mar 31, 2014 at 5:19
  • Where do you set pinMode() of pin 2 to INPUT?
    – jfpoilpret
    Commented Mar 31, 2014 at 11:18
  • @jfpoilpret it doesn't need pinMode() and the ISR is hidden by the arduino code in the attachInterrupt
    – Lesto
    Commented Mar 31, 2014 at 19:48
  • I hope you haven't forgotten to change attachInterrupt(0,itest,FALLING); to attachinterrupt(1,itest,FALLING);
    – explorer
    Commented Apr 24, 2015 at 8:48

1 Answer 1


never use Serial inside an interrupt handler, increment a (volatile) variable and print it in the loop().

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.