Dual USB 5V 1A 2.1A PCB Power Module with LCD Documentation
The Dual USB 5V 1A 2.1A PCB Power Module with LCD is a compact and versatile power management module designed for IoT applications. It features two USB ports, each capable of delivering 1A and 2.1A of current, respectively, and an integrated LCD display for monitoring voltage and current. This module is ideal for powering small devices, such as microcontrollers, sensors, and other IoT components.
Dual USB ports: 1x 5V 1A, 1x 5V 2.1A
High-precision voltage and current monitoring
Integrated LCD display for real-time monitoring
Compact PCB design for easy integration
Operating voltage: 5V
Operating temperature: -20C to 80C
| Pin | Function |
| --- | --- |
| VCC | 5V input power |
| GND | Ground |
| USB1+ | USB port 1 positive |
| USB1- | USB port 1 negative |
| USB2+ | USB port 2 positive |
| USB2- | USB port 2 negative |
| SCL | I2C clock |
| SDA | I2C data |
| LCD_VCC | LCD power supply |
| LCD_GND | LCD ground |
The Dual USB 5V 1A 2.1A PCB Power Module with LCD communicates via I2C protocol. The module's I2C address is 0x20.
### Example 1: Monitoring Voltage and Current using Arduino
In this example, we will use an Arduino board to communicate with the Dual USB 5V 1A 2.1A PCB Power Module with LCD and display the voltage and current readings on the serial monitor.
#define PM_MODULE_ADDRESS 0x20
void setup() {
Serial.begin(9600);
Wire.begin();
}
void loop() {
int voltage = readVoltage();
int current = readCurrent();
Serial.print("Voltage: ");
Serial.print(voltage);
Serial.println("mV");
Serial.print("Current: ");
Serial.print(current);
Serial.println("mA");
int readVoltage() {
byte voltageHigh = 0;
byte voltageLow = 0;
Wire.beginTransmission(PM_MODULE_ADDRESS);
Wire.write(0x01);
Wire.endTransmission();
Wire.requestFrom(PM_MODULE_ADDRESS, 2);
voltageHigh = Wire.read();
voltageLow = Wire.read();
int voltage = (voltageHigh << 8) | voltageLow;
voltage = (voltage 5) / 1024;
int readCurrent() {
byte currentHigh = 0;
byte currentLow = 0;
Wire.beginTransmission(PM_MODULE_ADDRESS);
Wire.write(0x02);
Wire.endTransmission();
Wire.requestFrom(PM_MODULE_ADDRESS, 2);
currentHigh = Wire.read();
currentLow = Wire.read();
int current = (currentHigh << 8) | currentLow;
current = (current 100) / 1024;
### Example 2: Powering a Raspberry Pi using Python
In this example, we will use a Raspberry Pi to communicate with the Dual USB 5V 1A 2.1A PCB Power Module with LCD and monitor the voltage and current readings.
```python
import smbus
import time
def read_voltage():
bus.write_byte(PM_MODULE_ADDRESS, 0x01)
voltage_data = bus.read_i2c_block_data(PM_MODULE_ADDRESS, 0x00, 2)
voltage = (voltage_data[0] << 8) | voltage_data[1]
voltage = (voltage 5) / 1024
return voltage
def read_current():
bus.write_byte(PM_MODULE_ADDRESS, 0x02)
current_data = bus.read_i2c_block_data(PM_MODULE_ADDRESS, 0x00, 2)
current = (current_data[0] << 8) | current_data[1]
current = (current 100) / 1024
return current
while True:
voltage = read_voltage()
current = read_current()
print("Voltage: {}mV, Current: {}mA".format(voltage, current))
time.sleep(1)
```
Note: In this example, we assume that the Raspberry Pi is connected to the power module via I2C bus. The `smbus` library is used to communicate with the power module.
These examples demonstrate how to use the Dual USB 5V 1A 2.1A PCB Power Module with LCD in various contexts. The module's integrated LCD display can be used to monitor voltage and current readings, while the I2C interface allows for real-time monitoring and control of the power module.