Original WCS2702 Hall Effect based Linear Current Sensor (0-2.0A) Documentation
The Original WCS2702 is a Hall Effect based linear current sensor capable of measuring currents between 0 and 2.0A. This component is ideal for applications requiring accurate current measurement, such as motor control, power supply monitoring, and battery charging systems.
The WCS2702 has a 5-pin package with the following pinout:
| Pin | Description |
| --- | --- |
| VCC | Power supply (5V) |
| GND | Ground |
| VIN | Input voltage (connected to the current-carrying conductor) |
| VOUT | Analog output voltage (proportional to the measured current) |
| NC | No connection (optional pin for bypass capacitor) |
Operating Characteristics
Supply voltage: 5V
Measuring range: 0 to 2.0A
Sensitivity: 185mV/A (typical)
Linearity error: 1.5% (typical)
Operating temperature: -20C to 80C
### Example 1: Basic Current Measurement using Arduino
In this example, we'll measure the current flowing through a load connected to a transistor controlled by an Arduino board.
```cpp
const int analogInPin = A0; // VOUT pin connected to Arduino analog input 0
const int loadPin = 9; // Transistor base pin connected to Arduino digital output 9
int sensorValue = 0;
float current = 0.0;
void setup() {
pinMode(loadPin, OUTPUT);
digitalWrite(loadPin, LOW);
Serial.begin(9600);
}
void loop() {
sensorValue = analogRead(analogInPin);
current = (sensorValue 5.0 / 1023.0) / 0.185; // Convert analog value to current (A)
Serial.print("Current: ");
Serial.print(current, 2);
Serial.println(" A");
delay(500);
}
```
### Example 2: Current Overload Detection using Raspberry Pi (Python)
In this example, we'll use a Raspberry Pi to detect overload conditions in a power supply system. When the measured current exceeds a set threshold (e.g., 1.8A), the script will trigger an alert.
```python
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setup(17, GPIO.IN) # VOUT pin connected to Raspberry Pi GPIO 17
threshold = 1.8 # Current overload threshold (A)
while True:
sensor_value = GPIO.input(17)
current = (sensor_value / 1023.0) 5.0 / 0.185 # Convert digital value to current (A)
if current > threshold:
print("Current overload detected! ({} A)".format(current))
# Add code to trigger an alert, e.g., send an email or trigger a relay
time.sleep(0.1)
```
Note: In both examples, the WCS2702 is assumed to be connected to a 5V power supply, and the VOUT pin is connected to an analog-to-digital converter (ADC) or a digital input pin. You may need to adjust the code based on your specific setup and application requirements.