Voltage Measurement The Voltage Challenge ⚠️ Warning Microprocessors typically operate at low voltages (3.3V or 5V). Connecting high voltages directly (like 230V AC or 325V DC) would instantly destroy them!
Voltage Division To safely measure high voltages, we use voltage dividers to scale them down to microprocessor-friendly levels:
Voltage Divider Circuit Vin = 325V R1 64kΩ Vout = 5V R2 1kΩ Vout = Vin × (R2 / (R1 + R2)) 5V = 325V × (1kΩ / (64kΩ + 1kΩ)) 💡 Key Points Voltage division ratio determined by resistor values Higher R1 provides greater voltage reduction Power dissipation must be considered in resistor selection Total resistance affects circuit loading ⚙️ Precision Considerations Resistor tolerances directly affect measurement accuracy:0.1% tolerance on 64kΩ = ±64Ω variation Results in proportional output voltage error Can lead to significant measurement inaccuracies Temperature effects:Resistor values drift with temperature Use matched temperature coefficients Consider temperature compensation in software Recommendations:Use precision resistors (0.1% or better) Match temperature coefficients Consider calibration in software ⚠️ Safety Warning During grid isolation (open circuit):Voltage divider can act as a voltage source Can feed voltage back to grid inverter port pins May cause false voltage readings or safety issues Consider adding protection circuits for floating conditions 🔋 High Resistance & Power Considerations Low Resistance Example (Dangerous!) R1 = 64Ω, R2 = 1Ω
V = 325V
I = V/R = 325V/65Ω = 5A
P = V × I = 325V × 5A = 1,625W! 🔥
Extremely high current flow Dangerous power dissipation Components would instantly fail Risk of fire or explosion High Resistance Example (Safe) R1 = 8MΩ (cascade of resistors)
R2 = 125kΩ
I = 325V/8.125MΩ = 0.04mA
P = V × I = 325V × 0.04mA = 13mW ✅
Minimal current flow Safe power levels R1 split across multiple resistors:2MΩ + 2MΩ + 2MΩ + 2MΩ Prevents voltage arcing Better heat distribution PCB Layout Example (8MΩ using 2× 4MΩ 0805 SMD) 4MΩ 4MΩ 325V 162.5V 0V 0805 SMD Minimum 5mm creepage distance between high-voltage components