# Determining the difference between AC and DC voltage and sending the vltage to an ADC or Microcontroller.

#### Thomas Swan

Joined Jan 7, 2021
4
Looking to see if anyone has done something similar to this. I have thought about using a relay controlled by incoming voltage, so that if AC is present it latches the relay and then puts the voltage through the required circuit to read the AC voltage, if the voltage is not AC then path of voltage is through the required circuit to read DC.

#### Papabravo

Joined Feb 24, 2006
21,031
I can think of no practical application for this process. AFAIK there is no such thing as an androgynous voltage source. The closest thing I can imagine is an AC source with a DC offset.

#### Ya’akov

Joined Jan 27, 2019
8,975
Welcome to AAC.

If the connection for the DC has a definite polarity any reversal of that polarity would indicate either an error or AC.
You should be able to take advantage of that to decide if it is DC or AC.

Joined Jul 18, 2013
28,534
Use an opto isolator, which will detect polarity on its input, the output would go to the Micro.
Opto to only conduct when AC.

#### LowQCab

Joined Nov 6, 2012
3,960
What You want is an Auto-Ranging-Oscilloscope, ( if there were such a thing ).
.
.
.

#### Thomas Swan

Joined Jan 7, 2021
4
The reason behind building this device is to make a small stand-alone device that will read multiple voltages and display them for troubleshooting (up to ten different voltages).

Depending on where you plug into the system, there are different voltage sources. Sometimes AC, sometimes it's DC.

I have built the circuits to measure either the DC or AC and convert/send to Microcontroller. I'm in the process of engineering a device to auto detect what type of voltage.

#### Thomas Swan

Joined Jan 7, 2021
4
Welcome to AAC.

If the connection for the DC has a definite polarity any reversal of that polarity would indicate either an error or AC.
You should be able to take advantage of that to decide if it is DC or AC.
I might could use a notch filter at 60hz. Use that to activate the circuit.

#### joeyd999

Joined Jun 6, 2011
5,188
Digitize and FFT the input signal. All AC and DC (within the bandwidth of the sampled signal) info can then be extracted and displayed.

Easy peasy.