Use a high side gate driver. This includes a bootstrap function to generate positive gate drive (for a cheaper N channel FET), and level translation.
I'm curious: the output of the device is a battery, which means that if the switch stays off for a while (or even, spends a bunch of time in discontinuous conduction mode); the voltage at the source of the MOSFET will settle at Vbat; which would prevent the bootstrap capacitor from charging. So depending on the exact startup transients etc; such a solution could end up paralyzed at startup. Am I missing something? What's a non-horrible workaround?
PS: I just built an LED driver circuit that failed for a virtually identical reason... so I'm not making this up
Thanks for all the responses guys. Clearly I have a lot more to learn. Hopefully once I get to uni (only in year 12) I will learn what I need to. For now ill just keep tinkering. The responses are really really good. Thanks again.
You'll do well if you're tinkering with building solar battery chargers from scratch at year 12! Unsolicited career advice: Keep at it though; and don't wait for Uni to teach you things. Uni is way more fun if you're ahead of the curve (like you are now) than if you're in the middle of the curve (like you might be if you rest on your laurels until Uni). We've all been talking about complicated stuff; analysis of exactly what happens in your current circuit, bootstrapping high side drivers, bla bla bla. But this is your thread, feel free to direct it however you like. The one problem (apart from the lack of feedback mentioned by T3sl4) is that the gate is not being
strongly driven to Vpanel when required. If you focus on that issue, you'll do fine. In particular, just replace your BJT with a TC4428 IC and that'll solve that problem instantly.