You'll need a driver (transistor, relay...) to switch the solenoid from a digital output pin. I'd use a commercial LiPo charger and a 12V DC source, and 2 diodes to route the higher of both voltages to the consumers (solenoid and Arduino).
You'll need a driver (transistor, relay...) to switch the solenoid from a digital output pin. I'd use a commercial LiPo charger and a 12V DC source, and 2 diodes to route the higher of both voltages to the consumers (solenoid and Arduino).