| Gravity | Analog AC Current Sensor (20A) |
| Gravity | Analog AC Current Sensor (20A) |
| Analog AC Current Sensor (20A) is suitable for a wide range of applications, including |
Industrial automation and control systems
Renewable energy systems (solar, wind, hydro)
Building automation and smart home systems
Energy monitoring and metering systems
Electrical engineering and research applications
0-20A AC
Analog (0-5V)
1% of full scale
<10ms
-25C to 85C
5V DC (typical), 3.5-6V DC (operating range)
45.7mm x 21.5mm x 14.5mm
20g
Gravity: Analog AC Current Sensor (20A) DocumentationOverviewThe Gravity: Analog AC Current Sensor (20A) is a high-precision, analog current sensor capable of measuring alternating current (AC) up to 20 amps. This sensor is designed for accurate current measurement in a wide range of applications, including industrial automation, IoT projects, and energy monitoring systems.Pinout and Connection DiagramThe Gravity: Analog AC Current Sensor (20A) has a simple, 3-pin interface:VCC: Connect to a 5V power supply
GND: Connect to ground
OUT: Analog output signal (0-5V)Code Examples### Example 1: Basic Analog Current Measurement with Arduino
```c++
const int sensorPin = A0; // Connect the OUT pin to an analog input on your Arduino
float sensitivity = 0.1; // Sensitivity of the sensor in V/A
float current = 0;void setup() {
Serial.begin(9600);
}void loop() {
int sensorValue = analogRead(sensorPin);
current = (sensorValue 5.0 / 1023.0) / sensitivity;
Serial.print("Current: ");
Serial.print(current, 2);
Serial.println(" A");
delay(1000);
}
```
In this example, we connect the OUT pin of the sensor to an analog input on an Arduino board. We then read the analog value using `analogRead()` and convert it to a current measurement using the sensitivity of the sensor.### Example 2: Current Measurement with Raspberry Pi using Python
```python
import RPi.GPIO as GPIO
import timeGPIO.setmode(GPIO.BCM)
sensor_pin = 18 # Connect the OUT pin to a GPIO pin on your Raspberry Pi
GPIO.setup(sensor_pin, GPIO.IN)def read_current():
sensor_value = GPIO.input(sensor_pin)
current = (sensor_value 5.0 / 1023.0) / 0.1 # Adjust sensitivity as needed
return currentwhile True:
current = read_current()
print("Current: {:.2f} A".format(current))
time.sleep(1)
```
In this example, we connect the OUT pin of the sensor to a GPIO pin on a Raspberry Pi. We use the `RPi.GPIO` library to read the analog value and convert it to a current measurement using the sensitivity of the sensor.Important NotesMake sure to follow proper safety guidelines when working with electrical currents.
The sensor's maximum current rating is 20A. Do not exceed this limit to avoid damage to the sensor or other components.
The sensor's output voltage range is 0-5V. Ensure that your microcontroller or processing unit can accurately read this range.I hope this documentation and the provided code examples help you get started with the Gravity: Analog AC Current Sensor (20A) in your IoT projects!