I've got a project that uses an arduino powered by an external battery pack. I'm currently using a key switch wired between the arduino and the battery to turn the arduino on and off. The purpose of the key switch is to prevent other users of my arduino powered device from turning off the device themselves, while making it quick and easy for me to turn the device on and off.
While the key switches works, it is quite pricey and bulky. I was wondering if there might be some better alternatives to a key switch. I was thinking of a reed switch, but then that would require the magnet to attached to the device while in use (and can be easily removed by the user).
I'm essentially trying to create an easily accessible on/off switch that can only be controlled by me. Any ideas would be much appreciated.
That unfortunately wouldn't work because the reader itself would need power. I'm essentially looking for a physical switch that will connect and disconnect the arduino to power, that can't be used by anyone else.
Maybe a mosfet-based latching power circuit like THIS? A small momentary push button turns on the mosfet, which provides power to the Arduino and the rest of the circuitry. An output pin of the Arduino is used to keep the mosfet on after you release the push button.
When the user first actuates the push button and the power turns on, they need to enter a password into a keypad, or scan an RFID card, or whatever.
If they don't enter the correct password after a specified period of time, the Arduino will be programmed to turn itself off, through turning off the mosfet. The Arduino is also turning off any other components that would otherwise drain the battery.
Once you do enter in the correct password, and your project is doing its thing, you can program it in a way so only you can turn off the circuit. For example, you can only turn the circuit off, if you enter in the password again. Any additional presses of the power button can be ignored.
Once the mosfet is off, there can be practically zero power draw on the battery, except for tiny leakage currents, and the natural self-discharge of the battery itself.
Thank you very much! This is above and beyond the type of idea I was looking for. I really like that it can be programmed to power off automatically. I didn't even consider this an option for my project, but it would work very nicely for my needs. Now I have to go look for that mosfet that I'm sure is lying around somewhere.
Invert the logic of the mag reed switch so that it only enables when the magnet is present. You can wear a bracelet or watch or ring with a hidden magnet so it only allows access when you rest your hand on the magic spot.