Skip to content

DHAB S/134 - Driver Reference (C Implementation)

LEM Automotive Current Transducer, Open Loop Hall Effect
Document version: 15 February 2016 / v2


1. Overview

Dual-channel Hall-effect current transducer. Each channel produces a ratiometric analog voltage output proportional to the primary current. No digital interface - the driver must read ADC values and convert them to amperes.

ChannelRangeSensitivityUse case
CH1±50 A40 mV/AHigh-accuracy low current
CH2±200 A10 mV/AWide-range high current

2. Electrical Characteristics

Power Supply

ParameterMinTypMaxUnit
Supply voltage (Uc)4.755.05.25V
Current consumption (Ic)-1520mA
Max output current (Iout)-1-1mA
Load resistance (RL)10--
Capacitive load (CL)1-100nF

Output Clamping Voltages (both channels, @ Uc = 5 V)

LimitMinTypMaxUnit
V_sz low0.20.250.3V
V_sz high4.74.754.8V

Driver note: Any raw ADC reading at or near these clamp levels indicates saturation / over-range - flag accordingly.

Output Internal Resistance

MinMaxUnit
110Ω

Frequency Bandwidth

ValueCondition
278 Hz@ −3 dB

Timing

ParameterMaxUnit
Power-up time1ms
Setting time after overload (ts)10ms

3. Conversion Formula

The output voltage is fully ratiometric - both offset and sensitivity scale with Uc:

Ip = (5/Uc) × (Vout − Vo) × (1/G)

Where:

  • Ip - Primary current to compute [A]
  • Uc - Actual supply voltage [V]
  • Vout - Measured output voltage [V]
  • Vo - Offset voltage = Uc / 2 at Ip = 0 [V]
  • G - Sensitivity [V/A]

Channel-specific constants

SymbolCH1CH2Unit
G0.0400.010V/A
VoUc/2Uc/2V
Ipm±50±200A

4. C Implementation

c
#include <stdint.h>
#include <stdbool.h>

/* ── Compile-time constants ────────────────────────────────── */
#define DHAB_UC_NOMINAL_V       5.0f   /* Nominal supply [V]           */
#define DHAB_G_CH1_V_PER_A      0.040f /* Channel 1 sensitivity [V/A]  */
#define DHAB_G_CH2_V_PER_A      0.010f /* Channel 2 sensitivity [V/A]  */
#define DHAB_CLAMP_LOW_V        0.30f  /* Output clamp low  [V]        */
#define DHAB_CLAMP_HIGH_V       4.70f  /* Output clamp high [V]        */
#define DHAB_IRANGE_CH1_A       50.0f  /* CH1 measuring range [A]      */
#define DHAB_IRANGE_CH2_A       200.0f /* CH2 measuring range [A]      */

/* ── Return type ────────────────────────────────────────────── */
typedef struct {
    float   current_A;    /* Computed primary current [A]        */
    bool    saturated;    /* true if output is clamped / invalid */
    bool    out_of_range; /* true if |current_A| > channel range */
} dhab_result_t;

/* ── Core conversion ────────────────────────────────────────── */
/**
 * @brief Convert a measured output voltage to primary current.
 *
 * @param vout_V   ADC-measured output voltage [V]
 * @param uc_V     Actual supply voltage [V] (measure if possible; use 5.0 if not)
 * @param g_V_per_A Channel sensitivity: DHAB_G_CH1_V_PER_A or DHAB_G_CH2_V_PER_A
 * @param range_A  Full measuring range: DHAB_IRANGE_CH1_A or DHAB_IRANGE_CH2_A
 * @return dhab_result_t
 */
static inline dhab_result_t dhab_convert(float vout_V,
                                          float uc_V,
                                          float g_V_per_A,
                                          float range_A)
{
    dhab_result_t r = {0};

    /* Saturation detection */
    r.saturated = (vout_V <= DHAB_CLAMP_LOW_V) || (vout_V >= DHAB_CLAMP_HIGH_V);

    /* Ratiometric offset: Vo = Uc/2 */
    float vo_V = uc_V * 0.5f;

    /* Ip = (5/Uc) * (Vout - Vo) / G */
    r.current_A = (DHAB_UC_NOMINAL_V / uc_V) * (vout_V - vo_V) / g_V_per_A;

    /* Range check */
    float abs_i = (r.current_A < 0.0f) ? -r.current_A : r.current_A;
    r.out_of_range = (abs_i > range_A);

    return r;
}

/* ── Channel 1 helper (±50 A) ──────────────────────────────── */
static inline dhab_result_t dhab_read_ch1(float vout_V, float uc_V)
{
    return dhab_convert(vout_V, uc_V, DHAB_G_CH1_V_PER_A, DHAB_IRANGE_CH1_A);
}

/* ── Channel 2 helper (±200 A) ─────────────────────────────── */
static inline dhab_result_t dhab_read_ch2(float vout_V, float uc_V)
{
    return dhab_convert(vout_V, uc_V, DHAB_G_CH2_V_PER_A, DHAB_IRANGE_CH2_A);
}

ADC to Voltage (adapt for your platform)

c
/* Example: 12-bit ADC, 5 V reference */
#define ADC_RESOLUTION   4096u
#define ADC_VREF_V       5.0f

static inline float dhab_adc_to_voltage(uint16_t adc_raw)
{
    return ((float)adc_raw / (float)ADC_RESOLUTION) * ADC_VREF_V;
}

5. Accuracy Reference

Channel 1 Accuracy (absolute, in Amperes)

Condition−40 °C−20 °C0 °C25 °C65 °C125 °C
@ 0 A0.350.290.230.150.230.35
@ ±20 A1.200.980.770.500.781.20
@ ±50 A1.501.251.010.701.021.50

Best accuracy occurs near 25 °C. Worst at temperature extremes (−40 °C / 125 °C).

Sensitivity Error

ConditionTypical
@ 25 °C±0.4 %
−10 °C < T < 65 °C±1.0 %
−40 °C < T < 125 °C±1.5 %

Offset Current (CH1)

ConditionMinMaxUnit
@ 25 °C−0.150.15A
−10 °C to 65 °C−0.230.23A
−40 °C to 125 °C−0.350.35A

Linearity Error (both channels)

ConditionTypical
@ 25 °C, Uc = 5 V, full range±0.5 %

Output Noise (both channels)

ParameterMinMaxUnit
V_no_pp (peak-peak noise)−1010mV

Driver note: At CH1 sensitivity of 40 mV/A, 10 mV noise ≈ 0.25 A resolution floor. Apply a low-pass filter or oversample if higher resolution is needed.


6. Operating Temperature

ModeRange
High accuracy−10 °C to +65 °C
Reduced accuracy−40 °C to +125 °C

7. Absolute Maximum Ratings (do not operate at these)

ParameterValueUnit
Max supply voltage±14V
Storage temperature−40 to +125°C
ESD (IEC 61000-4-2)8kV
Insulation voltage (AC, 50 Hz, 1 min)2.5kV
Max output current±10mA
Output short-circuit max duration120s

8. Power-Up Sequence Notes

  • Allow ≥ 1 ms after supply stable before sampling output.
  • After an overcurrent / overload event, wait ≥ 10 ms (ts) before trusting readings.
  • Ratiometric formula requires Uc to be measured or well-regulated; a 5 % Uc error causes a proportional current error.

NetComponentValue
Uc supply decouplingC100 nF
CH1 output filterC68 nF
CH2 output filterC68 nF
Primary current senseC47 nF

Place capacitors close to the sensor connector. Load resistance RL ≥ 10 kΩ on each output.

Released under the MIT License.