Author Topic: MPU6050 hangs on ESP32 when operated using a battery on custom board  (Read 1712 times)

0 Members and 1 Guest are viewing this topic.

Offline SarthdaveTopic starter

  • Newbie
  • Posts: 4
  • Country: in
We are facing a very peculiar problem. We are designing a board based on ESP32 with various peripherals like motor drivers, sensors etc. We are using GPIO 4,5 on the ESP32 as I2C lines and have hooked up three devices on the bus. The first one is the MCP23017 which is connected to the ESP32 using a bidirectional level shifter (it operates on 5v), other is the CAP1206 touch IC and finally we have the MPU6050 interfaced with it. For powering the board we have three options. - DC adapter in which the voltage from the adapter is lowered to 5v using a buck converter and supplied to the system. - USB port for power and programming (We are using the CH340G for programming the ESP32 module) - Finally we use a 18650 cell in conjunction with a TP5410 based circuit which functions as a charger and boost converter (Converting the 3.7V of the battery to 5V) The problem is that when we run our device on DC adapter or the USB power, everything runs fine. However, when using on a battery, the MPU6050 device suddenly seems to hang after some 10-20s. I will include the schematics of our USB,MPU6050 and charging circuit with this post. The problem only occurs when using the battery and does not occur in any case when using USB/DC as power source. What have we tried: - Triple checked that all the connections on the PCB were right - We found that when we remove the diode marked "D2"in the charger circuit, everything seems to work fine with battery too. We thank you for taking time in reading this and hopefully giving us some solution.
 

Offline macboy

  • Super Contributor
  • ***
  • Posts: 2288
  • Country: ca
Re: MPU6050 hangs on ESP32 when operated using a battery on custom board
« Reply #1 on: November 24, 2018, 01:10:05 pm »
Monitor voltage Vbus issuing a high impedance voltmeter while running from battery. You may see it slowly creep up. This is due to reverse leakage on the Schottky diode D2. Schottky diodes are leaky. I'd guess that this reverse leakage current slowly charges C12 (Vbus). When the voltage on C12 becomes high enough, the charge controller thinks the USB is plugged in and tries to switch to that, causing a power blip. Of course this is just a hunch, you will need to test if this is happening. If it is then try putting a resistor across C12 to bleed the charge, maybe 10k or higher is sufficient as the leakage current is small.
 

Offline SarthdaveTopic starter

  • Newbie
  • Posts: 4
  • Country: in
Re: MPU6050 hangs on ESP32 when operated using a battery on custom board
« Reply #2 on: November 26, 2018, 05:46:14 am »
Thank you very much for taking the time to analyze and respond. The capacitance was indeed the problem. I removed the capacitance over the VBUS line and voila! everything worked perfectly. However, a 10k bleeder resistor did not work. Any idea as how I can keep that 10u capacitor on the VBUS line while still solving the issue.
« Last Edit: November 26, 2018, 11:07:30 am by Sarthdave »
 

Offline nsrmagazin

  • Regular Contributor
  • *
  • !
  • Posts: 156
  • Country: ru
Re: MPU6050 hangs on ESP32 when operated using a battery on custom board
« Reply #3 on: November 26, 2018, 02:12:11 pm »
Try a 1k resistor.
Hi all!
If you like the post, please press "thanks".
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf