This Arduino project measures both AC and DC voltages using the ZMPT101B sensor and displays the readings on a 16x2 LCD screen.
- ZMPT101B Voltage Sensor
- Arduino Board (e.g., Arduino Uno)
- 16x2 LCD with I2C Interface
- Potentiometer for LCD Contrast Adjustment
- ZMPT101B (Install via Arduino Library Manager)
- LiquidCrystal_I2C (Install via Arduino Library Manager)
Describe your circuit diagram here, explaining how the ZMPT101B sensor and LCD are connected to the Arduino board.
-
Install Libraries: Install the ZMPT101B and LiquidCrystal_I2C libraries using the Arduino Library Manager.
-
Connect Components:
- Connect the ZMPT101B sensor to analog pin A0 on the Arduino board.
- Connect the 16x2 LCD to the Arduino via I2C (usually A4 and A5).
-
Adjust Sensitivity:
- Use the
SENSITIVITY
constant in the code to adjust the sensitivity based on your calibration needs.
- Use the
-
Upload Code: Upload the provided Arduino sketch (
voltage_sensor_lcd.ino
) to your Arduino board. -
Monitor Output:
- Open the Serial Monitor to view AC and DC voltage readings.
- The LCD will display real-time AC and DC voltages.
-
setup()
Function: Initializes serial communication, sets the ZMPT101B sensor sensitivity, and initializes the LCD. -
loop()
Function: Continuously reads AC and DC voltages from the sensor, prints them to the Serial Monitor, and displays them on the LCD.
- Ensure the ZMPT101B sensor is rated for the voltage range you are measuring (typically 0-250V AC).
- Adjust the
SENSITIVITY
constant based on calibration values obtained from the sensor.
- Usmana Zulfiqar
- Email: usmanazulfiqar2001@gmail.com
- GitHub: usmana5809
This project is licensed under the MIT License - see the LICENSE file for details.