Go Down

Topic: Prototype PMU: measure phase difference of two sine waves using arduino (Read 1 time) previous topic - next topic

sudiptakar484

Code: [Select]
if (data_available == true);
Lose the ; that makes the if statement not work.
after removing the ; there is no output on serial monitor

cattledog

Quote
after removing the ; there is no output on serial monitor
Your zero cross interrupt is not being triggered. We are now back to hardware, and what you have for an input signal to the interrupt pins?

You chose not to use the optocoupler for zero cross detection. You have not demonstrated that you have applied the direct signal reading method correctly. Please post a sketch of your circuit.

sudiptakar484

Your zero cross interrupt is not being triggered. We are now back to hardware, and what you have for an input signal to the interrupt pins?

You chose not to use the optocoupler for zero cross detection. You have not demonstrated that you have applied the direct signal reading method correctly. Please post a sketch of your circuit.
This is the circuit I have used, please check this

Grumpy_Mike

1) The 1M resistors are way to high to correctly trigger the logic inputs.

2) You have no protection for negative voltages. I would check those pins still work. Enable the pull up resistors, disconnect that circuit and dab a ground wire on both the inputs and see if you get printing.
 
3) The timing between those two signals do not in any way indicate any sort of phase shift. So there is nothing to measure except the small time between the two signals reaching the triggering threshold when and if you get them triggering.

sudiptakar484

1) The 1M resistors are way to high to correctly trigger the logic inputs.

2) You have no protection for negative voltages. I would check those pins still work. Enable the pull up resistors, disconnect that circuit and dab a ground wire on both the inputs and see if you get printing.
 
3) The timing between those two signals do not in any way indicate any sort of phase shift. So there is nothing to measure except the small time between the two signals reaching the triggering threshold when and if you get them triggering.
then how can I proceed further, I followed the AVR application note, as per the note the clamping diodes will clamp voltages within 0-5 V.  help me please

Grumpy_Mike

No you didn't that note is only for experts it is not a beginner's guide. There is a lot you have to understand. First exactly what phase shift do you want to measure?

sudiptakar484

No you didn't that note is only for experts it is not a beginner's guide. There is a lot you have to understand. First exactly what phase shift do you want to measure?
I want to measure the phase difference between the voltage and the current waveform

Grumpy_Mike

Then use a circuit that will give you a zero crossing signal for current and for voltage. That is two measurements not just one.

Have a look at the https://openenergymonitor.org site.

sudiptakar484

If I want to measure the ac voltage and ac current magnitude using hall sensors, how to do that?

Grumpy_Mike

A hall sensor will only measure current it will not measure voltage.
Hall current probes only work for large currents, how much current do you have?

Did you get to this page:- https://learn.openenergymonitor.org/electricity-monitoring/ac-power-theory/introduction

Or even this page https://learn.openenergymonitor.org/electricity-monitoring/ctac/how-to-build-an-arduino-energy-monitor

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy