Isolated AC Voltage Measurement with Arduino and AMC1301 Amplifier

This Arduino project shows how to measure AC voltages up to about 600 Volts using Arduino UNO board and AMC1301 differential input, differential output isolated amplifier.
With this circuit we can easily measure home phase-to-natural (230V) and phase-to-phase (400V) voltages.
A 16×2 LCD connected to the Arduino board is used to display voltage values.

No warranty is provided with this project, so do it at your own risk!
A part of the project circuit may be subjected to high voltage which is very harmful to human body, so be-careful!

AC: Alternating Current.
DC: Direct Current.
TRMS: True Root Mean Square.
ADC: Analog-to-Digital Converter

Isolated voltage measurement with Arduino and AMC1301 circuit:
Project circuit diagram is shown below.

Isolated voltage measurement with Arduino and AMC1301

All the grounded terminals should be externally connected together!

Hardware required:
This is a summary of circuit required parts (circuit schematic diagram may contain some component parameters not shown below).

  • Arduino Uno or equivalent board such as Arduino Nano
  • AMC1301 isolated amplifier   —> details
  • MCP6022 op amp   —> details
  • MCP1501-20 2.048 voltage reference   —> details
  • B0505S isolated DC/DC converter (1 or 2-Watt)
  • 1602 LCD screen
  • 6 x 1M Ohm resistor (R3, R4, R5, R12, R13, R14)
  • 3 x 10k Ohm resistor (R17, R19, R22)
  • 6 x 4.7k Ohm resistor (R6, R8, R9, R15, R16, R18)
  • 2k Ohm resistor (R7)
  • 330 Ohm resistor (R11)
  • 100 Ohm resistor (R2, R20)
  • 68 Ohm resistor (R1)
  • 10 Ohm resistor (R21)
  • 10k Ohm variable resistor
  • 10µF capacitor (C2)
  • 2 x 4.7µF capacitor (C1, C5)
  • 2 x 2.2µF capacitor (C13, C14)
  • 4 x 0.1 capacitor (C3, C6, C7, C8)
  • 2 x 1nF capacitor (C11, C12)
  • 3 x 220pF capacitor (C4, C9, C10)

Circuit description:
Before connecting high voltage signal to the Arduino board ADC input pin, it must be scaled down, isolated and filtered.
The AC voltage under measurement is connected in the circuit to VIN1 and VIN2 terminals. This voltage is then scaled down using a voltage divider circuit which consists of six 1 Mega-Ohm (R3, R4, R5, R12, R13, R14) and one 2 kilo-Ohm (R7) resistors.

The voltage divider circuit is designed so that it can reduce the input voltage to maximum of ±250mV in order to match the range of the AMC1301 isolation amplifier. For example, an input of 400V RMS will be reduced to 120mV RMS (±170mV peak).This means we can safely connect the circuit to a potential difference (voltage) of approximately 600V RMS (actually it’s about 589 Volts).

The AMC1301 from Texas Instruments is an isolated amplifier where its differential input is separated from its differential output by an isolation barrier.
Due to its low input impedance, the AMC1301 amplifier is well suited for current sensing applications where its differential input is connected in parallel with a resistor that has a very low resistance, for example shunt resistor. However, the AMC1301 can be used also in voltage sensing applications where the internal input impedance of the amplifier has to be taken into consideration.

The AMC1301 amplifier requires two power supplies, one is connected to high side (input) and the other to low side (output). The high and low side power supplies must be galvanically isolated, otherwise the isolation amplifier will have no meaning in the circuit.
The AMC1301 has a fixed gain of 8.2V/V and it is designed to measure differential signals of ±250mV with an isolated differential output of ±2.05V, it has a common mode output voltage (common mode offset) of 1.44V and a bandwidth of 200kHz.

In this project and as shown in the circuit schematic diagram above, the low side of the AMC1301 is powered with 5V which comes from the Arduino Uno board and the high-side is supplied from the isolated DC/DC converter B0505S.

The B0505S allows to get a galvanically isolated 5V source from the Arduino Uno board 5V output. I used this type of DC/DC converter because it is very available in the market with many brands, low cost, small, easy to use and requires few external components.
The B0505S has only 4 pins: 2 as inputs and the other 2 as outputs. In this project we may use B0505S-1W or B0505S-2W.

