Hi,
I used this microcontroller: Esp32 TTGO T-Call, this RGB module and this battery.
My problem is the following one:
The microcontroller is connected to the battery, then I connected the RGB module to the microcontroller and I write a simple code to test. It was successful since the RGB module light up. After a while, the microcontroller automatically turned off (battery fully charged) while connected via battery. If I connect that via USB it working well.
My opinion for why is this die (turn off) after a while because the RGB module uses too much current. According to the documentation a GPIO pin can output max 12 mA.
Since now if I upload any kind of code to the microcontroller die from the battery.
Can you help me with this?
Code C++ - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
void setup(){// put your setup code here, to run once:
pinMode(4,OUTPUT);
pinMode(5,OUTPUT);
pinMode(18,OUTPUT);
digitalWrite(4,HIGH);
digitalWrite(5,HIGH);
digitalWrite(18,HIGH);}void loop(){// put your main code here, to run repeatedly:}
It should be OK but what kind of battery are you using?
Note that the ESP32 can draw 250mA and the SIM800L can draw about the same, most batteries can't supply the 500mA plus LED current and if the voltage is pulled too low the ESP will crash.
That battery is only just big enough. How do you know the SIM800L is not powered up? It seems to be powered from the same supply line and it's operation controlled by the ESP32.
The LEDs alone will only draw a few mA so they are not the problem. If running it from USB works but the battery stops after a while it can only be that the battery can't sustain the load current.