# Measuring phase shift between current and voltage with microcontroller

I am trying to understand how this design is used to measure phase shift between current and voltage of an AC signal. From my understand there should be a PWM signal generated on the output. Resistors R3 and R4 are there to drop the 12 V output of the OP amp to 5 V. Resistor R2 is limiting the current through the diodes D1 and D2. However, I do not understand how the voltage drop on R1 and R5 is phase shifted by the same phase as the current and voltage of the source V1. Can someone please explain that?

simulate this circuit – Schematic created using CircuitLab

UPDATE: Schematic has been corrected.

• On your circuit, it is not. You are missing the load. – Edgar Brown Nov 13 '18 at 17:32
• What load, please explain? – user1949350 Nov 13 '18 at 17:40
• The only current coming out of your source comes from the measurement setup. Nowhere else. – Edgar Brown Nov 13 '18 at 17:42
• Can you please explain it simpler. Where would you add load and why? – user1949350 Nov 13 '18 at 17:44

From my understand there should be a PWM signal generated on the output.

Yes, the pulse width being the difference in phase.

Resistors R3 and R4 are there to drop the 12 V output of the OP amp to 5 V.

Correct.

Resistor R2 is limiting the current through the diodes D1 and D2.

Correct.

However, I do not understand how the voltage drop on R1 and R5 is phase shifted by the same phase as the current and voltage of the source V1. Can someone please explain that?

It isn't. The schematic is not correct. One of the transformers should be monitoring the supply voltage so it should be directly across the supply. The other transformer should be monitoring the supply or load current so it should be in series with the load - and there is no load in the schematic!

Once the transformer problems are addressed the rest should work.

Safety: remove the primary-secondary link at the bottom of XFMR2.

simulate this circuit – Schematic created using CircuitLab

Figure 1. Modified schematic showing load connection point.

Note that the load current goes through the CT - usually one or a few turns. I've shown the current path in thicker lines.

• Can you please look at the corrected schematic and check if it is correct now? – user1949350 Nov 13 '18 at 17:57
• That looks OK now except that R9 is a very high value for the load. What are you actually trying to do and what type of CT do you have? Pop all the information into your question. It's usually a good idea to add an update note to your post to explain the changes otherwise it can make the answers and comments prior to that look totally irrelevant. – Transistor Nov 13 '18 at 18:00
• Just experimenting. This might sound odd, but I still do not understand what the load is exactly doing. I need to read up phase shifting. – user1949350 Nov 13 '18 at 18:09
• Un-accept the answer then until you are fully satisfied. It will encourage others to post answers and you may get some other insights. Your question title says, "Measuring phase shift between current and voltage ..." so you need to monitor the current through your light-bulb, AC motor, fluorescent lamp or whatever it is you are checking the phase-shift of. Usually this will be an inductive or capacative load and usually of several amperes up to thousands of amperes. The 10k resistor would only pass 23 mA at 230 V so that was a clue that you were missing some understanding. – Transistor Nov 13 '18 at 18:15
• I was interested in testing the phase shift of my network supply. Then I would simply add a resistor in order not to add any additional phase shifting, correct? – user1949350 Nov 13 '18 at 18:26