Let me begin with an example, which is well known by everyone. It is the public lighing. Its scheme is show below.
At sunset, when it is becoming dark, the public lighting turns on, and when the sun is rising, it turns off.
The sunshine is sensed by a light sensor, which serves an electrical signal propotional to the ambient light intensity. When this electrical signal falls below a certain point, the measuring unit decides to turn on the lights.
Public lighting scheme
In this article I will focus on the sensor’s inside, how it works, and what if we want to measure other types of physical properties, eg. pressure, temperature or rotation.
Normally, a sensor (transmitter show non the picture below) needs supply voltage, which means 2 wires, and provides an output, which needs an additional wire. This way a sansor is connected to the measuring unit through a 3 wire cable.
One option for the transmitter is to generate a voltage at its output. This output is in linear relation with the measure physical value.
3 wire, voltage output transmitter
Other option is to generate a current output, which lacks the voltage divider, and noise issues. Current based signals can be transmitted over much longer distances compared to voltage signals.
The most common current signals are: 0-20 mA and 4-20 mA currrent loops. These signals usually flow through a resistor. This way a voltage is present at this resistor, and the A/D converter measures this voltage.
The huge advantage of the 4-20 mA signals is the possibilitiy to detect cabling errors. If the measured current is 0 mA, then one of the wires is disconnected.
3 wire, current output transmitter
3 wire transmitter electronics
At first, let’s see a simple light measuring circuit.
The photodiode senses the ambient light, which generates a current flow through it. This current goes into an active current-to-voltage converter formed by U1B. The output of U1B is simply amplified by U1A to generate a 0-10 V signal propotional to the light intensity.
If this light transmitter generates a current at its output, then a voltage to current converter must be applied as shown below.
The simplest voltage to current converter consists of an operational amplifier (U1), a MOSFET (Q1) and a current sense resistor (R1). The op. amp gets the control voltage (0-2V) to its noninverting input and drives the MOSFET until the voltage across the sensing resistor exactly matches the input (control) voltage.
A few additional elements must be added to the circuit for improved protection and stability. D1 protects against overvoltage, R2 reduces the op. amp’s capacitive load, while C1 slows down the regulation loop.
The main disadvantage of the upper two circuits is that they generate „up side current”, so the load resistor (RL) cannot be grounded.
Some modifications must be made to solve this.
The schematics shown above illustrates this „trick”. The input voltage is referred to ground. With U1A, Q1 and R1-R2-R3, this voltage falls across R1, but now it is referred to the positive power supply voltage. This voltage controls U1B (the voltage to current converter) which then generates a corresponding output current. R1, R2 and R7 must be tight tolerance types (0,1% or better) to achieve high accuracy.
An alternative of this circuit is made of a difference amplifier, but the principles are the same.
Current loop receiver circuit
Just a few words about the current loop receiver circuit: the measured current flows through a resistor (R1) thus a voltage is present at the input of the op. amp. The capacitor (C1) is for high frequency attenuation, Z1 zener diode limits the maximal voltage across the resistor, protecting the additional electronics this way.
Z1: 2,7V zener, for maximal precision R1 should be 0,1% tolerance.
2 wire transmitter electronics
The wiring cost can be high if the distance between the measuring unit and the transmitter is long. We could reduce this if we use 2 wires instead of 3. This scheme is called 2 wire current loop, where 2 wires carry both the power and the measured signal. Its standard signal level range is 4-20 mA.
Staying with the light measuring example, if we sense no light the transmitter consumes 4 mA, while, at midday, at full sunshine it consumes 20 mA. So the actual current flowing through the transmitter is propositional to the measured physical value.
The picture below shows the very basic components needed to form a 2 wire transmitter.
U2 is a linear regulator, it produces a fixed voltage to the internal electronics. U1A buffers the measured input voltage and drives U1B through R1. R2 creates the 4 mA initial current, R3 senses the output voltage (propotional to the output current) that falls across Rsense. Q1 is actually the current generator element.
The simplified equations for this circuit are the followings:
For 0V input (4 mA output current): Vs / R2 = 0.004 * Rsense / R3, where Vs is the internal supply voltage (5V shown in the picture above).
For 5 V input (20 mA output current): Vinput / R1 + Vs / R2 = 0.020 * Rsense / R3.
The simplification is based on: R3 >> Rsense.
In order to calculate its elements’ values, some initial conditions must be settled.
We must choose the values of Rsense, R3 and Vs.
For example let Rsense be 10 Ω, R3 = 10kΩ and Vs = 5V, with these values all the other componets can be determined.
Care must be taken to choose a low quiescent current type linear regulator (U2) and low power, single supply, dual opamp (U1).
With all these informations, let’s see how a rotation to current transmitter looks like inside.
B1 is a simple diode bridge, it is for reverse voltage protection.
Setup: turn P1 to the lowest position, then set P3 in order to measure 4 mA in the current loop.
After this, turn P1 to the highest position, then set P2 to make 20 mA flow in the loop.
With this, turning P1 casuses current flowing linearly propotional between 4 and 20 mA.
If you want reduced potmeter travel (for example not the entire 270˚ rotation, just 90˚) repeat the 4 mA setup (shown above), then set P1 to 90˚, and then adjust P2 to measure 20 mA in the current loop.