ESP32-C3 Periodic ripple on 3.3V

okw123
Posts: 8
Joined: Sat Aug 24, 2024 1:08 pm

ESP32-C3 Periodic ripple on 3.3V

Postby okw123 » Tue Sep 10, 2024 2:34 pm

I cannot connect to clients over bluetooth with my ESP-C3. I program with Arduino and can scan and list nearby clients with success (BLE/Scan example), but I can't connect to my iPhone app BLE Scanner (for this I used BLE/Write arduino example). BLE scanner just reports connection time out. I read in a few forums, connecting to a client requires much more precision (frequency/crystal, voltage ripple, etc), than just listing nearby clients.
I then checked the power rail with an oscilloscope, and saw periodic ripple when bluetooth was active. I see 3 rather large dips, then stable, then dips again. I didn't measure the periode between the dips. The shape and amplitude vary depending on if I draw power from a li-ion battery or USB (both through the same voltage regulator) or directly inject 3.3V from my RD6006 power supply.
I also wrote other code that did not activate bluetooth (turning on and off LEDs, reading switches, etc.), and the power is stable with no ripple.
I'm not sure if the ripple is the actual cause of the problem, or maybe timing. I measured the crystal in circuit and it swings at ~40MHz, but it's difficult to get precise measurement down to 10ppm (which is the requirement).

I've followed the ESP32-C3 hardware design guidelines with all decoupling/bypass capacitors, inductors, resistors, etc (and recommended values). 40MHz crystal is 10ppm.
This should be battery powered, so it's crucial I can make it work on battery (which at the time experience the largest rippe of them all, strangely enough).

Anyone have an idea what could be wrong?
Attachments
usb-into-vreg.png
USB to voltage regulator
usb-into-vreg.png (38.25 KiB) Viewed 1354 times
liion-battery-into-vreg.png
Li-Ion battery to voltage regulator
liion-battery-into-vreg.png (39.5 KiB) Viewed 1354 times
RD6006-directly-into-3v3.png
RD6006 3.3v injected directly on 3.3v rail
RD6006-directly-into-3v3.png (54.3 KiB) Viewed 1354 times

aliarifat794
Posts: 172
Joined: Sun Jun 23, 2024 6:18 pm

Re: ESP32-C3 Periodic ripple on 3.3V

Postby aliarifat794 » Tue Sep 10, 2024 2:57 pm

Add extra or larger low-ESR ceramic capacitors close to the ESP32-C3’s VCC pin to smooth out voltage dips. Typically, 10 µF, 1 µF, and 0.1 µF capacitors in parallel are used. These capacitors should be very close to the chip.

okw123
Posts: 8
Joined: Sat Aug 24, 2024 1:08 pm

Re: ESP32-C3 Periodic ripple on 3.3V

Postby okw123 » Tue Sep 10, 2024 3:02 pm

I have followed the design guidelines to the letter and have 10uF+100nF+2nH+1uF on VDD3P3, 10nF+1uF on VDDA, 100nF+1uF on VDD3P3_CPU and 100nF on VDD3P3_RTC.

MicroController
Posts: 1692
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: ESP32-C3 Periodic ripple on 3.3V

Postby MicroController » Tue Sep 10, 2024 3:18 pm

FWIW, three brief current spikes of several hundred mA are normal while the ESP is advertising via BLE.
I guess it's not a coincidence, given that BLE uses three RF channels to broadcast the same advertisement message three times each advertisement cycle.
I don't think the power supply ripple is a problem in this case. Although the battery may not be quite up to the task and may warrant a few extra caps...

okw123
Posts: 8
Joined: Sat Aug 24, 2024 1:08 pm

Re: ESP32-C3 Periodic ripple on 3.3V

Postby okw123 » Tue Sep 10, 2024 3:36 pm

Regarding the battery. I'll definitely try more caps. It could also be the problem that battery goes though a MOSFET but USB goes through a schottky. I have a power path circuit that disconnects the battery when USB power is present. Similar to the attachment.

What could be the problem then? I ran XTAL_N under the crystal. Could that interefere?
I attached part of the layout.
Attachments
Screenshot 2024-09-10 at 17.36.23.png
Layout
Screenshot 2024-09-10 at 17.36.23.png (98.53 KiB) Viewed 1316 times
power-path.png
Similar
power-path.png (17.54 KiB) Viewed 1316 times

MicroController
Posts: 1692
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: ESP32-C3 Periodic ripple on 3.3V

Postby MicroController » Tue Sep 10, 2024 8:14 pm

I guess the problem is either with the firmware, with Apple's BLE or its configuration, or with the BLE scanner app.
Try another device (Android phone or PC) and see if anything changes.
Do you get any logging output from the ESP?

okw123
Posts: 8
Joined: Sat Aug 24, 2024 1:08 pm

Re: ESP32-C3 Periodic ripple on 3.3V

Postby okw123 » Tue Sep 10, 2024 9:02 pm

I tried with a ESP-WROOM-32D dev board and it works. With the "BLE/Write" example i can write in the iOS app (BLE Scanner) and the text shows up in the serial monitor via the ESP.

Who is online

Users browsing this forum: No registered users and 83 guests