0
\$\begingroup\$

I am using a ESP32-S3 Dev Kit (Arduino code) connected to a MAX3232 to read data from a solar inverter. I am facing a strange problem as follows:

The UART (Serial1, mapped to 2 ports, connected to the MAX3232) works fine for a while then stops randomly (The LED lights attached to the MAX3232 module stop blinking). The duration between booting and halting can range from 5 minutes to 12 hours. I can't seem to tell why it does happen randomly and what is the cause of that. The ESP will still be running fine (Serial is working fine when connected to a PC and will always output normally) but no communication is done between the ESP and the MAX chip.

I tried the following:

  • Switching from Serial1 to Serial2, same behavior.
  • Restarting the device using the reset button. If it is not working, it will still not work.
  • Re-plugging the device. Same as above.

What does work: I switch the power supply.

  • I am using an AMS1117 3.3V to convert from 12V to 3.3V to give power to both the ESP and the MAX chips. If, instead of using that, I connect using USB, it will start working again, even if I power it back from the AMS.
  • The same scenario and behavior apply in reverse (it will stop working on USB<->PC then works again if I power from AMS).
  • Rarely, it will start working again randomly without doing anything.
  • Even if I am not plugged into the inverter, the behavior is still the same.

I am not able to explain this sporadic behavior therefore any help is greatly appreciated.

\$\endgroup\$
4
  • \$\begingroup\$ It might be easy to find the problem but there's no way to figure it out without schematics how each connection is made between the chips and devices. Post the schematics. If you have modules, post schematics of each module and how you wires the modules. \$\endgroup\$
    – Justme
    Jul 31, 2023 at 21:11
  • \$\begingroup\$ @Justme Replying from the phone until I have a computer to post the schematics: input of AMS connected to Vcc of the inverter (12V), output connected to both ESP & Max (3.3V), GND all connected to pin 5 of the rs232 db9, pin 17/18 of the dev board connected to Tx and Rx of the Max. As you can see, it is nothing special. Noting that the ESP dev board has a NeoPixel RGB LED that I am using to know the status when needed (I switch the color in the code) \$\endgroup\$
    – Ziad Akiki
    Jul 31, 2023 at 21:45
  • \$\begingroup\$ Yes but what you tell as relevant may not be the problem, what you think is irrelevant and don't tell may be where the problem is. You tell which pins you use. The problem may be the pins you don't use. \$\endgroup\$
    – Justme
    Jul 31, 2023 at 21:56
  • \$\begingroup\$ @Justme will add a schematic as soon as I can. \$\endgroup\$
    – Ziad Akiki
    Aug 1, 2023 at 11:06

1 Answer 1

0
\$\begingroup\$

AMS1117 is good for about 6W dissipation with an heroic heatsink (large copper water block)

An ESP32 wants about 300mA when it's running the radio so from 12V that's about 3W

You don't mention any heatsink, but at 3W you're going to need something more than just a few square centimeters of copper.

consider adding more heatsink (eg solder some lengths of thick copper wire to the tab) or add a pre-regulator to bring the supply voltage down (eg: LM2596 buck regulator module)

or replace the AMS1117 with something that can be bolted to a heastink. eg: LM7803

\$\endgroup\$
3
  • \$\begingroup\$ When touching the AMS, it is not showing any signs of extreme heat, but I guess you're right, I checked the datasheet now, it should be capable of 12W but I guess it would need a big heatsink. Are you suggesting using the LM2596 to lower the voltage to 5V then use the AMS1117 to go even further to 3.3V? Is that enough to handle the ESP and the MAX? \$\endgroup\$
    – Ziad Akiki
    Aug 1, 2023 at 11:05
  • \$\begingroup\$ Another question would be if it is better to separately power the ESP and the MAX? Currently both of them are connected to the AMS1117 \$\endgroup\$
    – Ziad Akiki
    Aug 1, 2023 at 11:12
  • \$\begingroup\$ it should be enough, the max232 doesn't take much current, we're using a similar setup with an ESP32 and an RS485 driver this should be in the same ballpark. \$\endgroup\$ Aug 1, 2023 at 22:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.