Electronics Safety: Mains Voltage, Batteries, and Soldering Hazards

Three things hurt hobbyists most: current through the chest, a swollen LiPo cell, and a lungful of flux smoke. Each one is predictable and preventable with a few bench rules. This guide covers the physics behind each hazard, the controls that work, and a pre-flight checklist you can print and pin above your bench.

Quick Takeaways

  • Current kills, not voltage. About 10 mA of AC can lock your hand on a conductor, and about 30 mA can stop breathing or trigger fibrillation.
  • Never work live on mains. Use an isolated, pre-certified AC-DC module, a fuse, and an RCD/GFCI, and keep one hand in your pocket.
  • Treat every lithium cell as a stored fire. Use a protected cell, a proper charger, a fireproof surface, and no unattended charging.
  • Solder with extraction. Use lead-free solder, move fumes away from your face, and wash your hands before eating.
Hazard Typical threshold Primary control Failure mode
Mains shock >10 mA AC Isolation + RCD Cardiac arrest, burns
LiPo/Li-ion >4.2V/cell, >~100°C BMS, safe charger Thermal runaway fire
Soldering burns ~350°C tip Stand, no clutter Burns, fire
Solder fumes Rosin + lead oxide Fume extraction Asthma, lead exposure

Part 1: Mains Voltage Safety

How Much Current Is Dangerous?

Body current depends on voltage, skin resistance, path, and duration. Published figures vary slightly by source, but the pattern is consistent. Around 1 mA is the perception threshold, and above 10 mA the arm muscles can freeze so you cannot release your grip. It takes roughly 30 mA to cause respiratory paralysis, and currents above 75 mA cause ventricular fibrillation. Strong shocks can also cause muscle spasms severe enough to dislocate joints.

Ohm’s law explains why wet hands are so dangerous. Dry skin may present 100 kΩ or more. Wet or broken skin can drop toward 1 kΩ.

  • Dry skin: 120V ÷ 100 kΩ ≈ 1.2 mA. You feel a tingle.
  • Wet skin: 120V ÷ 1 kΩ = 120 mA. This is in the fibrillation range.

The same 120V outlet can be harmless or lethal depending on your skin condition.

Why Mains DIY Differs From 5V Prototyping

A 5V USB rail cannot push dangerous current through dry skin. A 120V/230V rail can. Mains also stores energy in unexpected places. A bulk capacitor on a rectified 230V supply charges to about 325V peak. A 470 µF capacitor at that voltage stores:

E = ½ × C × V² = 0.5 × 470×10⁻⁶ × 325² ≈ 24.8 J

That is enough to deliver a painful, burn-causing discharge long after you unplug the board.

Core Mains Rules

  1. Prefer certified modules. Use an enclosed, isolated AC-DC converter (for example, a sealed 5V module with reinforced insulation) instead of building a bare transformerless supply.
  2. Fuse the live side. Put a correctly rated fuse on the line input, before anything else.
  3. Use an RCD/GFCI. A residual-current device trips at around 30 mA (or 5 mA on Class A GFCI outlets in the US). It cuts power faster than your heart can fail.
  4. Isolate the bench. An isolation transformer removes the earth-referenced shock path, though it does not make the secondary safe to touch.
  5. Use the one-hand rule. Keep your other hand away from grounded surfaces so current cannot cross your chest.
  6. Discharge before touching. Add a bleeder resistor across bulk capacitors, and verify 0V with a meter before handling.
  7. Enclose everything. No exposed mains terminals. Use an insulated enclosure, strain relief, and a ground connection on metal cases.
  8. Never work alone on mains projects.

Mains Isolation Options Compared

Option Cost Shock protection Best for
Certified AC-DC module Low High (reinforced isolation) Permanent builds
Isolation transformer Medium Medium (secondary still live) Bench repair
RCD/GFCI outlet Low High (trips on leakage) Every bench
Bare transformerless supply Lowest None Avoid entirely

