Thank you for your honesty, which , quite frankly, is very rare here. Most newbies try to conceal their
ignorance. It's refreshing to find someone with the guts to say they have no clue.
Regarding your request.
Your schematic is all wrong (no surprise there)
First things first: A transistor requires a base resistor to avoid damaging the base junction.
Transistors are current controlled devices (unlike mosfets which are voltage controlled)
When using a transistor the first step is alway read the datasheet to get the necessary
A. Continuous current rating
B. Current transfer ratio (hfe , expressed as a ratio, thus
an hfe of "100" means the collector current will be approx
100 times the base current.
C. To choose a base resistor, you need first to know how much
collector current you need. Let's choose 100mA for your example.
D. Let Ic = 150mA (0.150A)
Let's use a 2n3904
If we use assume an hfe of 200 and devide 150mA
by 200, you get 75mA (0.075A). If we round that up to 1mA
(0.001A), then the base resistor needs to be (5V/0.001A)=5000ohm.
To guarantee saturation, well use 1000 ohm , which will increase
the base current to 5mA (0.005A).
E. The load is your capacitor (let's choose 1000uF)
The collector is connected to +5V, the base is connected to the
1k resistor which is connected to the GPIO. The emitter is
connected to the capacitor "+" terrminal . The capacitor "-" terminal
is connected to the arduino GND. When you turn on the transistor
it will charge the cap. The problem is that if the cap is completely
discharged, when you turn on the transistor, the current inrush will
pull down your arduino +5V line , causing the arduino to reset. To
avoid that you can PWM the transistor , starting with a very low
value , like "10", then delay 300mS and then increase it by a factor
of 5 and then , delay 300mS and increase by a factor of 10 until
the duty cycle is 100%. Wait 60 seconds to charge the cap that
way and then it will be fully charged. The "+" terrminal of the cap
is connected to the GPIO you want keep high during boot. The
only thing missing now is the relay to separate your GPIO from the
charging circuit so you can control when that GPIO is connected
to the cap. Insert the relay contacts between the charging circuit
and the cap (common to charging circuit, N.O. contact to GPIO.
When you energize the relay, the contacts will close connecting
the charging circuit to the cap. Then all you have to do is write
your code to control when you charge the cap.
P.S.-Destroy the schematic you posted and don't show it to anyone.
Also , if you buy a 5V relay module you won't have to add a transistor to turn on the relay because that's already built into the relay module.