I don't fully understand: What's the use of the inverter? You can step down the 24 V from the batteries directly to 5 V using the LM2596.
Of course you can also step down 24 V -> 12 V, then use the inverter to step up DC 12 V -> AC 220 V and then AC 220 V -> DC 5 V, but that is terribly inefficient. You may also run into issues with peak current requirements of the LM2596 and the inverter.
There's no way to instruct you from afar without knowing many more details of the step-down module and the inverter. Give it a try.
We need an inverter since our raspberry pi requires an AC source but the one that supplies our whole circuitry is 24V battery which is DC. The purpose of the buck converter is to make the voltage input compatible to the required voltage input of the inverter (because, like what I said, we mistakenly bought an inverter that can only allow 12V from a dc but our battery is 24V).
24V (DC) battery --> buck converter --> 12V (DC) --> 12Vdc/220Vac inverter --> 220V (AC) --> Raspberry pi 4B
Also, your suggestion of stepping down the 24Vdc to 5Vdc for raspi, we have already tried that and our buck converter blew up.
Btw, still thanks for the reply
