This project demonstrates how to measure voltage using an INA226 current/voltage sensor and an ESP32 microcontroller. The measured voltage is then displayed on an I2C LCD display.
- INA226 current/voltage sensor
- ESP32 microcontroller
- I2C LCD display
- Arduino IDE (or other ESP32 development environment)
- INA226 library for Arduino.
- SDA -> ESP32 SDA
- SCL -> ESP32 SCL
- VCC -> 3.3V
- GND -> GND
- VBUS -> IN+
- GND -> IN-
- SDA -> ESP32 SDA
- SCL -> ESP32 SCL
- VCC -> 3.3V
- GND -> GND
Install the INA226 library for Arduino by going to Sketch > Include Library > Manage Libraries in the Arduino IDE.
Open the Arduino IDE and create a new sketch.
Copy and paste the code into the sketch, and upload it to the ESP32.
Once the code is uploaded to the ESP32, the measured voltage should be displayed on the LCD display. The voltage will be updated every loop iteration.