# Measure the voltage on the power plug

I all,

Do you think my schema (in attachment) can allow to measure the voltage on the power plug (prise secteur)?

No.

Too many errors.

Resistor not connected on the other side. No shared reference (usually GND). No indication of what maximum voltage you expect on that connector (any voltage on the analog in should be < Vcc + 0.5V) - you probably need a voltage divider.

Why would you want to measure voltage on the mains plug ?

Thank you for your responses;

@wvmarle, this is a newby. I will try to correct the schema
ard_newbie , what I want is to measure if there is voltage or not on the power plug, to detect power cuts.

this is a newby. I will try to correct the schema

I would strongly recommend that you do not proceed with this project in its current form until you know enough about electricity so that you don't represent a danger to yourself, others, or property.

Thanks @Grumpy_Mike. So I will learn about electricity first

As said, please be careful with mains power. Your circuit is a trip to hospital waiting to happen. Use an inductive pickup on the mains cable, which will give an inductive signal whenever current flows in your cable, and that will also remove any hard connection to mains and therefore any chance of you hurting yourself.

Ah, mains power supply. Didn't realise that looking at the OP.

Your circuit would result into a big puff of smoke (that 220Ω resistor would carry 1A of current, so dissipate 220W of power - that assuming you have 220V AC on it, other common voltages won't fare much better).

A MUCH safer (and easier) way is to use an adapter (e.g. mobile phone adapter or USB power supply) that produces a 5V DC output. Plug that in to the socket you want to monitor, then check the 5V output. You can connect that to a digital pin of a 5V Arduino, or with a voltage divider to a digital pin of a 3.3V Arduino, and just read the pin. HIGH = power on, LOW = power off. Of course you'll have to use a battery to power the Arduino or it itself will be off when the power is out.

Please explain in a bit more detail what you would like to do?
Mains fail can be done by hooking up a light bulb. Light on - you have power, light off - no power. (or bulb blown)

Problem solved, why use the Arduino?

wvmarle:
Ah, mains power supply. Didn't realise that looking at the OP.

Your circuit would result into a big puff of smoke (that 220Ω resistor would carry 1A of current, so dissipate 220W of power - that assuming you have 220V AC on it, other common voltages won't fare much better).

A MUCH safer (and easier) way is to use an adapter (e.g. mobile phone adapter or USB power supply) that produces a 5V DC output. Plug that in to the socket you want to monitor, then check the 5V output. You can connect that to a digital pin of a 5V Arduino, or with a voltage divider to a digital pin of a 3.3V Arduino, and just read the pin. HIGH = power on, LOW = power off. Of course you'll have to use a battery to power the Arduino or it itself will be off when the power is out.

I agree with wvmarle, safest and easyiest way but if the mains fails what powers your Arduino?