PIR sensor should trigger video recording on Android

Hi everyone,

i try to make a battery powered security camera which should trigger from PIR sensor. The question is: How can i trigger the Android phone to start recording?

My thoughts for solutions:

There is an app call Easy video recorder which can start recording (even when the phone is locked) by pressing the volume or power keys.
Now i just need to find a way how the PIR can trigger a "volume key". I thought doing that via audio jack input but it seems kind of complicated to built the "audio-cable" with all the required resistors as you can read here: سماعة 3.5 ملم: مواصفات الملحقات  |  Android Open Source Project

So my next thought was to connect a arduino or ESP board via USB OTG. Is there a way to send volume up or down commands via USB?

Is there another way (and battery friendly) to send a volume-up command from arduino to android?

Thanks for your brainpower :slight_smile:
ED

Connect PIR sensor to an Arduino; have it use a servo or solenoid to press the button on your phone upon detection of motion.

If you can do this through the button on a headset cable, maybe replacing that button with an optocoupler works.

Thanks for your input. Servo or Solenoid is a solution but too mechanical for my taste :slight_smile:

I managed to find the correct resistor value for the headset cable (220 Ohm in parallel with 5KOhm between GND and Mic) which triggers the volume up key. So i think the optocoupler sounds good to me.

Another solution which seems to do the job:
https://www.brainy-bits.com/make-your-arduino-push-buttons/