Is this pull-up setup valid for At-tiny?

My circuit link: http://tinyurl.com/ya9vmgmz

I heard that input GPIO is unable to sense any input when the input current is too low.

Is there any documentation for me to refer to when setting up pull-ups?

I am making a magnetic reed switch door sensor and hope to support it with a 1300mA / 3.7V battery for 1 year.

An ATtiny - like most microcontrollers - is a CMOS device with input impedances in the order of hundreds of Megohms.

It has negligible steady-state input current but a small input capacitance which will require a small current to charge and discharge. This does not limit the design of input circuitry.

What does limit your design, is your ability to construct a device whose leakages across supposed insulating materials due to moisture and contamination, are orders of magnitude higher than the component (resistor) values you propose to use. :roll_eyes:

And to avoid picking up Electromagnetic Interference (EMI) radiated from the power wiring in your buildings and atmospheric static or that generated by your movements.

It will require testing and all the concerns brought up by Paul applies. I get that you want to restrict current to save battery life and it works in theory without real world interference and situations. It may work fine in some situations and then develop strange behavior in others but will be difficult to test all scenarios.

In your sim you can raise the values to 20Meg and it will work... but I wouldn’t do that in the actual circuit.

I heard that input GPIO is unable to sense any input when the input current is too low.

Either they were were wrong or you misheard.

Why are you simulating a rubbish circuit? Switches should be wired between the input pin and ground. Then a pull up resistor goes from the input pin to the processor's supply voltage.

As mentioned the higher the pull up resistor the more susceptible is the pin to picking up interference and giving you a false reading.

It is a compromise, you trade current you use when the actual button is being pushed with immunity from interference. When you are not pushing the button you get negligible current drawn and changing the resistor is not going to affect this.

In practice the internal pull up resistors of 30K are considered weak but will work in quite environments. A value of 10K is used if signals have to go off the board and 1K to 470R is used in hostile environments like a car.