I have the following circuit that will drive a gas furnace
To power the circuit I use a LM2596 DC-DC converter which feeds 5 volts to the V5 pin on the ESP32.
Initially I developed the circuit in a breadboard and developed the code there. Now that I feel it's ready for implementation I constructed the circuit as shown in the diagram in a perfboard (PCB will be the next step once everything works). One of the main reasons of using a perfboard is that the circuit containts a TFT display and three buttons, which are separated from the circuit using shielded cable and JST connectors (because the whole thing goes inside a control panel and the screen is in the door while the controller is inside).
Everything works, except for the fact that the SD card will fail to initialize if the TFT display JST connector is connected. In the breadboard everything worked without an issue. I did some physical debugging and here's what I found:
- The issue happens when powering through a 12V power supply or when powering with USB (with and without connecting the LM2596)
- There are no shorts and the SPI pins show continuity with the JST connector and the SD module without issues.
- The TFT display is NOT the cause of the issue, I removed it but the issue persists when the shielded cable is connected
- I found that the SD card will fail to initialize when both the CLK and MOSI pins are connected to the shielded cable. If only one CLK or MOSI are connected to the cable (with VCC,GND,G2,G15 connected), the SD card will initialize without an issue.
The shielded cable is 1.5m long, I have tried grounding the shield to the ESP32 GND but it doesn't have any effect. The tests have been performed in an office, I am not sure if EMI from power sockets could be the issue.
Perhaps there's some weird EMI limitations on the perfboard? I am not sure what to try next so any suggestions would be very welcome.