2

I would like to measure a phase controlled 240Vac waveform as a digital PWM input for an arduino. The signal would look something like this:

enter image description here

My intent was to use a zener clipping circuit to limit the positive portion of the waveform to 5V, and measure that signal. However, I want to make sure I'm properly grounding these items. This is what my proposed circuit looks like, with all components inside a metal chassis.

enter image description here

I feel like ideally I would isolate this waveform from the system controller/light with a 1:1 transformer, but I'm unsure if that is feasible given its irregularity. Can I safely connect the arduino ground to the system's neutral, or am I barking up the wrong tree?

Thanks!

mrmojo6
  • 45
  • 4

2 Answers2

0

You shouldn't really connect the mains direct to the Arduino like that - even with a zener. The potential for disaster is somewhat large.

Instead you should galvanically isolate the mains from the Arduino. I would use something as simple as an opto-isolator:

schematic

simulate this circuit – Schematic created using CircuitLab

Make sure that R1 is rated for at least 339V and can dissipate enough power (1W). The resistance of R1 needs to be small enough that the opto-isolator triggers properly, yet large enough that you don't need a great honking heater of a resistor to cope with the power. 150K seems a reasonable compromise.

D2 is needed to prevent the LED In the opto-isolator from being reverse biased with 339V in the reverse-swing portion of the waveform.

You can incorporate your zener as well if you want to "push down" the waveform to get a lower cross section of it (clip off the upper portion) instead of just reducing its amplitude:

schematic

simulate this circuit

In this R1 is the same as the resistor you were planning to use before. The added R3 resistor is to limit the current through the LED (drop the 5V to the LED forward voltage at a suitable current for the LED).

Majenko
  • 105,851
  • 5
  • 82
  • 139
0

your circuit will work, and can be simplified a little bit further. But it will work.

it is safer to use isolation, however. there are multiple ways to go about doing it.

the key here is to detect zero crossing, and start counting from there.

dannyf
  • 2,813
  • 11
  • 13