I'm designing a arduino-based car system that I would like to have running even when the car is off and parked. Though the system is designed to be very energy efficient, I don't want it to run down my car's main battery. I have a 12v to 5v converter already working (Tobsun EA15-5v DC12v to DC5v 3a converter)
I would like to use a small lead acid battery (a 12v 7200mAh battery for an APC UPS) as a power supply for the project, having it charge off my car's cigarette lighter port (which only supplies power when the car is on), and when the car is off the UPS battery runs the arduino system.
Additionally, I would like to know whether the car is on or the backup battery is being used, so I intend to build this circuit using a 4n25 optoisolator so the arduino can detect if the car is on.
My question really centers around:
1) Does this arrangement, without further circuitry, safely charge the 12v UPS battery when the car runs? If I need further circuitry to manage charging, any recommendations for a module that would fit?
2) In this arrangement, especially given the D1 diode, is the 4n25 circuit in the right place to detect a signal when the car power is on, but not when running off the UPS battery?
Any other advice?