I am trying to use an ATTINY85/Ardunio Uno to turn an LED on and listen to a button input. I don't mind if the LED turns on when the button is used.

I am have found this thread from a couple of years ago however it doesn't seem to work at low voltage (3V) due ending up with floating pins due to the forward voltage of the LED. I was wondering if anyone had a soltion or if they could check to see if my solution would be suitable.

Many Thanks


simulate this circuit – Schematic created using CircuitLab


I think this is what you want...


simulate this circuit – Schematic created using CircuitLab

To check for button, set pin to INPUT and enable pullup. If pin is LOW, then the button is pushed.

To light LED, set pin to OUTPUT and LOW.

| improve this answer | |
  • Ah this is the one I tried to link, OP has been updated. The issue I am having with this one is the drop in voltage of the LED is 1.6V so it's causing it to float and go in-between input states. – Archie Nov 30 '18 at 12:04
  • @Archie why is it "floating in-between input states"? if you enable the pull-up, either the button is not pressed (and so the pin floats to 3.3V, even if the LED is not conducting anymore, since there is a pull-up) or it is pressed (and so it is capable of pulling low both the pull-up and the LED, and it goes to GND). Please note that the LED is put not in the same position as your circuit, but it is in the upper part, while the button is in the low part – frarugi87 Nov 30 '18 at 13:51
  • Ahh the internal pull ups were not enabled. Thank you very much. – Archie Nov 30 '18 at 14:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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