I'm a total beginner, trying to find my way through basic electronics... I went over some written material and YouTube courses, but there is something I don't think I get right.
Consider my case - I have a microcontroller that can be sent to sleep mode and wake up externally by pulling a specific GPIO pin to GND. So far so good.
I want the device to sleep until it's moved (physically) by the user, and for that I have a cheap vibration switch (see this link). This switch is normally closed and a tiny spring inside opens the switch when it's being moved.
I basically want to create a circuit that will be normally pulled high, and when the device moves, the switch opens and it pulls it to GND.
I created this sketch, which I believe does what I want:
But IIUC, this also means that there is a constant current of 5mA in my case through the battery. I understand that I can play with the resistor value to lower this current, but what I can't figure out is why not using a 1000Mohm resistor or something like that (1Mohm resistors seem pretty cheap) to make the current completely negligible? I can only assume that at some level of resistance, it will basically be like cutting the wire, and in that case I understand why voltage won't drop to GND, but I seem to have some point if "irregularity" in the middle.. If it works with 1Kohm, why not 10K, anda then 100K, 1M and 10M? What causes it to stop working? Can I calculate this "max" value?
Another thing that bothers me - Do I need another resistor in the upper side of the circuit? What happens if I just connect 5V directly to a GPIO pin? Is there any current flowing?