Microcontrollers Near Mains: Use Optical Isolation

If a GPIO pin must control a mains load, break the electrical path. Use a solid-state relay or an optocoupler driving a TRIAC. The control side (3.3V/5V) then has no galvanic connection to the load side. Keep creepage and clearance distances on the PCB in line with your region’s standard, and keep the mains section physically separated from the logic section.

Part 2: Battery Safety (LiPo, Li-ion, LiFePO4)

Why Lithium Cells Burn

Lithium-ion fire hazards come from high energy density combined with a flammable organic electrolyte. Physical damage, short circuits, overcharging, and high temperatures can all start thermal runaway, a self-heating chain reaction that can spread to adjacent cells. Runaway can begin when part of a cell reaches roughly 100°C.

Runaway is rare in quality cells with proper protection, but the consequences are severe. Lithium-based cells can generate their own oxygen during runaway, so a normal room extinguisher may not stop the fire.

Voltage Limits You Should Memorize

Chemistry Nominal Full charge Safe cutoff
LiPo / Li-ion 3.7V 4.20V ~3.0V (3.2V is kinder)
LiFePO4 3.2V 3.65V ~2.5V
NiMH 1.2V ~1.4V ~1.0V

Charge at 1C or lower unless the datasheet allows more. A 2000 mAh cell charges at 2A at 1C. Use the CC/CV profile, which holds constant current to 4.2V and then constant voltage until the current tapers.

Battery Safety Rules

  • Use protected cells or a BMS. The protection circuit guards against overcharge, over-discharge, and short circuit.
  • Never solder directly to a bare cell. The heat can damage the separator. Use tabbed cells or spot-welded nickel strips.
  • Charge on a non-flammable surface, in view, never overnight, and away from curtains or paper.
  • Fuse the pack output. A short on a LiPo can deliver tens of amps.
  • Retire puffed cells. A swollen pouch means gas is building inside. Discharge safely, then recycle at an approved drop-off.
  • Avoid heat. Do not leave lithium-ion devices in hot sun, such as on a car dashboard.
  • Dispose properly. Tape the terminals and use a battery recycling point.
  • If a cell ignites, evacuate and call emergency services. One university guideline lists ABC or Class D extinguishers or sand as options for rechargeable lithium fires. Do not handle the burning pack.

Firmware Safeguard: LiPo Low-Voltage Cutoff

Over-discharge damages cells. This ESP32 sketch reads the pack through a 100 kΩ / 100 kΩ voltage divider (halving the voltage) and enters deep sleep below a safe threshold.

// ESP32 LiPo low-voltage cutoff
// Wiring: Battery+ -> 100k -> GPIO34 -> 100k -> GND

const int   BAT_PIN      = 34;      // ADC1 channel (safe to use with Wi-Fi)
const float DIVIDER      = 2.0;     // 100k/100k halves the voltage
const float ADC_REF_V    = 3.3;     // ADC full-scale reference
const int   ADC_MAX      = 4095;    // 12-bit ADC resolution
const float CUTOFF_V     = 3.30;    // Protect cell: sleep below this voltage

float readBatteryVoltage() {
  long sum = 0;
  for (int i = 0; i < 16; i++) {    // Average 16 samples to reduce ADC noise
    sum += analogRead(BAT_PIN);
    delay(2);
  }
  float raw = sum / 16.0;
  return (raw / ADC_MAX) * ADC_REF_V * DIVIDER;  // Scale back to pack voltage
}

void setup() {
  Serial.begin(115200);
  analogSetPinAttenuation(BAT_PIN, ADC_11db);    // Allow ~0-3.3V input range
}

void loop() {
  float v = readBatteryVoltage();
  Serial.printf("Battery: %.2f V\n", v);

  if (v < CUTOFF_V) {
    Serial.println("Low battery: entering deep sleep");
    esp_deep_sleep_start();         // Stop drawing load; wake only via reset/charge
  }
  delay(1000);
}

