Detecting AC voltage

Is it possible to make the following with any of the arduino’s?

1 input → measure the voltage (AC 48-230V)
24 inputs → detect if there is a voltage (AC 48-230V)

the 24 inputs i dont care what the voltage is, but i need to see if it is “up” with an AC input (the AC input can change depending on the state of the machine), but all i need to monitor is wether it is giving an voltage > 0V

Can you convert the voltages to be measured into the range 0 - 5V DC ? If so then you can do what you require with an Arduino Mega

I don't want to use 24 transformators because of size limitation.

Maybe i could use a rectifier folowed by a 5V zener circuit? if i'm correct that would make the input 0 or 5V?

For the 24 inputs, Opto Isolator is the correct solution for your purpose, as I can see a it is a AC supply of 48 to 230V, I suggest to use a bridge rectifier (400V) which gives you some sort of pulsating DC, the just use resistor for voltage drop, and connect it to cheap optocoupler from Vishay or Farichild. The transistor side of the optocoupler connect to 5V power supply on which your Arduino board can monitor it. You get a high when AC Voltage is present and a low when AC Voltage is not present.


you can use HCPL-7520 linear optoisolator for measure the voltage (AC 48-230V).

dear concern,

how to solve this error?

emon_sketch.ino:1:44: fatal error: EmnLib.h: No such file or directory
compilation terminated.
Error compiling.

I'm compile this sketch..

#include "EmnLib.h" //include emn library
EnergyMonitor emon1; //vreate an instant

void setup() {
Serial.begin(9600); //voltage : input pin, calibration, phase_shift

emon.voltage(2, 234.26, 1.7);


void loop() {
emon1.calc(20, 2000); //calculate all no of crossing, time-out
emon.serialprint(); //print out all variable


anyone can help me..

Where is the EmnLib.h file located ?