Documentation and assets for the I2C Power Management Module featuring an INA238 power monitor and PCA9538PW I/O expander for power monitoring and control.

- Power Monitor: INA238 (voltage, current, and power measurement)
- I/O Expander: PCA9538PW (8-bit I2C GPIO expander)
- Operating Voltage: 5V DC
- Communication Protocol: I2C
- MOSFET Control: 2x power switches
- Available GPIO: 5x configurable pins (pins 3-7)
- PCB Thickness: 1.6mm
- Compatible Boards: ESP32, Arduino Uno, ESP8266, and other Arduino-compatible boards
- Power Monitoring - Read voltage, current, and power values from the INA238 power monitor
- Power Control - Control power state through dedicated MOSFET control pins
- GPIO Expansion - 5 configurable GPIO pins for additional control
- Alert Function - Hardware alert capability from INA238
- I2C Communication - Simple control through I2C interface
| I2C Connection |
| GND | Ground connection |
| VCC | Power supply (5V) |
| SDA | I2C data line |
| SCL | I2C clock line |
| Power Input |
| GND | Power ground |
| VIN+ | Power supply input |
| Power Output 1 |
| OUT1+ | MOSFET 1 output |
| GND | Ground connection |
| Power Output 2 |
| OUT2+ | MOSFET 2 output |
| GND | Ground connection |
Add to your platformio.ini:
lib_deps =
https://github.com/FoxLabsFr/Power_management.git
#include <power_management.h>
PowerManagement pm;
void setup() {
Serial.begin(9600);
if (!pm.begin()) {
Serial.println("Failed to initialize Power Management.");
return;
}
// Turn on both MOSFETs
pm.setPower(1, true);
pm.setPower(2, true);
}
void loop() {
float voltage, current, power;
bool mosfet1, mosfet2;
pm.get(voltage, current, power, mosfet1, mosfet2);
Serial.print("Voltage: ");
Serial.print(voltage);
Serial.print(" V, Current: ");
Serial.print(current);
Serial.print(" A, Power: ");
Serial.print(power);
Serial.print(" W, MOSFET1: ");
Serial.print(mosfet1 ? "ON" : "OFF");
Serial.print(", MOSFET2: ");
Serial.println(mosfet2 ? "ON" : "OFF");
delay(1000);
}
| Pin |
Function |
Description |
| 0 |
Alert Input |
Alert signal from INA238 (reserved) |
| 1 |
MOSFET 1 Control |
Power switch 1 control (reserved) |
| 2 |
MOSFET 2 Control |
Power switch 2 control (reserved) |
| 3 |
GPIO 3 |
Configurable GPIO pin |
| 4 |
GPIO 4 |
Configurable GPIO pin |
| 5 |
GPIO 5 |
Configurable GPIO pin |
| 6 |
GPIO 6 |
Configurable GPIO pin |
| 7 |
GPIO 7 |
Configurable GPIO pin |
- I2C Address: Ensure no I2C address conflicts with other devices on the bus
- Power Supply: Verify that your power supply can support the total current required by connected devices
- MOSFET Ratings: Check MOSFET specifications before connecting high-current loads
- GPIO Protection: When using GPIO pins, ensure proper voltage levels and current limiting
Built with ❤️ by FoxLabs
This page was generated with AI assistance.