Arduino - AC Main Frequency Monitor

Hi, this is my first time, so please, be gentle!

WARNING: Working with AC voltage can be lethal. If you don't know what you 're doing please don't try this.

I've had in mind developping a monitor system, for my emergency power, consisting of 4 6V batteries and a power inverter to generate 110V AC at 60Hz. I do have a good idea on how to do it, but I'm nowhere near of starting it -yet.

Also, I've been thinking on how to be able to monitor frequency, as accurately (and cheap) as possible. The winning idea was to use a wall transformer (110VAC in 12VAC out) to drive an optocoupler which in turn drive an input pin on the arduino. The rational:

AC current will cycle from + to - and when in its possitive cycle it could lit the led on the optocoupler, closing its output. It will happens once per cycle. If we count anough pulses, if we divide the number of samples (pulses) by the time it took, that will render the frequency.

I used a voltage divider to drop the voltage to a level workable for the optocoupler. and a pull down resistor to make sure to have a know state for the input pin. The wall transformer leads connect to the lower power rails.

Assembly List

Label Part Type Properties

Parte1 Arduino Uno (Rev3) Tipo Arduino UNO (Rev3)

R2 100kΩ Resistor

R3 12kΩ Resistor

R4 12kΩ Resistor

U1 Optocoupler part 4N35

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

First Time Author Contest 2016

Participated in the
First Time Author Contest 2016

Sensors Contest 2016

Participated in the
Sensors Contest 2016

Be the First to Share


    • CNC Contest

      CNC Contest
    • Make it Move

      Make it Move
    • Teacher Contest

      Teacher Contest

    4 Discussions

    Eric Brouwer

    3 years ago

    Thanks for sharing.

    Remember, the opto-coupler input (pins 1 & 2) are actually connected to an internal LED. Thus, you do not need a voltage divider. You only need a single current limiting resistor.

    1 reply
    mholguin-verasEric Brouwer

    Reply 3 years ago

    Yes indeed!!! I can give a thousand explanations, truth to be told, I'm still learnig and trying to grasp the concepts (voltage, current, comsumption, wattage, capacitance, reactance....)

    Thanks!! Will try that!