The ESP32 ADC is nonlinear near its limits, so calibrate against a multimeter reading and adjust ADC_REF_V. This software cutoff supplements a hardware BMS. It does not replace one.

Part 3: Soldering Hazards

Burns and Fire

A typical iron tip runs hot enough to ignite paper and cause deep burns. One university guideline cites tip temperatures near 400°C. Leaded solder melts near 183°C. Lead-free SAC305 melts at about 217–220°C, so lead-free work usually needs a tip at 350–380°C.

  • Return the iron to its stand every time.
  • Clear flammables from the bench.
  • Let the board cool before you touch it.
  • Unplug the iron when you leave.

Fumes and Lead

Soldering produces two separate fume problems.

Flux fumes. Rosin-based flux fumes can cause occupational asthma, worsen existing asthma, and irritate the eyes and upper airway. Even occasional solderers should use fans or local exhaust ventilation.

Lead. Hand contact with lead solder or contaminated surfaces creates an ingestion hazard, and lead oxide fumes can form during soldering. Lead-free alternatives are encouraged whenever possible, though they melt at higher temperatures. Chronic lead exposure is linked to reproductive, digestive, and memory problems.

Soldering Controls

Control Action Why it works
Substitution Use lead-free solder, rosin-free flux where practical Removes the hazard
Ventilation Use a fume extractor with a carbon filter, placed close to the work Captures fumes at the source
Hygiene Wash hands before eating, drinking, or touching your face Stops ingestion
Eye protection Wear safety glasses Blocks solder splatter, clipped leads
Workspace Keep a brass wool tip cleaner, not a wet sponge, for tip care Reduces thermal shock to the tip

Clip leads away from your face and toward a cup or cloth. Flying lead ends injure eyes.

Heat-Related Warnings

Do not heat PTFE (Teflon) insulation with a hot iron or heat gun. It can release toxic fumes above about 450°C. Remove capacitor and battery components from hot-air rework zones unless the datasheet allows the temperature profile.

Real-World Workflow: Building a Safe Mains-Powered IoT Relay Node

This example controls a 230V/120V lamp from an ESP32 while keeping you safe.

Parts

  • Enclosed AC-DC module (5V/600 mA, reinforced isolation)
  • Fuse holder with a slow-blow fuse sized for the load
  • Opto-isolated relay board (or SSR) rated above the load current
  • ESP32 dev board
  • Insulated enclosure with cable glands

Steps

  1. Build the low-voltage side first. Power the ESP32 from a USB supply and test the relay input with GPIO logic only. No mains yet.
  2. Fit the mains section last. Mount the AC-DC module and relay board inside the enclosure, separated from the logic board by a barrier.
  3. Fuse the live conductor before it reaches the module and the relay.
  4. Check isolation. With the unit unplugged, use a meter in continuity mode to confirm there is no connection between mains pins and the 5V/GND logic rail.
  5. Close the enclosure before the first power-up.
  6. Power through an RCD or GFCI-protected outlet the first time.
  7. Never touch the board while it is plugged in. Make any change with the unit unplugged, then wait and verify 0V across the bulk capacitor.

Pre-Flight Bench Checklist

  • [ ] RCD/GFCI outlet in use
  • [ ] Mains circuits unplugged and capacitors verified at 0V before handling
  • [ ] No jewelry, dry hands, dry floor
  • [ ] Lithium cells inspected: no swelling, dents, or heat
  • [ ] Charger matches the cell chemistry
  • [ ] Fire-resistant charging surface and nothing flammable nearby
  • [ ] Fume extractor on and positioned close to the joint
  • [ ] Safety glasses on
  • [ ] Iron returned to its stand when not in use
  • [ ] Hands washed before eating or drinking

Frequently Asked Questions

How much current from a household outlet can kill you?

