Using Winston WCS Current Sensors with LCD1602/LCD2004 I2C Arduino

Using Winston WCS Current Sensors with LCD1602/LCD2004 I2C Arduino

343 – Using Winson WCS Current Sensors with LCD1602/LCD2004 I2C and Arduino

This project builds on the previous WCS current-sensor tutorials, but now we display the measured current directly on an LCD1602 or LCD2004 I2C display. The Winson WCS sensor family works the same way, but instead of printing values to the Serial Monitor, we show real-time current and zero-current readings on the LCD screen. This is especially useful for portable systems, battery testers, power analyzers, and stand-alone monitoring tools without a computer.

Understanding the WCS Hall-Effect Current Sensor

Winson WCS current sensors measure both AC and DC current using a Hall-effect IC. The sensor output is centered around half of the supply voltage (about 2.5V at 5V input). The Robojax_WCS library automatically handles offset detection, calibration, sensitivity, and conversion to amperes.

The same sensors covered previously (for example, WCS1800, WCS1500, WCS2800, and more) can be used with this LCD project. Only the display logic changes — not the sensor wiring.

Wiring the WCS Sensor

All WCS models use three low-voltage interface pins:

  • VDD → Arduino 5V
  • GND → Arduino GND
  • VOUT → Arduino analog input (for example, A0)

The high-current load still passes through the sensor (either through the hole or the screw terminals depending on the model). As always, the load must be disconnected during startup so the library can store the correct zero-current offset.

S23-09-WCS1888-LCDr_wiring

LCD1602 or LCD2004 I2C Display

LCD1602 (16×2) and LCD2004 (20×4) displays with I2C backpacks require only four wires:

  • SDA → Arduino SDA
  • SCL → Arduino SCL
  • VCC → Arduino 5V
  • GND → Arduino GND

The I2C address may vary (common addresses are 0x27 and 0x3F), so adjust it based on your display module. The library uses this address along with LCD column and row count to configure the screen.

LCD Settings Used in This Project

These are the LCD configuration variables used in the code. They define the I2C address, display size, and the text labels for showing current and zero-current values.


//LCD settings
const uint8_t I2C_ADDRESS = 0x3f; //watch video for details
const uint8_t LCD_CHAR = 16;
const uint8_t LCD_ROW = 2;

char *TITLE_CURRENT = "Current: ";
char *TITLE_ZERO_CURRENT = "Zero Current: ";

#define SHOW_ZERO_CURRENT true
//const int LCD_VCC_PIN = 9; //define a VCC pin for LCD, see video

Explanation:

  • I2C_ADDRESS – The I2C address of the display. On some boards it may be 0x27.
  • LCD_CHAR – Number of columns (16 for LCD1602, 20 for LCD2004).
  • LCD_ROW – Number of rows (2 for LCD1602, 4 for LCD2004).
  • TITLE_CURRENT – Label printed before the measured current.
  • TITLE_ZERO_CURRENT – Label displayed when showing the stored zero-current value.
  • SHOW_ZERO_CURRENT – When set to true, the LCD shows the zero-current offset after calibration.
  • LCD_VCC_PIN – Optional digital pin to power the LCD; used in some projects to control LCD power from software.

Defining the WCS Sensor Object With LCD Support

The Robojax_WCS library has a special constructor that accepts LCD parameters. This allows the sensor library to update the LCD display automatically with current and zero-current information.

Here is the object definition used in this project (shown as a separate block):


Robojax_WCS sensor(
    I2C_ADDRESS, LCD_CHAR, LCD_ROW,
    MODEL, SENSOR_PIN, SENSOR_VCC_PIN,
    ZERO_CURRENT_WAIT_TIME, SHOW_ZERO_CURRENT,
    CORRECTION_VLALUE, MEASUREMENT_ITERATION, VOLTAGE_REFERENCE,
    BIT_RESOLUTION, DEBUG_ONCE,
    TITLE_CURRENT, TITLE_ZERO_CURRENT
);

