AC current sensor
Main Article: current sense
AC current sensing can be performed with a special "current sense transformer". These sensors create an output current based on the current passing through a conductor.
Like Hall-effect current sensors, transformer-based current sensors are non-contact.
A current sense transformer is a kind of transformer, with the (output) secondary wire passing through the magnetic core many times, and the (input) primary wire typically passing through the magnetic core once (a "single-turn transformer").
AC voltages are normally reported as RMS. (root-mean-square). For sinusoidal waveforms, this is (peak voltage)/(sqare root of 2). Thus to determine the peak voltage that your system will see, you need to take the maximum steady state current and multiply it by (square root of 2).
The current sensed is turned into a voltage through the use of a burden resistor. These are chosen based on the current to be sensed, and the characteristics of the current sense transformer in use. As an example, using the CR Magnetics CR3110-3000 transformer, you can examine the data sheet PDF to see the approximate size of the resistor to use. Assuming that your sensing circuit will handle 0-5V, you can determine the size of the resistor. Suppose we are monitoring a 20A circuit. The output signal should be between 0 and 5 volts. Since we'll be monitoring the peak value, we need to determine the value of the resistor accordingly. So, (5 volts) / (square root 2) is about 3.53. We need to choose the resistor to create a steady state voltage of about 3.53 volts at 20A. Checking the data sheet's plot, we can see that 510 ohms is about right. There is a formula given if we need a better estimate. A current transformer will be damaged without a burden resistor; always hook the current transformer to it's associated burden resistor before putting the transformer into a live circuit!
Another example: SeeedStudio "Non-invasive AC current sensor (100A max)"
The voltage from the sensor is AC. To convert it to a DC voltage for a A/D converter, we can use a full wave bridge. When we do this, we will end up with (in the US), a 120Hz waveform. The A/D will convert this signal at some discrete point in time. At that point, it will have a value between 0 and 5V. So, a program must either repeat the conversion many times for more than 1/120 second and take the maximum reading (don't forget to divide by the square root of 2), or you must use a 'peak hold' circuit.
The current sense transformer detailed above is suitable for low frequencies (i.e. powerline). For higher frequencies (such as RF), another approach must be used.
There are several ICs, made by Cirrus logic, e.g. CS5460 etc. that calculate the power and amperage of circuits. See their application notes. Results are reported via an I2C connection.
Other approaches to measuring AC current (and DC current) are discussed at current sense.