Convert 16Vac into 5Vcc

Hi,

For a personal project I'm developing using Arduino Nano, I need to detect in a digital pin if a 16Vac line is active or not.

  • 16Vac -> Pin HIGH
  • 0Vac -> Pin LOW

I've read that I can get it with a simple circuit using an optocoupler 6N137 (or similar).

Is this the best and simply solution?
Which circuit I need to apply?

I've found several circuits on google but unfortunately i don't have enough knowledge to determine which may be more suitable in this case.

Thanks in advance!
Best regards,

Gerard

You could use just a 100K resistor connected in series to the input. The AC detection could work similar to here.

6N137s would work, but you need to add a bridge rectifier to detect AC.

The PC814 is designed to detect AC, you need only one resistor to limit the LED current. You connect the output transistor between an Arduino input and ground with the pin set to INPUT_PULLUP.

Note however that whichever you use, the zero crossings will interrupt the signal so it will pull the input LOW for most of the AC cycle, but go HIGH at each zero crossing - you have to code to check every few milliseconds ("polling") and determine that the AC is off if the input reads HIGH for a number of successive checks.

Following your comments I will try the following hardware solution (combined with polling):

https://tinyurl.com/y2k8aab7

Thank you for all responses, now I have a clear idea about how to achieve my proposal.

Best regards!

Gerard

For 16V AC I'd use a diode (half wave rectifier), smoothing cap, and fairly high value (100-200k total) voltage divider to bring the ~22V peak down to ~4-4.5V. Simple and cheap, no zero crossings to deal with, and sufficient isolation for such a low voltage.

Depends on what we are not told - whether the 16 V AC supply does or can share a common ground with the Arduino. :astonished:

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.