XIAO ESP32S3 Sense - Battery charging

I appreciate that the ESP32S3 Sense is designed to charge the battery from the plugged in USB connection.

Is it OK to charge the battery from an external power source connected to the 5V pin ?

And if so what is the maximum voltage that should be put on the 5V pin ?

You may find an answer to your question here:

https://github.com/Seeed-Studio/wiki-documents/blob/docusaurus-version/docs/Sensor/SeeedStudio_XIAO/SeeedStudio_XIAO_ESP32S3/XIAO_ESP32S3_Getting_Started.md

I have a dim recollection of reading somewhere, that the 5 volt output is disconnected when a battery is attached, but only take that as a clue, not gospel.

Best regards,
Larry

The schematic shows that the 5V pin is VBUS, and that is connected to the battery charger, SGM40567-4.2XG/TR and the USB connector UBF31-0171

Cannot seem to find datasheets for these devices, so dont know what the maximum input voltage would be.

Here’s the UBF31-0171 data sheet:
https://cn.sg-micro.com/uploads/soft/20200608/1591610983.pdf

I’ve attached a battery to the Seeed ESP32S3 Sense, and observed it being charged (considerable camera-expansion heating) with the red LED blinking until full charge.

Then I disconnected the USB cable, and expected the WiFi Camera Server to continue running by being powered from the battery. It didn’t.

What am I missing?

Hi there,
You got a while Serial in that code?
did it reset or appear to freeze ?
HTH
GL :slight_smile: PJ

Thats a datasheet for a “SGM40657/SGM40658 High-Current Over-Voltage Protector” ?

It appeared to freeze.

I’m sorry, but I don’t understand this question:

You got a while Serial in that code?

Yes. It’s the correct datasheet for the SGM40567 you said you couldn’t find.
https://www.sg-micro.com/show-product-944.html

I tried to find the UBF31-0171 datasheet, but as it is only the USB-C connector, I didn’t see the point in pursuing it further.

Now that you have the SGM40567 datasheet, please post your answer to your questions:

Is it OK to charge the battery from an external power source connected to the 5V pin ?

And if so what is the maximum voltage that should be put on the 5V pin ?

Best regards,
Larry

I did find that page, but there is no detail on max voltage and the link for the data sheet just loops back to the same product page;

https://www.sg-micro.com/show-product-944.html

Which is why I was asking if anyone knew the details, you would imagine that the SEEED designers have seen the datasheet …

I see.

So, when you said,

Cannot seem to find datasheets for these devices, […]

You meant, you were unable to find the information you sought on the datasheet.

If anyone does know where the datasheet, for the SGM40567, can actually be found, then please provide an actual working link.

It is not a datasheet, but the link below has the information. it looks like VinMax = 28V.
【产品】可用于松耦合无线充电和太阳能充电的小容量紧凑电池充电器SGM40567

In my opinion, the following precautions should be taken when supplying an external voltage from XIAO’s 5V pin.

  1. since the 5V pin assumes the use of 5V, the withstand voltage of capacitors C3, C4, C10, and C25 connected to VBUS in the circuit diagram may be 6.3V.
  2. If USB is connected by mistake when an external voltage higher than 5V is applied, the PC may break down.

Hi there,
Yes, If you disconnect the USB the code may be waiting if so , and you don’t indicate if it freezes or stops?
ie.

while(!Serial); //When the serial port is opened, the program starts to execute.

GL :slight_smile: PJ

I was aware of the potential issue of feeding anything external connected to the USB port with more than 5V.

Although the largest capacitor appears to be 4.7uF, they are tiny ceramics so might well be rated to 6V3 only.

Thank you very much for your kind assistance.

You are correct. The WiFi Camera Server does continue to run after the USB-C is disconnected and the battery still connected. But, the video freezes. The settings menu remains active, however. I can still start and stop the stream, but then, there is no video without the USB-C.

With regard to your suggestion:

while(!Serial); //When the serial port is opened, the program starts to execute.

Are you suggesting that I add a while loop to the sketch?

Thank you again for your assistance.

Best regards,
Larry

After sleeping on your suggestion, I believe you are intimating that the cause of the Camera_HTTP_Server code freezing when the USB-C cable is disconnected with the battery installed is a result of the Seeed ESP32S3 sense waiting for the serial port. So, to overcome this, the ‘serial’ instruction can be commented out, and recompiled, uploads, and run.

I would test this, but now I’m getting this error when I attempt to launch Arduino IDE:

No protocol specified
Picked up JAVA_TOOL_OPTIONS:
No protocol specified
java.awt.AWTError: Can’t connect to X11 window server using ‘:0.0’ as the value of the DISPLAY variable.

Thank you for your help.

Hi there,
Yes exactly. :smile:
Sounds/ Looks like a bad lib or BSP selection?
I just received one a couple days ago, No issue running the Streaming video demo.
HTH
GL :slight_smile: PJ

PJ,

I got arduino running (I can’t run it as root, as root doesn’t run X11), and had a look at the code.

There are numerous ‘serial’ statements.

If you manage to succeed in getting the video stream to function with the battery connected, and the USB-C disconnected, please let me know how to modify the sketch.

Thank you again for your kind assistance.

Best regards,
Larry

Hi there ,
I went back added a battery and also unplugged the working demo USB cable and It stopped,
commented out LINE 19 & 20 the wile(!Serial); and I turned off the debug Output(false)

#include "esp_camera.h"
#include <WiFi.h>

#define CAMERA_MODEL_XIAO_ESP32S3 // Has PSRAM

#include "camera_pins.h"

// ===========================
// Enter your WiFi credentials
// ===========================
const char* ssid = "GlassSurf-2.4";
const char* password = "SEEEDstudio"; //;-p

void startCameraServer();
void setupLedFlash(int pin);

void setup() {
  Serial.begin(9600);
  //while(!Serial);
  Serial.setDebugOutput(false);
  Serial.println();


You see the Light is ON, and It’s streaming like a BOSS. :star_struck:
It responds in seconds when I turn the power off and back on and restart stream very good.
HTH
GL :slight_smile: PJ