ESP32C3 issues waking from deep sleep on battery.....but not consistently

So i’ve got this from ChatGPT for my wiring. Is this correct? I should have the pull-up resistor, the power for the temp sensor and both the capacitors positive legs going to the the 3.3v pin and then the temp sensor GND, the negative of both capacitors going to GND on the board, and finally the other end of the pull up resistor and the data from the temp sensor going to the selected GPIO?

3.3V ----+----||----+
         |    10µF  |
         |          |
         +----||----+
              0.1µF |
                    |
                    +----[DS18B20 VDD]
                    |
                   GND ----+----[DS18B20 GND]
                           |
                           +----[DS18B20 Data]---- GPIO_PIN
                                   |
                                   +----[4.7kΩ Pull-up]---- 3.3V

How would you normally get so much onto one point/pin? Am i going to have to use a PCB? Was hoping to avoid it for space restrictions.
Do you think i should just use another board? I’m beginning to suspect my issue is simply the esp32c3 isn’t suitable as it doesn’t seem wake up reliably. I’m only now setting one up without sleep to see the difference (meant to do that ages ago but got distracted).

I notice this but due to my lack of experience in this field I’m not sure if deep sleep for 15 minutes at a time is considered “frequent” especiallytwhen we are dealing with microseconds.

  • CHIP_EN must not be left floating.
  • To ensure the correct power-up and reset timing, it is advised to add an RC delay circuit at the CHIP_EN pin. The recommended setting for the RC delay circuit is usually R = 10 kΩ and C = 1 μF. However, specific parameters should be adjusted based on the characteristics of the actual power supply and the power-up and reset timing of the chip.
  • If the user application has one of the following scenarios:
  • Slow power rise or fall, such as during battery charging.
    • Frequent power on/off operations.
    • Unstable power supply, such as in photovoltaic power generation.

Then, the RC circuit itself may not meet the timing requirements, resulting in the chip being unable to boot correctly. In this case, additional designs need to be added, such as:

  • Adding an external reset chip or a watchdog chip, typically with a threshold of around 3.0 V.
    • Implementing reset functionality through a button or the main controller.

i thought you told us that it was definitely waking up, and the unreliable thing was the wifi connection. Or am I misinterpreting your text?

It is definitely waking up, when the message isn’t posted i can see in the broker logs that it did connect but was disconnected due to timeout. Would it be 100% “awake” at this point and that’s no longer on the list of possible issues? The wifi is 100% fine i’m sure, i’ve got them testing just now with an rssi of -40 +/- 5 (I dont think i can practically improve on that) mainly looking into whether the voltage pull on wake up is occasionally tripping it up, have new caps coming tomorrow to try a different build as shown in previous post, just wanted to check i was planning to put them in the right places.

I’m obviously doing something/many things wrong due to my complete lack of experience/knowledge with this but if someone can confirm it is possible to do this with this board and the correct setup I’m quite happy to die on this hill trying again and again to get it right.

the board should be fine to use. and rssi of -40 or even -60 should be ok. If the voltage would drop for some reason it most likely would reboot. Perhaps add a led blink to your code, so you see it blink three times when it reboots. Perhaps add some different amount of blinks at different stages of the code to find out when exactly it fails.
Apparently it works fine when you power it through the usb connector. So the voltage is a likely cause.
I don’t know exactly nothing about wifi antenna’s. Did you try removing the big one and using the onboard one? (that is if you board has an on board one) (I have a seeed studio esp32c6, that has both options and I have some none seeed, esp32c3 that have onboard antenna and some that have only external)

perhaps there is an error in your code (but should also be the case when using usb power). On this page ESP32 Setting a Custom Hostname (Arduino IDE) | Random Nerd Tutorials I read that you have the order of sethostname and begin wrong.

void initWiFi() {
  WiFi.mode(WIFI_STA);
  WiFi.config(INADDR_NONE, INADDR_NONE, INADDR_NONE, INADDR_NONE);
  WiFi.setHostname(hostname);

  WiFi.begin(ssid, password);
  Serial.print("Connecting to WiFi...");
  while (WiFi.status() != WL_CONNECTED) {
    Serial.print('.');
    delay(1000);
  }

HI there,

Lots to unpack here. Do you have this on a breadboard?
if you are using or trying to use parasitic power for the Sensor (it does support that) only a resistor is required.(it uses the GPIO to power the sensor) I would advise also to use Google Images for your searches on Schematics and Such, Glad to see you doing it but know this…AI is great tool for assisting and clarifying. It is NOT a designer… You have been Warned. :sweat_smile:
If you already have code and want a third EYE then, yes… If you have a specific Question or position on a Technical aspect of a circuit YES, BUT to have it design one NO. it’s named “CHAT” GpT for a reason. Do not get out ahead of your ski’s so to speak.
Meanwhile.
Look at the Demo I have on here that uses the DS1820B , another thing You are maybe sampling WAY to fast. That sensor is DOG slow on Delta of temp change… FYI. you can see it in the video how slow it responds.

Honestly Bro, the problem is between the keyboard and the floor, :v: but just do the basics first and set one up on a breadboard and Verify your hardware tests. It sleeps and wakes up fine. The RC stuff is Already on the Xiao BTW so no need in adding anything else.

  1. Power supply
  2. Connections
  3. Test Code

Power supply , needs to be in spec with the chips requirements and is the number one on the list for a reason. Connections should be testable(ie.breadboard or socket first) solid not if you move it or breath on it the device stops working. Test Code , NOT your app code but code that tests things, (yea like a BLINK code) Get the basics working and solid then move to the App design. If any of theses first three are skimped on. You will get out what you put in.

HTH
GL :slight_smile: PJ :v:

I’ve ordered some C6’s to test against. I’m reading other places that the particular board I’m using is notorious for having issues with wifi and deep sleep :smiley: :smiley:

Hi there,

Yes the C6 sleeps easy and low power.
The C3 works with the WiFi better. (faster connects) than the C6 in my testing. I’m of the opinion that the power supply section for the C3 is just not as good against brownout conditions.

GL :slight_smile: PJ :v:

1 Like

Yup, this was the answer. Had a C6 with the same setup, didn’t need a cap for stabilising anything power wise, hasn’t skipped a beat for a month now.
For any future me reading this, just get a C6 and avoid the grief.

1 Like