Circuit Documentation
Summary
This circuit is designed to charge a 18650 battery using a solar panel and a TP4056 battery charging protection module. It also includes a 555 timer-based circuit for additional functionality, a voltage sensor, and an ESP32 microcontroller to monitor and display the voltage on an I2C display. The ESP32 also sends the voltage data to a Blynk application for remote monitoring.
Component List
TP4056 Battery Charging Protection Module (Type C)
- Pins: OUT +, B+, B-, OUT -, +, -
- Description: Used for charging and protecting the 18650 battery.
Solar Panel
- Pins: +, -
- Description: Provides power to charge the battery.
Battery 18650
- Pins: +, -
- Description: Stores energy from the solar panel.
555 Timer
- Pins: GND, TRIG, OUT, ~RESET, VCC, DIS, THR, CTRL
- Description: Used for timing and control purposes.
Electrolytic Capacitor
- Pins: -, +
- Description: Stores electrical energy.
- Properties: Capacitance: 0.000001 Farads
Resistor
- Pins: pin1, pin2
- Description: Limits current flow.
- Properties: Resistance: 200 Ohms
Diode
- Pins: cathode, anode
- Description: Allows current to flow in one direction only.
Copper Coil - 30 Turns
- Pins: 1 PIN, 2 PIN
- Description: Used for inductance in the circuit.
Bridge - 1N4007
- Pins: 1 INPUT, 2 INPUT, + PIN, - PIN
- Description: Converts AC to DC.
7805 Voltage Regulator
- Pins: Vin, Gnd, Vout
- Description: Regulates voltage to 5V.
Voltage Sensor DC 25V
- Pins: +, -, output, gnd, vcc
- Description: Measures voltage up to 25V.
ESP32
- Pins: EN, VP, VN, D34, D35, D32, D33, D25, D26, D27, D14, D12, D13, GND, VIN, 3V3, D15, D2, D4, RX2, TX2, D5, D18, D19, D21, RX0, TX0, D22, D23, BOOT
- Description: Microcontroller for processing and communication.
I2C Display
- Pins: GND, VCC, SDL, SCL
- Description: Displays voltage readings.
Wiring Details
TP4056 Battery Charging Protection Module (Type C)
- B+ connected to + of Solar Panel
- B- connected to - of Solar Panel
- + connected to + of Battery 18650, ~RESET and VCC of 555 Timer, and pin2 of Resistor
- - connected to - of Battery 18650, GND of 555 Timer, - of Electrolytic Capacitor, and 1 PIN of Copper Coil - 30 Turns
Solar Panel
- + connected to B+ of TP4056 Battery Charging Protection Module
- - connected to B- of TP4056 Battery Charging Protection Module
Battery 18650
- + connected to + of TP4056 Battery Charging Protection Module
- - connected to - of TP4056 Battery Charging Protection Module
555 Timer
- GND connected to - of TP4056 Battery Charging Protection Module
- TRIG connected to cathode of Diode, + of Electrolytic Capacitor, and pin2 of Resistor
- OUT not connected
- ~RESET connected to + of TP4056 Battery Charging Protection Module
- VCC connected to + of TP4056 Battery Charging Protection Module
- DIS connected to anode of Diode, pin1 of Resistor, and pin1 of another Resistor
- THR connected to 2 PIN of Copper Coil - 30 Turns
- CTRL connected to + of Electrolytic Capacitor
Electrolytic Capacitor
- - connected to - of TP4056 Battery Charging Protection Module and 1 PIN of Copper Coil - 30 Turns
- + connected to TRIG of 555 Timer and cathode of Diode
Resistor
- pin1 connected to DIS of 555 Timer and anode of Diode
- pin2 connected to + of TP4056 Battery Charging Protection Module and TRIG of 555 Timer
Diode
- cathode connected to TRIG of 555 Timer and + of Electrolytic Capacitor
- anode connected to DIS of 555 Timer and pin1 of Resistor
Copper Coil - 30 Turns
- 1 PIN connected to - of TP4056 Battery Charging Protection Module and - of Electrolytic Capacitor
- 2 PIN connected to THR of 555 Timer
Bridge - 1N4007
- + PIN connected to 1 PIN of Copper Coil - 30 Turns
- - PIN connected to 2 PIN of Copper Coil - 30 Turns
- 1 INPUT connected to + of Electrolytic Capacitor, Gnd of 7805 Voltage Regulator, and gnd of Voltage Sensor DC 25V
- 2 INPUT connected to - of Electrolytic Capacitor and Vin of 7805 Voltage Regulator
7805 Voltage Regulator
- Vin connected to 2 INPUT of Bridge - 1N4007
- Gnd connected to 1 INPUT of Bridge - 1N4007
- Vout connected to vcc of Voltage Sensor DC 25V
Voltage Sensor DC 25V
- + connected to 3V3 of ESP32
- - connected to GND of ESP32
- output connected to D35 of ESP32
- gnd connected to 1 INPUT of Bridge - 1N4007
- vcc connected to Vout of 7805 Voltage Regulator
ESP32
- 3V3 connected to + of Voltage Sensor DC 25V
- GND connected to - of Voltage Sensor DC 25V and GND of I2C Display
- D35 connected to output of Voltage Sensor DC 25V
- VIN connected to VCC of I2C Display
- D21 connected to SDL of I2C Display
- D22 connected to SCL of I2C Display
I2C Display
- GND connected to GND of ESP32
- VCC connected to VIN of ESP32
- SDL connected to D21 of ESP32
- SCL connected to D22 of ESP32
Documented Code
#define BLYNK_TEMPLATE_ID "TMPL2Tfn-9Jrz"
#define BLYNK_TEMPLATE_NAME "dc voltmeter"
#define BLYNK_AUTH_TOKEN "xbbqQafjumDlL4D5eYwjtAAMN1DFeAzT"
#define BLYNK_PRINT Serial
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 20, 4);
// Calibration factor for DC voltage with 5V reference
const float vCalibration = 5.0 / 4095.0; // Adjust this value as needed
// Blynk and WiFi credentials
char auth[] = BLYNK_AUTH_TOKEN; // Blynk authentication token
const char* ssid = "C1"; // Your WiFi network SSID
const char* pass = "12345678"; // Your WiFi network password
void setup() {
Serial.begin(115200);
Blynk.begin(auth, ssid, pass);
// Initialize the LCD
lcd.begin();
// Display startup message
lcd.setCursor(3, 0);
lcd.print("group ");
lcd.setCursor(3, 1);
lcd.print(" 45 ");
delay(3000); // Wait for 3 seconds
// Clear the LCD and display "DC Voltmeter"
