I'd like to take this phototransistor switch circuit:
And add a tilt-ball or similar switch in series. That switch needs to be heavily debounced, so that it stays "switched" more or less for several seconds after the last contact, but does not need a sensitivity adjusting trimpot which the phototransistor is still going to need.
Here's my attempt:
The desired behavior is that the leds should light when it's dark out and the tilt switch has been jiggled around recently.
I don't know how to simulate either the phototransistor or the tilt switch and I don't have the parts on hand. Does my circuit above seem reasonable?
I hadn't realized that the transistor pair is inverting, so I think the way I have it above if there's no light and there's motion it will shut off. If there's light or no motion it will remain on.
What I want is if there's light and motion turn on the load, if there's either light or no motion fade out & shut off the load.
Also this is intended to be battery operated so it's better if it consumes as little power as possible when off. To me this seems a little challenging because you might naturally want the phototransistor pulling down a pull up which is always going to waste a little current.
This seems pretty close to what I want. Horizontal switch represents the spring switch, the vertical switch represents the phototransistor.
Only question is how to tune the phototransistor's sensitivity...