Power Switch with Tilt sensor

Hi,
I’ve created an arduino mp3/aac player and with a LiIon accu step-up to 5,2V.
I have created a stand-by functionality with a Polulu power switch.

What I want:
I want to wake up the arduino with a tilt sensor from (arduino starter pack --> https://www.arduino.cc/documents/datasheets/TiltSensor.PDF).
The sensor is connected to the power switch (A + B connector). When the arduino is started it establishes an High Volt on connector ON.

Problem:
The startup needs some seconds (1-2 seconds) and when not holding the tilt sensor still it turns the arduino off and some times I have an on/off flickering.

Question:
How can I avoid the on/off flickering?
Is it possible to add a capacitor to the tilt sensor? Which capacitor do I need for this?
Or another idea is to disable the tilt sensor with an MOSFET?

What do you think?

Thanks a lot
Daniel

P.S. Here is my code, but it doesn’t matter (I think) https://github.com/golesny/12mp3

Hi, Daniel.

For that kind of application it seems like you probably only want the tilt sensor to be able to turn on the switch. If that is the case, you could connect the high signal from your Arduino to the CTRL pin instead of the ON pin. If you want to implement something more complicated where the Arduino checks for further tilts after being turned on for a time out feature, you might find the discussion and circuit in this thread helpful.

-Claire

Thank you for your answer.
Unfortunately the arduino is not up and running at that Moment. As soon as the arduino is started I’m doing like you said.

But it takes 1 or 2 seconds until the arduino is running. The flickering happens while this period. I think I need a hardware solution.

In case you did not see it, the thread I linked to in my previous post has a hardware solution that should make it so the button (or in your case tilt sensor) can only turn on the power switch and never turn it off.

-Claire

1 Like

Yes, I’ve read the linked article a lot of times but unfortunately I’m not an expert in electronics and therfor I was not able to transfer it on my problem. Now, I just tried it out and it works. I don’t know why exactly … but that doesn’t matter at the moment.
Thank you so much
Daniel