That will dissipate a fair amount of power and require heat sinks.Install high current isolation diodes on the SSR outputs.
Thank you for this circuit, i have ordered 2N5401 and will try this. though this spice simulator circuit is a bit confusing for me, is it possible if you where to make it a "normal" schematic? anyways thank you for running the spice simulations to figure this out for me! i have also taken your suggestion about isolating the power supplies and have ordered B0505S-1W isolators.Below is a circuit that eliminates the 12V supplies by substituting a high-voltage (≥150V) PNP transistor to control the MOSFETs.
Note that this inverts the input signal, with the output on for a 0V input to the opto.
View attachment 294163
Not a big problem.The only problem is it only works with the 134 volt battery.
very nice work from you! i made this circuit and it works even with 50v battery and 36v battery connected. (before the mosfets blew up.)After further thought, I had a eureka.
You don't need the transistor.
The opto can drive it directly if you use a resistive divider to reduce the maximum voltage.
The red trace is the MOSFETs' gate-source voltage.
View attachment 294218
Not surprising, as the ON gate voltage is only about 4.5V with R4 and R1 equal to 100k and 20k, so the MOSFETs are not fully turned on.whatever mosfet pair has the 36v connected start to get very hot when switched onto the lower voltage battery.
yes i realised that now, i apologise for my mistake. however, this circuit works so well I'm really impressed by your work! i have the esp32 powered via USB from my PC but everything is like in your schematic. i have bought a 5v dc to dc isolator will this work to isolate the mcu? part number: B0505S-1WNot surprising, as the ON gate voltage is only about 4.5V with R4 and R1 equal to 100k and 20k, so the MOSFETs are not fully turned on.
If you want to operate over such a wide voltage range, you need to substitute a 10V Zener for R1 as I stated in post #27.
Isolate it from what?i have bought a 5v dc to dc isolator will this work to isolate the mcu? part number: B0505S-1W
The Zener keeps the MOSFET Vgs ON voltage constant with a change in the battery voltage.can you explain how the zener diode works in that way?

ah that explains it, I've ordered those too.Isolate it from what?
The Zener keeps the MOSFET Vgs ON voltage constant with a change in the battery voltage.
The red trace below shows the 12V Zener, D1 generating an essentially constant 12V Vgs when on, for the battery voltage varying from 30V to 134V (yellow trace).
View attachment 294240
That isolator requires a 5V input to get a 5V output.ordered that isolator to keep the mcu isolated from the batteries
exactly, i will convert the battery voltage into 5v for the isolator. also thanks again for everything you did it really helped me outThat isolator requires a 5V input to get a 5V output.
Are you getting the 5V from one of the buck regulators operating from the battery?
If so, then the isolator should work.

Ah, okay so this should be working. i wont re-create it now but in final version. One last thing that is bugging me is that i need to measure both batteries voltages via ADC. the only method i can think of is getting ADUM1251ARZ i2c isolator and an external adc. however, these components are quite pricey. is there another smarter method to do this? or that could be the only method.Okay, to eliminate the high voltage from the opt output, I think we need to go back to the PNP buffer (below):
View attachment 294265
Ah, that looks interesting, do you have a part number? i tried searching but the results are ambiguous since i had never seen this component before.You could also use a high voltage difference amp (example below) to convert the battery voltages to a ground based signal for conversion by an A/D.
View attachment 294278
It's a similar device, but does not have rail-rail output as the LT6375 does (did you not see the part no. on the schematic?).INA117P is that the same thing as in your circuit?