I recently purchased an Arduino in order to learn more about electronics. I've done several of the tutorials and built a simple Simon-type game and am now thinking about what to do for my first attempt at a real project. At the moment I'm leaning toward making one of those "turn itself off" boxes, aka useless machines. I think I have a pretty good general idea of how to build one but I'm not sure how to keep it from shutting off as soon as it flips the switch and ending up sitting there with the lid open and the arm sticking out. I mean, I realize I could have it be always on and use the switch just to trigger the turn off behavior, but I'd like it to not drain it's battery when it's just waiting for someone to interact with it. I suspect there's some kind of electronically controlled switch that I could put in parallel with the physical one and have the Arduino close it when it first powers on, then open it when it's ready to shut down, but I don't yet have the experience to know what that would be. I guess I'd also need the physical switch to function as both an initial power on and a digital input.
Can anyone point me in the right direction? Either that or crush my dreams and explain why this is a bad idea?
The toggle is just a double-pole double-throw switch that will provide Forward or Reverse power to the motor.
When in the fully retracted position the arm pushes a Normally Closed button to interrupt power.
There is a diode across the Normally Closed button to allow current to flow in the Forward direction even when the button is pressed.
The human turns on Forward power which flows through the diode to the motor.
The motor moves the arm away from the NC switch, The switch closes, bypassing the diode.
The arm switches the toggle to Reverse. Power flows through the NC button.
The motor reverses and withdraws the arm till it hits the NC switch which cuts off Reverse power.
Both could be connected in series to the same power line.
When the switch on top is open the arm rests in the box on another switch that is also open.
Once you turn the switch on the box, the arm is powered, when it starts moving away from the switch in the box, that one is closed too.
After switching the top one off, the arm will still be powered, returns and turns the complete circuit off.
I've done some searching and found kits and plans that follow this design, having the arm hit another switch to turn it off, no microcontroller involved. I wanted to build it around the Arduino because I'm doing it more as a learning experience than for the final result. And I was going to program some variation in it's behavior. Like have it move slowly the first time you flip the switch, then increase the speed if you keep flipping it. Kind of like it's getting mad that you keep turning it on. I was only going to have it turn off after it had been left alone for a while. Now that I think about it I guess I could use the same design but have the arm stop a little short of the inside switch until it's ready to turn off.