Seeedstudio Grove-Voltage Divider Module Documentation
The Seeedstudio Grove-Voltage Divider Module is a compact and easy-to-use module designed to facilitate voltage division in IoT projects. This module is based on a resistive voltage divider circuit, which allows users to reduce a higher voltage to a lower voltage level, making it safe for microcontrollers and other devices with limited voltage tolerance.
Voltage division ratio: 1:1, 1:2, 1:5, 1:10, or custom ratio
Input voltage range: 0-40V
Output voltage range: 0-20V
Output current: up to 10mA
Grove compatible interface for easy connection
The Grove-Voltage Divider Module has a standard 4-pin Grove connector. To connect the module, follow these steps:
1. Connect the input voltage (Vin) to the module's Vin pin.
2. Connect the ground (GND) to the module's GND pin.
3. Connect the output voltage (Vout) to the module's Vout pin.
4. Connect the Grove connector to a microcontroller or other devices.
### Example 1: Reading Voltage Divider Output using Arduino
In this example, we will use an Arduino board to read the output voltage of the Grove-Voltage Divider Module.
```c
const int voutPin = A0; // Connect Vout to Analog Input A0
void setup() {
Serial.begin(9600);
}
void loop() {
int voutValue = analogRead(voutPin);
float voutVoltage = voutValue (5.0 / 1023.0);
Serial.print("Output Voltage: ");
Serial.print(voutVoltage);
Serial.println(" V");
delay(500);
}
```
### Example 2: Using the Voltage Divider Module with Raspberry Pi (Python)
In this example, we will use a Raspberry Pi to read the output voltage of the Grove-Voltage Divider Module using Python.
```python
import RPi.GPIO as GPIO
import time
voutPin = 18 # Connect Vout to GPIO 18
GPIO.setup(voutPin, GPIO.IN)
while True:
voutValue = GPIO.input(voutPin)
voutVoltage = voutValue 3.3 # Assuming 3.3V as the reference voltage
print("Output Voltage: {:.2f} V".format(voutVoltage))
time.sleep(0.5)
```
### Example 3: Using the Voltage Divider Module with ESP32 (MicroPython)
In this example, we will use an ESP32 board to read the output voltage of the Grove-Voltage Divider Module using MicroPython.
voutPin = machine.Pin(32) # Connect Vout to GPIO 32
while True:
voutValue = voutPin.value()
voutVoltage = voutValue 3.3 # Assuming 3.3V as the reference voltage
print("Output Voltage: {:.2f} V".format(voutVoltage))
time.sleep(0.5)
```
Ensure the input voltage is within the specified range (0-40V).
Verify the voltage divider ratio is set correctly.
Check the connections to the microcontroller or other devices.
Use a multimeter to measure the output voltage if you're unsure about the readings.
By following these examples and guidelines, you can effectively use the Seeedstudio Grove-Voltage Divider Module in your IoT projects.