a really silly idea; a cmos inverter, use Vcc as output, the gate output connected to the solarcells, gate input input connected to Vusb
That's actually pretty creative! Quiescent current or leakage might be an issue, but I'll breadboard it tonight and see!
Depletion-mode FETs are rare, and mostly available for RF applications.
May I suggest a super-primitive idea?
A reed relay with changeover contacts (DT, double throw). Power the coil from the USB port and the NO contact will let USB power flow. If USB power disappears, it'll fall back to NC and transfer power from the solar cells.
This would be the lowest loss solution, I think.
Hmm, not a bad idea, actually. Something like this:
However, there are a couple of issues I can see:
I don't have a lot of space available... I think I could find one small enough in the L and W dimensions, but I might have a hard time finding one that's under 2mm in height! (Though I could get away with 3mm on the bottom of the board).
The solar side of the relay would only be putting out tens to hundreds of microamps (possibly going to ~5mA if someone takes it into the sun). A lot of relays really need quite a bit more current than that to keep their contacts clean.
Though I suppose that really only applies to power relays; a signal relay might not be as vulnerable because a lot of small, low current signal relays have contact resistances in the tens of ohms, which wouldn't really drop the solar side that much (I don't care about the USB side as it's going down to 3.3V anyway).
Still, not a bad idea and worth checking what's available on Digi-Key!
---
So, I did a test last night with a random PFET I had sitting around (a TO-220 IRF part). I hooked it up backwards (with the source towards the higher voltage) and it seemed to work exactly as it did in my simulations.
Barring the availability of a tiny relay or the use of a CMOS inverter, I think I might try this method out on the actual board and see how it works.
Here's my LTspice data using the actual FET I planned on using: