#include < Wire.h >
#include < Adafruit_GFX.h >
#include < Adafruit_SSD1306.h >
// OLED display setup (change the screen address if needed)
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
#define OLED_RESET - 1 // Reset pin # (or -1 if unused)
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, & Wire, OLED_RESET);
// Pin definitions
const int voltagePin = A0; // ZMPT101B module output
const int currentPin = A1; // ACS712 module output
// Voltage and current sensor calibration
float voltageCalibration = 5.0 / 1024.0; // Analog voltage calibration (5V/1024)
float currentCalibration = 0.185; // ACS712 output voltage to current (185mV per amp)
// Constants for calculation
const float rmsVoltage = 230.0; // AC RMS voltage (adjust according to your region)
const float powerFactor = 0.9; // Assuming a typical power factor
hooooo807
copilot
-
ZMPT101B Voltage Sensor Module:
- Pins:
- GND: Ground connection.
- OUT: The analog output voltage that represents the AC voltage being measured.
- VCC: Power supply for the sensor module.
- ACN/ACL: Used for measuring the AC voltage input. These are the terminals where you connect the AC voltage to be monitored.
-
[Arduino Nano](Arduino Nano):
- Digital and Analog I/O Pins:
- The Arduino Nano has digital pins $D0$ to $D13$ and analog pins $A0$ to $A7$, which can be used for various purposes such as reading the sensor output or controlling other components.
- Power Pins:
- $3V3$, $+5V$, VIN: Various power supply pins for different external power requirements.
- COM/GND: Ground connection pins.
-
P3:
- A terminal or connector with a single pin named in this schematic, probably for a test point or another simple connection not yet defined.
Connections and Functionality:-
Voltage Sensor (ZMPT101B):
- The ZMPT101B is typically connected to an AC voltage source. It outputs an analog signal corresponding to the sensed AC voltage.
-
Arduino Nano:
- Likely used to read the analog output from the voltage sensor on one of its analog pins (e.g., $A0$). The Arduino can process this signal, converting it into a readable voltage level, which can be used for display, logging, or transmitting to another system.
Current State of the Project:- The components are listed, but no specific connections between the ZMPT101B, [Arduino Nano](Arduino Nano), and the connector terminal P3 are defined yet.
- There are existing nets, but not all components are connected to them in the project.
Potential Next Steps: