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.
| Channel | Range | Sensitivity | Use case |
|---|---|---|---|
| CH1 | ±50 A | 40 mV/A | High-accuracy low current |
| CH2 | ±200 A | 10 mV/A | Wide-range high current |
2. Electrical Characteristics
Power Supply
| Parameter | Min | Typ | Max | Unit |
|---|---|---|---|---|
| Supply voltage (Uc) | 4.75 | 5.0 | 5.25 | V |
| Current consumption (Ic) | - | 15 | 20 | mA |
| Max output current (Iout) | -1 | - | 1 | mA |
| Load resistance (RL) | 10 | - | - | kΩ |
| Capacitive load (CL) | 1 | - | 100 | nF |
Output Clamping Voltages (both channels, @ Uc = 5 V)
| Limit | Min | Typ | Max | Unit |
|---|---|---|---|---|
| V_sz low | 0.2 | 0.25 | 0.3 | V |
| V_sz high | 4.7 | 4.75 | 4.8 | V |
Driver note: Any raw ADC reading at or near these clamp levels indicates saturation / over-range - flag accordingly.
Output Internal Resistance
| Min | Max | Unit |
|---|---|---|
| 1 | 10 | Ω |
Frequency Bandwidth
| Value | Condition |
|---|---|
| 278 Hz | @ −3 dB |
Timing
| Parameter | Max | Unit |
|---|---|---|
| Power-up time | 1 | ms |
| Setting time after overload (ts) | 10 | ms |
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 / 2atIp = 0[V]G- Sensitivity [V/A]
Channel-specific constants
| Symbol | CH1 | CH2 | Unit |
|---|---|---|---|
| G | 0.040 | 0.010 | V/A |
| Vo | Uc/2 | Uc/2 | V |
| Ipm | ±50 | ±200 | A |
4. C Implementation
#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)
/* 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 °C | 0 °C | 25 °C | 65 °C | 125 °C |
|---|---|---|---|---|---|---|
| @ 0 A | 0.35 | 0.29 | 0.23 | 0.15 | 0.23 | 0.35 |
| @ ±20 A | 1.20 | 0.98 | 0.77 | 0.50 | 0.78 | 1.20 |
| @ ±50 A | 1.50 | 1.25 | 1.01 | 0.70 | 1.02 | 1.50 |
Best accuracy occurs near 25 °C. Worst at temperature extremes (−40 °C / 125 °C).
Sensitivity Error
| Condition | Typical |
|---|---|
| @ 25 °C | ±0.4 % |
| −10 °C < T < 65 °C | ±1.0 % |
| −40 °C < T < 125 °C | ±1.5 % |
Offset Current (CH1)
| Condition | Min | Max | Unit |
|---|---|---|---|
| @ 25 °C | −0.15 | 0.15 | A |
| −10 °C to 65 °C | −0.23 | 0.23 | A |
| −40 °C to 125 °C | −0.35 | 0.35 | A |
Linearity Error (both channels)
| Condition | Typical |
|---|---|
| @ 25 °C, Uc = 5 V, full range | ±0.5 % |
Output Noise (both channels)
| Parameter | Min | Max | Unit |
|---|---|---|---|
| V_no_pp (peak-peak noise) | −10 | 10 | mV |
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
| Mode | Range |
|---|---|
| High accuracy | −10 °C to +65 °C |
| Reduced accuracy | −40 °C to +125 °C |
7. Absolute Maximum Ratings (do not operate at these)
| Parameter | Value | Unit |
|---|---|---|
| Max supply voltage | ±14 | V |
| Storage temperature | −40 to +125 | °C |
| ESD (IEC 61000-4-2) | 8 | kV |
| Insulation voltage (AC, 50 Hz, 1 min) | 2.5 | kV |
| Max output current | ±10 | mA |
| Output short-circuit max duration | 120 | s |
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
Ucto be measured or well-regulated; a 5 % Uc error causes a proportional current error.
9. Recommended External Filtering (from datasheet schematic)
| Net | Component | Value |
|---|---|---|
| Uc supply decoupling | C | 100 nF |
| CH1 output filter | C | 68 nF |
| CH2 output filter | C | 68 nF |
| Primary current sense | C | 47 nF |
Place capacitors close to the sensor connector. Load resistance RL ≥ 10 kΩ on each output.