The voltage divider which converts input high voltage to low voltage is constituted of the resistors: R3, R4, R5, R7, R12, R13, R14 and the AMC1301 input impedance (VINP to VINN). The input impedance is approximately 18k Ohm and it is in parallel with R7 (2k Ohm).

So, the gain of the voltage divider can be calculated using the following equation:

Voltage-divider gain = (R7 // 18kΩ) / (R7 // 18kΩ + R3 + R4 + R5 + R12 + R13 + R14)

Voltage-divider gain = 1.8/6001.8

The differential output of the AMC1301 is connected to a differential amplifier circuit which filters the signal, applies a gain of 0.5V/V, removes the 1.44 DC offset and adds another offset of 1.024V.
The main component of this circuit is the Microchip MCP6022 dual op amp IC. It supplied with 5V from the Arduino board.

Since R9 = R18, R8 = R15 and R6 = R16 , the gain of the differential amplifier circuit (MCP6022) is:

Gain = R18/(R16 + R15) = 4.7/(2 x 4.7) = 0.5

So, the overall gain of the circuit is equal to: voltage divider gain x AMC1301 gain x MCP6022 differential amplifier gain circuit,
overall circuit gain = (1.8/6001.8) x 8.2 x 0.5 = 7.38/6001.8

This means a 230V RMS input will seen by the Arduino analog input as:
230 x 7.38/6001.8 = 282.8mV AC
So, the AC signal at analog channel input swings between about ±400mV (±√2 x 282.2) and by adding the 1.024V DC offset the signal will swing between 1.424V and 0.624V.

Before the attenuated AC signal goes to Arduino analog channel 0 (A0) it passes through an RC low pass filter which comprised of R1 and C3. The frequency of this filter can be simply calculated with this equation:
f = 1/(2 x π x R x C) = 23.4kHz

The 1.024V offset DC is just 2.048V divided by 2 using resistors R17 and R19, second op amp of the MCP6022 is used as voltage follower to get a low impedance voltage source (voltage buffer) which should not be affected by other circuit components such as R18.

I used the MCP1501-20 to get a precise voltage of 2.048V which is then used as positive voltage reference for the Arduino microcontroller ADC module. The MCP1501-20 is also supplied from the Arduino board with 5V. Its output is filtered and connected to the Arduino AREF pin.

The 1602 LCD screen (2 rows and 16 columns) is used to display the value of the input voltage, it is connected to the Arduino board as follows:
RS —> Arduino digital pin 2
E   —> Arduino digital pin 3
D4 —> Arduino digital pin 4
D5 —> Arduino digital pin 5
D6 —> Arduino digital pin 6
D7 —> Arduino digital pin 7
VSS, RW, D0, D1, D2, D3 and K are connected to GND,
VEE to the 10k Ohms variable resistor (or potentiometer) output,
VDD to Arduino 5V and A to Arduino 5V through 330 ohm resistor.

VEE pin is used to control the contrast of the LCD. A (anode) and K (cathode) are the back light LED pins.

Isolated voltage measurement with Arduino and AMC1301 code:
Project code is the one below, it was tested with Arduino Uno and Nano boards.
The code tries to calculate AC RMS signal values applied to analog channel 0. It can measure AC voltages only, when a DC voltage is applied to the input terminals it will display 0 Volts because at all times the DC (or average) voltage is deducted from the whole input voltage signal.

Simply the average (mean or DC offset) value in discrete-time is the sum of all sample values divided by number of samples:

mean value equation

And the RMS value in discrete-time can be calculated using the following equation:

RMS value equation

The Arduino uno board microcontroller (ATmega328P) has a 10-bit ADC module, the positive voltage reference is 2.048V means that a 2.048V is digitally represented by 1023 and 0V is represented by 0 (1 digit for every 2mV).

Finally, the following short video shows a test of hardware circuit under 230V AC (phase-to-natural):

One comment

  1. very nice tutorial can you do a project on ac current measurement using current readily available sensor in the market thanks

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.