
Components
Wiring diagram⚡ 1. POWER SYSTEM (VERY IMPORTANT)🔋 Battery → System Power18650 Battery (+) → TP4056 B+Battery (-) → TP4056 B-TP4056 OUT+ → ESP8266 Vin / 5VTP4056 OUT- → GND (COMMON)🔌 2. COMMON GROUND (MANDATORY)
👉 Connect ALL grounds together:
Battery GNDESP8266 GNDINA219 GNDRFID GNDLCD GNDRelay GNDAdapter GND🟢 3. PIEZO → LED (Separate Section)Piezo (x4 parallel)↓Bridge Rectifier (~ ~ + -)↓Capacitor (470µF)↓Resistor (1kΩ)↓LED (+)LED (-) → GND🔵 4. BO MOTOR → CHARGING OUTPUTBO Motor (+)↓Schottky Diode (1N5819)↓1000µF Capacitor↓Boost Converter (MT3608)↓ (Set to 5V)INA219 VIN+INA219 VIN-↓Relay COMRelay NO↓USB Module (+)USB GND → COMMON GND📊 5. INA219 CONNECTIONI2C Side:VCC → 3.3V (or 5V module supported)GND → GNDSDA → D2SCL → D1Power Measurement:VIN+ → Boost output (+)VIN- → Relay input📟 6. LCD (16x2 I2C)VCC → 5VGND → GNDSDA → D2SCL → D1📡 7. RFID (MFRC522)
⚠️ Works on 3.3V only
| RFID Pin | ESP8266 |
|---|---|
| SDA | D4 |
| SCK | D5 |
| MOSI | D7 |
| MISO | D6 |
| RST | D3 |
| GND | GND |
| 3.3V | 3.3V |
🔘 8. RELAY MODULEVCC → 5VGND → GNDIN → D0Output Side:COM → INA219 outputNO → USB module (+)🧠 9. ESP8266 PIN SUMMARY
| Function | Pin |
|---|---|
| Relay | D0 |
| SDA (I2C) | D2 |
| SCL (I2C) | D1 |
| RFID SDA | D4 |
| RFID SCK | D5 |
| RFID MOSI | D7 |
| RFID MISO | D6 |
| RFID RST | D3 |
⚡ 10. COMPLETE FLOW (FOR SCHEMATIC)[FOOTSTEP]↓Piezo → LED
↓Motor → Diode → Capacitor → Boost↓INA219 → Relay → USB Output↓Mobile Charging
[CONTROL]Battery → ESP8266ESP → RFID + LCD + Relay ControlINA219 → Data → ESP → LCD Display
Step 1: System InitializationThe ESP8266 powers ON using the Lithium-ion battery.It initializes:RFID ReaderINA219 SensorLCD DisplayRelay ModuleLCD displays:Smart ChargingInitializingThen:Use RFID CardTo StartStep 2: RFID AuthenticationThe user places the RFID card near the RFID reader.ESP8266 reads the UID of the card.It compares the scanned UID with the stored authorized UID.If Card is ValidRelay turns ON.LCD displays:Access GrantedRelay ONIf Card is InvalidRelay remains OFF.LCD displays:Access DeniedRelay OFFThis ensures that only authorized users can use the charging system.Step 3: Mechanical Energy GenerationThe user presses the mechanical footstep platform.Two energy generation methods work simultaneously.Piezoelectric SensorsFoot pressure generates AC voltage.AC voltage is converted into DC using a Bridge Rectifier.The capacitor smooths the output.This energy is used only to glow an LED as an indication that piezo energy is being generated.BO Motor GeneratorThe same footstep rotates the BO motor through the mechanical mechanism.The BO motor acts as a DC generator.Generated power flows through:BO Motor↓Protection Diode↓Capacitor↓Boost Converter↓5V OutputThe Boost Converter converts the varying motor voltage into a stable 5V output suitable for USB charging.Step 4: Energy MonitoringThe output of the Boost Converter passes through the INA219 sensor.INA219 measures:CurrentVoltage (internally)The ESP8266 continuously reads the current value.Step 5: Charging DetectionESP8266 checks:Current > 5mA ?If NOLCD displays:Rotate MotorFor ChargingThis indicates that sufficient energy is not being generated.If YESESP8266 assumes charging has started.LCD displays:Charging V:5.2VI:569mA5.2V is the fixed charging voltage displayed for demonstration.Current is the actual value measured by the INA219 sensor.Step 6: Mobile ChargingSince the relay is already ON after successful RFID authentication:Boost Converter↓Relay↓USB Charging Module↓Mobile PhoneThe mobile receives charging power generated by the BO motor.Overall System FlowPower ON│▼Initialize ESP8266│▼Scan RFID Card│├──────── Invalid│ ││ ▼│ Access Denied│ Relay OFF│▼Valid Card│▼Relay ON│▼Step on Foot Platform│├──────── Piezo│ ││ ▼│ Bridge Rectifier│ ││ ▼│ Capacitor│ ││ ▼│ LED Glow│▼BO Motor Generator│▼Boost Converter│▼INA219 Measurement│▼Current > 5mA ?│├──────── No│ ││ ▼│ "Rotate Motor"│▼Yes│▼Charging V:5.2VCurrent: XXX mA│▼USB Charging Output│▼Mobile Charging
Download the complete source code for this project.
Get every component for this project delivered to your door.