Hello everyone,
I'm looking to a way to detect if my LilyGo-T-Call-SIM800L is powered from USB-C connector or if running from battery.
My first option was to add an extra power supply (220VAC to 5V) connected only to a GPIO pin and detect if there is power. I wish to avoid this solution so save a second power suply unit on the project.
My second option was to connect the 5Vdc coming from USB-C to one of the GPIO pin. The problem here is how to get USB-C 5v. USB-C connector has a very small pins and I wan't be able to solder a wire without destroy the whole PCB.
Anyone knows if is possbile to detect power source on LilyGo-T-Call-SIM800L.
Actually I'm using Adafruits_FONA library where I should be able to measure battery capacity but not power source.
many thanks
LilyGo-T-Call-SIM800L - How to detect power source USB-C or BATTERY
-
- Posts: 1
- Joined: Sun Jul 26, 2020 9:00 pm
Re: LilyGo-T-Call-SIM800L - How to detect power source USB-C or BATTERY
hi,
- does your development board have access to the 5V, 3.3V, and GPIO pins for example on a pin header? the battery voltage may also be available as VBAT?
- to detect battery voltages using a GPIO pin, in hardware configuration first drop the voltage down through a resistive voltage divider (example values 300k, 100k), you could use one GPIO pin for each of VUSB and VBAT
- it is not recommended to connect any voltages over 3.3V to any GPIO pin on ESP32, or you might fry your ESP32 or encounter other problems
- in your application, ensure that the dropped down voltages are routed to an ADC pin, then configure the ADC and measure the input voltages
- does your development board have access to the 5V, 3.3V, and GPIO pins for example on a pin header? the battery voltage may also be available as VBAT?
- to detect battery voltages using a GPIO pin, in hardware configuration first drop the voltage down through a resistive voltage divider (example values 300k, 100k), you could use one GPIO pin for each of VUSB and VBAT
- it is not recommended to connect any voltages over 3.3V to any GPIO pin on ESP32, or you might fry your ESP32 or encounter other problems
- in your application, ensure that the dropped down voltages are routed to an ADC pin, then configure the ADC and measure the input voltages
Re: LilyGo-T-Call-SIM800L - How to detect power source USB-C or BATTERY
Please check your PMU. in this case
https://gist.github.com/me-no-dev/7702f ... f322250b57
Or
AXP192 PMU
https://github.com/cyberman54/ESP32-Pax ... /power.cpp
https://gist.github.com/me-no-dev/7702f ... f322250b57
Or
AXP192 PMU
https://github.com/cyberman54/ESP32-Pax ... /power.cpp
Who is online
Users browsing this forum: No registered users and 116 guests