# Analog Interfacing

Time to plan to interface to the  Arduino. The constraint is that the inputs can only be 0-5 volts.  So no negative voltages.

Measuring the Line Voltage
I am using a 9VAC 1.5A wall wart to step down the voltage. To shift voltage into a 0-5 range, I used the following circuit. All I have is a digital multi-meter that measures true RMS. Open circuit measured came in at 10.5 Vrms.  I assume it is  sinusoidal so the peak-to-peak voltage is $10.5(\sqrt{2})=14.8 Vp-p$

The plan was to shift that into a 2.5Vp-p centered around 2.5V which will give me the required 0-5V. A 2.5 voltage reference zener diode was used to shift the voltage up 2.5 volts. The potentiometer was used to tweak the RMS voltage to $\frac{2.5}{\sqrt{2}}=1.77 Vrms$

Measuring Current
Current measurement followed  similar approach. The current transformer with a resistor in placed across the terminals produces a voltage proportional to the current. The spec sheet for the CR8459-2000-N states that the voltage is defined as $V = \frac{IR}{T_e}$ where $T_e$ for this CT is 2011.

It would be difficult to test this in the panel installation so max current, I,  at 7.2 amps for the bench. I will need to debug stuff and will change the current to 100A when I stuff it in the panel. Note I need to do this circuit twice since I have 2 100 Amp measuring points. So solving the formula for R and setting I =7.2 and V=7.2 and using the given $T_e$ we get $R=\frac{VT_e}{I} = \frac{(7.2)(2011)}{7.2}=2011 \Omega$

The diagram below shows how the current measurement was interfaced. Again the potentiometer was used to tweak the  RMS voltage to $\frac{2.5}{\sqrt{2}}=1.77 Vrms$ The R or potentiometer value will change to value of $145 \Omega$ when I permanently mount the current transformer to reflect a higher current range.