Knowledge Base

The HMI430/700 has two analog inputs. They can each be set to measure voltage, with 0-10V range and a 0-3.3V range, 0-20mA current and temperature using an external NTC thermistor.

Mode setting

The two red jumpers in the picture above set the analog input mode. The bottom one is for analog input 0, the top one is for analog input 1. Notice there are 3 positions labelled ‘V’, ‘I’ and ‘T’. The mode is determine by which pair of pins the jumper sits across.

Jumper positionMode
TThermistor temperature measurement mode
I0-20mA
V0-10V
No jumper0-3.3V

 In the picture above analog input 0 is set for temperature, and analog input 1 is set for 0-10V.

Connections

In both voltage and current modes, the pin labelled i0 or i1 must be positive with respect to the 0V pin. The picture above shows a battery connected to i1 so its voltage can be measured. Not the + polarity sign.

For current mode this means that a typical 2-wire 4-20mA transmitter will connect between the input pin (i0 or i1) and the positive supply voltage. The full scale voltage drop (“burden voltage”) in current mode is 3.3V

In thermistor mode and NTC thermistor simply connects between the input pin and 0V. The controller is optimised for thermistors with a resistance at 25°C of between 5K and 10K Ohm, but can be used with other resistances at reduced resolution.

More on temperature measurement

Thermistor temperature measurement is a great way to go for temperatures in the range -50°C up to 120°C or more. Dollar for dollar thermistors provide the best accuracy and require very little in the way of special electronics (compared to thermocouples or RTDs). They have one drawback: they are very non-linear, so you need to do some math to get from a raw reading to an actual temperature value. Fortunately, we have made it really easy for you with the thermistor hash command.

The fixed excitation resistor in the HMI430 thermistor circuit is 5765Ω. You will generally get the best results, i.e. resolution, if you pick a thermistor with around 5K – 10K resistance at the temperature you are mainly interested in.

Example: Measure in °C the thermistor connected on analog input i1. The thermistor data is:

  • R25   5k Ohm (resistance at 25°C)
  • Beta   3988
  • Required measurement range 0 – 60°C (32 – 140°F)

In your program you would include the following line of code:


fAnIn 1 ;reads the analog value on i1
#Thermistor Params(5000,3988) Feed(3.3,3.3,5765) RangeC(0,60) Order(5) ;convert to °C

Floating point register W now has the temperature in °C. To convert to °F:


fLoadW 1.8 ;convert to °F by using F = 1.8 * C + 32
fMul
fLoadQ 32
fAdd

The temperature in °F is now in floating point register W.

For more on thermistor temperature measurement see the full description of the #Thermistor command here.

Because the HMI430 has an awesome 12-bit analog resolution, you can also use the thermistor mode with a PT1000 (don’t try a PT100, though). Expect to get about 1°C resolution.

Measuring a potentiometer

You could also use “T” mode to measure a normal potentiometer.  “T” provides 3.3V via 5765Ω, so if you have a 10kΩ pot, the maximum voltage you’ll get is:

   10000/(5765 + 10000) = 0.634
0.634 * 3.3 = 2.09V

In fact, we don’t need the actual voltage, 0.634 is actually the maximum value you’ll get from fAnIn.  So for this example, fAnIn will return 0.0 thru 0.634 over the entire travel of the potentiometer.

4-20mA measurement

In ‘I’ mode the analog input range is 0-20mA. This means that for 4-20mA measurement you need to calculate out the 4mA offset. That’s quite simple with the HMI430’s floating point instructions. The advantage is that by going to 0mA you have the possibility of detecting a broken input wire.