Using Two or More Winson WCS Hall Effect Current Sensors WCS1800 and others with Arduino
342 – Using Two Winson WCS Hall Effect Current Sensors with Arduino
This project extends the previous single-sensor setup by using two Winson WCS Hall-effect current sensors at the same time with the Robojax_WCS library. Each sensor operates independently, performs its own zero-current calibration, and reports its own current reading. This approach is useful when monitoring two separate loads, measuring charge and discharge paths, or comparing input and output current of a system. The same method can be extended to three or more sensors simply by defining additional sensor objects.
Understanding the WCS Sensor Family
Winson Semiconductor produces many models in the WCS Hall-effect current sensor series. These sensors measure AC and DC current using magnetic isolation, making them safe and easy to use. All sensors share the same three-wire interface (VCC, GND, and VOUT) and can be used with the Robojax_WCS library by simply choosing the correct model number.
As in the previous project, the WCS1800 is used here. It provides a linear response up to about 25A and a sensitivity of about 66mV per ampere. Any WCS model listed in the library (0 to 15) can be used. Each sensor object in the code corresponds to one physical WCS module.
Using Two Current Sensors at the Same Time
The Robojax_WCS library fully supports multi-sensor operation. Each sensor must have:

- Its own analog input pin for VOUT
- Its own VCC control pin (optional but recommended)
- Its own zero-current LED indicator pin
- A separate set of settings such as correction value and wait time
Below is the configuration for two sensors. Sensor 1 uses analog pin A0 and Sensor 2 uses A1. Each sensor has its own zero-current LED and its own VCC pin. These pins can be changed as needed for your wiring.
#include <Wire.h>
#include <Robojax_WCS.h>
// -------- SENSOR 1 SETTINGS --------
#define MODEL_1 12
#define SENSOR_PIN_1 A0
#define SENSOR_VCC_PIN_1 8
#define ZERO_CURRENT_LED_PIN_1 2
#define ZERO_CURRENT_WAIT_TIME_1 5000
#define CORRECTION_VLALUE_1 164
#define MEASUREMENT_ITERATION_1 100
#define VOLTAGE_REFERENCE_1 5000.0
#define BIT_RESOLUTION_1 10
#define DEBUT_ONCE_1 true
// -------- SENSOR 2 SETTINGS --------
#define MODEL_2 12
#define SENSOR_PIN_2 A1
#define SENSOR_VCC_PIN_2 9
#define ZERO_CURRENT_LED_PIN_2 3
#define ZERO_CURRENT_WAIT_TIME_2 5000
#define CORRECTION_VLALUE_2 164
#define MEASUREMENT_ITERATION_2 100
#define VOLTAGE_REFERENCE_2 5000.0
#define BIT_RESOLUTION_2 10
#define DEBUT_ONCE_2 true
// -------- TWO SENSOR OBJECTS --------
Robojax_WCS sensor1(
MODEL_1, SENSOR_PIN_1, SENSOR_VCC_PIN_1,
ZERO_CURRENT_WAIT_TIME_1, ZERO_CURRENT_LED_PIN_1,
CORRECTION_VLALUE_1, MEASUREMENT_ITERATION_1,
VOLTAGE_REFERENCE_1, BIT_RESOLUTION_1, DEBUT_ONCE_1
);
Robojax_WCS sensor2(
MODEL_2, SENSOR_PIN_2, SENSOR_VCC_PIN_2,
ZERO_CURRENT_WAIT_TIME_2, ZERO_CURRENT_LED_PIN_2,
CORRECTION_VLALUE_2, MEASUREMENT_ITERATION_2,
VOLTAGE_REFERENCE_2, BIT_RESOLUTION_2, DEBUT_ONCE_2
);
Once defined, both sensors are used the same way inside setup() and loop():
sensor1.start();andsensor2.start();each perform their own zero-current calibrationsensor1.readCurrent();andsensor2.readCurrent();update their readingssensor1.printCurrent();andsensor2.printCurrent();send each sensor’s value to Serial Monitorsensor1.getCurrent()andsensor2.getCurrent()provide numeric values you can use inifconditions
Using three or more sensors works the same way: simply copy the block, change the pin numbers, and create sensor3, sensor4, and so on. Each object operates independently.
Wiring the Two Sensors
Each WCS module still uses three low-voltage signal wires:
- VDD → Arduino 5V (or controlled by SENSOR_VCC_PIN_x if powering from digital pin)
- GND → Arduino GND
- VOUT → Arduino analog input (A0 for sensor1, A1 for sensor2)
You also connect two indicator LEDs:
- LED 1 on ZERO_CURRENT_LED_PIN_1 (pin 2)
- LED 2 on ZERO_CURRENT_LED_PIN_2 (pin 3)
Both LEDs turn on independently once each sensor finishes its own zero-current calibration period. Make sure no current is flowing through either sensor for the first 5 seconds after booting or resetting the Arduino.
How the Dual-Sensor System Works
Both sensors:
- Calibrate their zero-current offset separately
- Read ADC values from different analog pins
- Compute current using their defined WCS model
- Display readings continuously
Because each sensor has its own configuration and LED, you always know which sensor has completed calibration. The code prints two values to the Serial Monitor, for example:
Sensor 1: 12.45 A
Sensor 2: 7.82 A
Using the Measured Currents
You can use each current independently:
if(sensor1.getCurrent() >= 10.0) {
// action for sensor 1
}
if(sensor2.getCurrent() >= 5.0) {
// action for sensor 2
}
Or compare the sensors:
float diff = sensor1.getCurrent() - sensor2.getCurrent();
This is useful in charge/discharge systems or monitoring two branches of a circuit.
Scaling to Three or More Sensors
To add additional sensors, simply:
- Define another set of constants (MODEL_3, SENSOR_PIN_3, etc.)
- Create another object
Robojax_WCS sensor3(...) - Call
sensor3.start()insetup() - Use
sensor3.readCurrent()andsensor3.getCurrent()insideloop()
There is no limit other than available Arduino analog pins and I/O pins.
Conclusion
This project showed how to use two Winson WCS Hall-effect current sensors at the same time using the Robojax_WCS library. Each sensor operates independently, performs its own zero-current calibration, and provides accurate real-time current measurement. The method scales easily to three or more sensors, making this approach ideal for dual-load systems, in/out current measurement, solar or battery systems, and multi-channel power monitoring.
Изображения
Вещи, которые могут вам понадобиться
-
Амазонка
-
eBay
-
АлиЭкспрессPurchase WCS1800 Hall Current Sensor from AliExpresss.click.aliexpress.com
Ресурсы и ссылки
-
ВнешнийDatasheet for WCS1500winson.com.tw
-
ВнешнийDatasheet for WCS1600winson.com.tw
-
ВнешнийDatasheet for WCS1700winson.com.tw
-
ВнешнийDatasheet for WCS1800winson.com.tw
-
ВнешнийDatasheet for WCS2702winson.com.tw
-
ВнешнийDatasheet for WCS2705winson.com.tw
-
ВнешнийDatasheet for WCS2720winson.com.tw
-
ВнешнийDatasheet for WCS2800winson.com.tw
-
ВнешнийDatasheet for WCS2801winson.com.tw
-
ВнешнийDatasheet for WCS2810winson.com.tw
-
ВнешнийDatasheet for WCS3740winson.com.tw
-
ВнешнийDatasheet for WCS37A50winson.com.tw
-
ВнешнийDatasheet for WCS38A25winson.com.tw
-
ВнешнийDatasheet for WCS6800winson.com.tw
Файлы📁
Другие файлы
-
Download RoboJax WCS Library
robojax_Winson_WCS_library.zip0.04 MB