1

I am learning about interrupts and one of the interrupt modes is LOW which triggers anytime the pin is a digital low.

Can someone tell me what voltage that is for an Arduino nano? I did a google search and it said a LOW can be anywhere from 0 to 2V.

I am making a project using a nano and I am powering it with batteries. It would be great if I could set up an interrupt to turn on an LED when the batteries were getting weak so I would know when to change them.

1
  • triggers anytime the pin is a digital low ... this is bad thinking ... it should be triggers anytime the pin transitions from high to low ... there is a vast difference between the two
    – jsotola
    Mar 22, 2021 at 18:01

1 Answer 1

2

It would be great if I could set up an interrupt to turn on an LED when the batteries were getting weak

That won't work. The thresholds for the pin registering LOW or HIGH depend on the supply voltage. Very roughly:

  • a pin in guaranteed to register LOW if its voltage is below ⅓ Vcc
  • it is guaranteed to register HIGH if it's above ⅔ Vcc
  • nothing is guaranteed between ⅓ and ⅔ of Vcc.

For the exact voltage levels, you should check the datasheet.

Note also that those are guaranteed levels. The actual thresholds are closer to ½ Vcc, with an hysteresis of roughly Vcc/10.

For detecting a low battery condition, you should use the ADC, combined with either a voltage divider on Vcc or the internal bandgap reference.

1
  • Thank you Edgar! I didn't think it would work the way I was wanting it to. That is why I reached out to you folks who are much smarter than I am. I appreciate you answering my question.
    – Joey Sams
    Mar 22, 2021 at 15:53

Your Answer

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

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