Arduino Voltmeter 0-5V Without LCD

Good afternoon,

I am looking to create the simplest voltmeter possible, without LCD. I just require my Arduino to check if there is voltage or not. Can I simply hook up my input voltage to two pins on the board? If so, where and how can the Arduino output the results to my computer, is it through a sketch?

To elaborate, I have a AC to DC converter which outputs 5v, I want to recognize when there is a power cut. So if the Arduino recognizes voltage at the pins, it can conclude that power is present. If not, then there is a power cut.

Sorry if this post is really basic, but I am new to the concept and need help.

Your time is greatly appreciated, thank you,

Alex

What do you require the PC to do when the power fails and the Arduino signals to it ? What is going to power the Arduino when the power fails ?

By the way, is the PC a laptop ?

I require the PC to shut down to prevent hardware damage. The Arduino will still have power with no problem at all. I am using a home made UPS which allows the computer to stay turned on when the power fails, but not a way to shut it down before the batteries run out. So the computer will stay powered along with the Arduino; I am using a desktop computer. I am just using the AC to DC converter as a way to tell if the power fails in the grid power socket.

This is not my problem, I still require some assistance with how to construct a simple voltmeter. A way for the Arduino to recognize if the power fails. So lets say that I have a positive and ground of 5V, how can I create an input that recognizes a loss of voltage to be used in later calculations/purposes? I am new to Arduino sketches and would appreciate some references to code/other threads.

Thanks again,

Alex

Just monitor that 5 V signal with one of the digital pins. When it goes from HIGH to LOW, the power is gone. Just make sure to power the Arduino from a different power source!

Since your AC-DC converter has a +5 V output the Arduino will recognize that has a logic high or one. Connect the converter output to an Arduino digital pin through a resistor, between 1K to 10K, then monitor the pin in your sketch for a change from high to low. The resistor is just to protect the Arduino pin from programming mistakes. Should the pin be erroneously set to output a logic 0 high currents will damage the Arduino.

Due_unto: The resistor is just to protect the Arduino pin from programming mistakes. Should the pin be erroneously set to output a logic 0 high currents will damage the Arduino.

Or when the power comes back on with the PC and Arduino still off.

Thanks a million!

My sketch works and outputs 0 when AC to DC converter turned off, and vice versa. You have helped me a lot during my early experience with the Arduino.

Have a good one! :grin: