i have realised this electronic scheme. It is working very well. it allows to activate a solenoid.
is it possible to add a capacitor on this in order to arm the relay for a period of time ? (10min, 20 min, 30min or 60min)
You definitely do not want to use analog electronics here, its a switching circuit.
Switching circuits are only efficient in two states, on and off - anywhere inbetween
and the power dissipation in the switching device will be a lot higher - for no
benefit at all.
You do the delay in software, which is effectively free and you have a simpler
circuit with less components to fail.
If you were to do this in hardware the method of choice is using a monostable
such as the 74HC4538.