tinypico / tinypico-hardware

Hardware design files for TinyPICO and Shields
Other
247 stars 59 forks source link

Sensing when USB power is present on V1 boards #19

Closed Paraphraser closed 3 years ago

Paraphraser commented 3 years ago

I have some TinyPico V1 but an application where they will mostly be getting power via USB but I would like to be able to sense when USB power goes away and the battery takes over.

In comparing the V1 P3 and V2 C2 schematics, it looks like the V1 boards can't do that. True? Or am I misreading the purpose of GPIO9? Is there a workaround?

I'm happy to order some V2 if need be. I just didn't want to do it unnecessarily.

UnexpectedMaker commented 3 years ago

That's correct. V1 doesn't have this capability on board. It's a V2 only feature. You can add this yourself by connecting a voltage divider between the 5V pin and GND and connecting the middle of it to an IO on the TP and reading if it is high or low.