Your sensor is
lying to you.
ACS712 reads 0.3A with no load. Voltage jumps between 12.4 and 12.7 on the LCD. It's not the sensor. It's your code. IndustrialSense fixes that.
Three lines. Done.
No config structs. No init sequences. Declare, begin, read.
#include <IndustrialSense.h> IndustrialCurrent currentSensor(ACS712_20A, A0); IndustrialVoltage voltageSensor(A1, 30000.0, 7500.0); void setup() { currentSensor.begin(); voltageSensor.begin(); } void loop() { float amps = currentSensor.read(); float volts = voltageSensor.read(); delay(500); }
read() runs the full pipeline: oversample โ filter โ convert โ deadzone โ smooth. Lab-grade output from a $2 sensor.
Raw analogRead() is not enough.
ADC noise. Thermal drift. Non-linear sensors. You know the drill. Here's what this library does about it.
Adaptive Kalman Filter
Locks onto stable readings. Only reacts to real current changes, not ADC noise from your motor driver.
Multi-Point Calibration
10 reference points, auto-interpolation. Your sensor isn't linear and we don't pretend it is.
Persistent Storage
EEPROM on AVR, NVS on ESP32. Calibration survives power cycles and firmware updates.
Auto-Zero
Detects 0A for 5+ seconds, then silently recalibrates the offset. Handles thermal drift automatically.
64ร Oversampling
64 samples averaged per read. 3 extra bits of resolution. 13-bit accuracy from a 10-bit ADC, under 1ms.
Custom ADC
Pass a function pointer to your ADS1115 or MCP3008. The pipeline keeps working. No fork needed.
See the difference.
| Feature | Raw analogRead() |
Other Libraries | IndustrialSense |
|---|---|---|---|
| Noise filtering | โ | Simple averaging | โ Adaptive Kalman |
| Zero-current stability | โ Reads 0.2โ0.5A | โ Manual offset | โ Auto-zero + deadzone |
| Thermal drift | โ | โ | โ Auto-recalibrates |
| Non-linear correction | โ | โ Linear only | โ 10-point interpolation |
| Calibration saved | โ Lost on reboot | โ Manual EEPROM | โ Auto NVS/EEPROM |
| Runtime calibration | โ Reflash needed | โ | โ Serial/MQTT |
| Cross-platform | โ | ESP32 or AVR only | โ Both + fallback |
| External ADC | โ | โ | โ Function pointer |
| Beginner-friendly | โ But inaccurate | โ But limited | โ 3 lines to start |
No datasheet needed.
Pass the enum. Sensitivity is loaded automatically.
| Enum | Sensor | Sensitivity | Range |
|---|---|---|---|
ACS712_05A | ACS712 5A | 185 mV/A | ยฑ5A |
ACS712_20A | ACS712 20A | 100 mV/A | ยฑ20A |
ACS712_30A | ACS712 30A | 66 mV/A | ยฑ30A |
ACS758_50B | ACS758 50B (Bidirectional) | 40 mV/A | ยฑ50A |
ACS758_100U | ACS758 100U (Unidirectional) | 20 mV/A | 0โ100A |
Voltage Divider.
Calibrate without reflashing.
Already deployed? Send commands over Serial, MQTT, or Bluetooth. Changes persist across reboots.
// In your loop(), enable serial commands: if (Serial.available()) { String cmd = Serial.readStringUntil('\n'); voltageSensor.processCommand(cmd); // "v12.5", "reset" currentSensor.processCommand(cmd); // "auto", "reset" }
API.
int myRead(uint8_t pin). For ADS1115 etc.Architecture.
What you actually get.
Ship faster
Stop rewriting moving-average filters. Install and focus on your product.
Deploy and forget
Auto-zero + persistent calibration. Setup once, runs for years.
Scale without rewriting
Start with analogRead(), swap to ADS1115 later. Same API, zero refactoring.