Isolated SPI does not work

Thread Starter

tomerbr

Joined Oct 16, 2017
25
Hello,

I need to create a board that measures the voltage and current of 3 phase suppliers.

I designed the circuit below.

One of the requirements was to have isolation between the high voltage side and the low voltage side.

The main IC receives the phases current (via CT) and voltage (via dividers) and transmits the measurements via SPI to an MCU.

The first voltage conversion is done by an isolated AC/DC converter that converts 230V AC to 5V DC that is isolated.

The second conversion is 5V to 3.3V no isolated.

This voltage goes to the MCU (not drawn here)

The third conversion is 3.3V DC to 3.3V DC isolated.

This voltage feeds the main IC that measures the phases. Note – the ground of the 3.3V (hence the main IC ground) and the neutral are shorted as described in the IC datasheet.

For some reason, I cannot receive data via SPI.

The main IC works, the SPI isolator works and wired as required (I tested it) but no data is received.

If I remove the SPI isolator and short the 3.3_ISO and the 3.3_ESP grounds I receive SPI data.

Any idea what am I doing wrong?

3P_SPI_ISO.png
 

Attachments

Thread Starter

tomerbr

Joined Oct 16, 2017
25
Looks like U4 is wirred back to front ,
Why do think that?
The MCU that is not in the drawing is the master (it is ESP32 module).
The "MAIN IC" IC1 is the slave.

If you still think it is somehow connected wrongly please elaborate.

Thanks
 

nsaspook

Joined Aug 27, 2009
8,658
Why do think that?
The MCU that is not in the drawing is the master (it is ESP32 module).
The "MAIN IC" IC1 is the slave.

If you still think it is somehow connected wrongly please elaborate.

Thanks
The ambiguity with SDO/SDI is why MISO/MOSI (or COPI/CIPO for “Controller Out, Peripheral In” and “Controller In, Peripheral Out”) nomenclature is better on circuit wiring diagrams. Even with two chips, if one port is called SDI and the other is called SDO, what name do you assign to the wire?
 

andrewmm

Joined Feb 25, 2011
1,751
My apologies, I assume this was the SPI controller,

( We can no longer call them master and slave as that is not PC !!!! )

So the controller,
how is that powered, in particular, how is that earthed to the isolator ?

Scope the input and output levels and signal shapes at the isolator, using the isolators ground on the same side as the scope reference. Do they look nice and clean ? nice voltage levels ?
 

Ian0

Joined Aug 7, 2020
3,198
Why do you need data isolation? Just isolate the mains voltage with three small transformers instead of dividers.

By the way, your power supply needs to be rated for 400V AC (650V DC). It's no use having a three-phase monitor to tell you if the phase voltages are correct if it's going to blow up if the neutral gets disconnected!
 

Thread Starter

tomerbr

Joined Oct 16, 2017
25
My apologies, I assume this was the SPI controller,

( We can no longer call them master and slave as that is not PC !!!! )

So the controller,
how is that powered, in particular, how is that earthed to the isolator ?

Scope the input and output levels and signal shapes at the isolator, using the isolators ground on the same side as the scope reference. Do they look nice and clean ? nice voltage levels ?
The controller is powered from the +3V3_ESP and the corresponding ground (GND).
The IC1 is powered from +3V3_iso and AGND (which is also the AC neutral).

When I scope it, referenced to the GND (it's own ground) the SPI looks nice.
When I scope it, referenced to the AGND (it's own ground) I see nothing.
 

Thread Starter

tomerbr

Joined Oct 16, 2017
25
Why do you need data isolation? Just isolate the mains voltage with three small transformers instead of dividers.

By the way, your power supply needs to be rated for 400V AC (650V DC). It's no use having a three-phase monitor to tell you if the phase voltages are correct if it's going to blow up if the neutral gets disconnected!
Thank you,
The ground of IC1 is (and should according to the datasheet) connected to the AC neutral so the transformers solution is not valid (please correct me if I am wrong)
As for the power supply, if the neutral gets disconnected the AC/DC converter will stop working.
 

andrewmm

Joined Feb 25, 2011
1,751
The controller is powered from the +3V3_ESP and the corresponding ground (GND).
The IC1 is powered from +3V3_iso and AGND (which is also the AC neutral).

When I scope it, referenced to the GND (it's own ground) the SPI looks nice.
When I scope it, referenced to the AGND (it's own ground) I see nothing.
Can I check, the side on this board , the single looks bad,
the that connects off board looks good ?

Can you post plots please ?

What do the two power pins on the SPI isolator look like with reference to there own grounds ?
 

Thread Starter

tomerbr

Joined Oct 16, 2017
25
Can I check, the side on this board , the single looks bad,
the that connects off board looks good ?

Can you post plots please ?

What do the two power pins on the SPI isolator look like with reference to there own grounds ?
Sure,
I will post the plots later on.

Thanks you.
 

Ian0

Joined Aug 7, 2020
3,198
As for the power supply, if the neutral gets disconnected the AC/DC converter will stop working.
Unfortunately, that's not what happens in practice. If the system loses its connection to the real neutral, the system's neutral floats depending on the load on the three phases. If the load on the other two phases is significantly larger than the load on the phase which connects to the power supply, the neutral voltage will be much nearer to the two other phase voltages, and up to 400V from the power supply's live.
 

Ian0

Joined Aug 7, 2020
3,198
The ground of IC1 is (and should according to the datasheet) connected to the AC neutral
The phase-to-neutral voltage inputs are differential, and have to be divided down so that they are <3.7V DC.
Firstly, if you are using them as single ended the - input will have to be biassed to Vdd/2, and the + input referred to that.
Secondly, being differential, the + and - inputs are not referred to any particular ground. It seems to me that a transformer would be the easiest way of achieving that.
 

Ian0

Joined Aug 7, 2020
3,198
Thank you for letting me know about the ATM90E36. I have a circuit based on a LPC1517 that does much the same thing, but this appears to have better accuracy and won't need as much software overhead. Pity it doesn't have a CAN output or it could replace my board completely.
 
Top