Roughly 30 mA of AC through the chest can cause respiratory paralysis or ventricular fibrillation. Higher currents above about 75 mA make fibrillation more likely. A standard outlet can supply far more than that, so only the body’s resistance and the shock duration limit the harm.

Is it safe to charge a LiPo battery overnight?

No. Charge only while you are present and awake, on a non-flammable surface, with a charger matched to the cell chemistry. Overcharging, damage, and heat can start thermal runaway, and an unattended fire spreads quickly.

Is lead-free solder safer than leaded solder?

Lead-free solder removes the lead exposure, but it still produces flux fumes, and it runs hotter, which raises the burn and fume load. Use lead-free solder together with fume extraction and good hand hygiene.

Do I need a fume extractor for occasional soldering?

Yes, or at least strong ventilation that moves fumes away from your face. Rosin flux fumes can trigger asthma even in occasional users. A small carbon-filter extractor placed near the joint is inexpensive and effective.

Hot this week

Right to Repair and DIY Electronics: What You’re Allowed to Do

Know your rights before you open that device. Learn what right-to-repair laws, warranties, and the DMCA let you do. Read the guide and repair safely.

Edge AI Boards Compared: Raspberry Pi, Jetson, Arduino Uno Q, and ESP32-S3

Compare Raspberry Pi 5 + AI HAT+ 2, Jetson Orin Nano Super, Arduino UNO Q and ESP32-S3 for edge AI. See TOPS, power and cost. Pick your board now.

How to Test Components: Resistors, Diodes, Transistors, and Capacitors

Learn how to test components like resistors, diodes, transistors, and capacitors with a multimeter. Follow the steps and start testing now.

The Serial Monitor: Your Best Debugging Tool

Learn to debug Arduino and ESP32 projects with the Serial Monitor. Master Serial.print, baud rates, and tricks to fix bugs fast. Start debugging now.

SSH, VNC, and Raspberry Pi Connect: Remote Access Options Compared

SSH, VNC, or Raspberry Pi Connect? Compare setup, speed, security, and use cases, then pick the best way to control your Pi remotely. Read the guide.

Topics

Right to Repair and DIY Electronics: What You’re Allowed to Do

Know your rights before you open that device. Learn what right-to-repair laws, warranties, and the DMCA let you do. Read the guide and repair safely.

Edge AI Boards Compared: Raspberry Pi, Jetson, Arduino Uno Q, and ESP32-S3

Compare Raspberry Pi 5 + AI HAT+ 2, Jetson Orin Nano Super, Arduino UNO Q and ESP32-S3 for edge AI. See TOPS, power and cost. Pick your board now.

How to Test Components: Resistors, Diodes, Transistors, and Capacitors

Learn how to test components like resistors, diodes, transistors, and capacitors with a multimeter. Follow the steps and start testing now.

The Serial Monitor: Your Best Debugging Tool

Learn to debug Arduino and ESP32 projects with the Serial Monitor. Master Serial.print, baud rates, and tricks to fix bugs fast. Start debugging now.

SSH, VNC, and Raspberry Pi Connect: Remote Access Options Compared

SSH, VNC, or Raspberry Pi Connect? Compare setup, speed, security, and use cases, then pick the best way to control your Pi remotely. Read the guide.

How to Troubleshoot a Dead Circuit: A Systematic Method

Learn a step-by-step method to troubleshoot a dead circuit: check power, trace voltages, test components, and fix faults fast. Start diagnosing now.

Fume Extraction and Lead-Free Solder: Is Soldering Safe?

Is soldering safe? Learn what's in solder fumes, how lead-free solder changes the risk, and how to set up proper extraction. Read the guide now.

RTL-SDR on Raspberry Pi: Software-Defined Radio for Beginners

Set up an RTL-SDR on Raspberry Pi: install drivers, tune FM, track aircraft with ADS-B, and decode signals. Follow the step-by-step guide.

Related Articles

Popular Categories