Explanation of each parameter:

  • I2C_ADDRESS – Where the LCD module is located on the I2C bus.
  • LCD_CHAR & LCD_ROW – LCD screen size.
  • MODEL – WCS sensor model number (for example, 12 for WCS1800).
  • SENSOR_PIN – Arduino analog input reading VOUT from the sensor.
  • SENSOR_VCC_PIN – Digital pin controlling sensor power.
  • ZERO_CURRENT_WAIT_TIME – Calibration time during which no load should be connected.
  • SHOW_ZERO_CURRENT – Whether to display the saved zero-current voltage on the LCD.
  • CORRECTION_VLALUE – Small offset correction in mA to improve accuracy.
  • MEASUREMENT_ITERATION – Number of samples averaged per reading.
  • VOLTAGE_REFERENCE – Arduino analog reference voltage in millivolts.
  • BIT_RESOLUTION – ADC resolution (10 for most Arduino boards).
  • DEBUG_ONCE – Controls whether debug information is shown once or continuously.
  • TITLE_CURRENT – LCD label for live current reading.
  • TITLE_ZERO_CURRENT – LCD label for zero-current reading.

How the LCD Version Works

At startup:

  1. The sensor library waits for the zero-current period (e.g., 5 seconds).
  2. The LCD displays “Zero Current:” and the measured offset.
  3. Once calibration is complete, the LCD switches to “Current:” mode.
  4. The current value is refreshed continuously without using the Serial Monitor.

If SHOW_ZERO_CURRENT is set to false, the LCD will skip the zero-current display and show only the live reading.

Using the Current Reading in Your Project

Although the LCD shows the value automatically, you can still use the sensor output in your logic:


if(sensor.getCurrent() >= 10.0) {
    // trigger relay, alarm, fan, etc.
}

The library calculates the value in amperes, so it can be used directly in mathematical formulas and safety routines.

Conclusion

This project demonstrated how to integrate Winson WCS current sensors with an LCD1602 or LCD2004 I2C display using the Robojax_WCS library. The LCD lets you build a fully stand-alone current meter without Serial Monitor. Zero-current calibration, current reading, and labeling are all handled automatically. This same setup works with all WCS models supported by the library, making it ideal for portable current-measurement projects, battery analyzers, solar systems, and power-monitoring tools.

الصور

توصيل WCS: حمل تيار مستمر
توصيل WCS: حمل تيار مستمر
توصيل WCS: حمل تيار مباشر
توصيل WCS: حمل تيار مباشر
توصيل WCS: حمولة تيار مستمر
توصيل WCS: حمولة تيار مستمر
حساس تيار وينسون مع شاشة LCD
حساس تيار وينسون مع شاشة LCD
حساس التيار وينسون
حساس التيار وينسون
مستشعر التيار وينسون مع شاشة LCD2004 عند التشغيل الأولي
مستشعر التيار وينسون مع شاشة LCD2004 عند التشغيل الأولي
حساس تيار وينسون مع LCD2004
حساس تيار وينسون مع LCD2004
حساس التيار وينسون مع شاشة LCD2004 2
حساس التيار وينسون مع شاشة LCD2004 2
حساس التيار وينسون مع شاشة LCD1602 عند التشغيل الأولي
حساس التيار وينسون مع شاشة LCD1602 عند التشغيل الأولي
مجس تيار وينسون مع شاشة LCD1602 مع أردوينو أونو
مجس تيار وينسون مع شاشة LCD1602 مع أردوينو أونو
حساس تيار وينسون مع LCD1602 O
حساس تيار وينسون مع LCD1602 O
S23-09-WCS1888-LCDr_wiring
S23-09-WCS1888-LCDr_wiring
179-Arduino code for an I2C scanner
اللغة: C++
347-Arduino code for Winsen WCS Current Sensor with LCD
اللغة: C++
تم النسخ!

الموارد والمراجع

ملفات📁

ملفات أخرى