Air Mattress Controller V1
Open-Source Adjustable Firmness System
3.0 3. Electrical System
AC Power System (Mains Side)
Supplies power to the air pump and the AC-to-DC power supply. This section contains mains voltage and must be enclosed.
AC Power Wiring
AC LIVE → Fuse → Split
├→ Relay COM → Relay NO → Pump LIVE
└→ Power Supply (L)
AC NEUTRAL → Split
├→ Pump NEUTRAL
└→ Power Supply (N)
AC GROUND → Split
├→ Pump chassis
└→ Power Supply ground
Key rule: Only the live wire to the pump is switched. Neutral and ground remain continuously connected.
Safety Requirements
- unplug before wiring
- use insulated connectors
- enclose all AC wiring
- verify all connections before powering
- if you are not comfortable working with mains voltage, have someone experienced review your wiring before applying power
Low Voltage DC System (12V & Logic)
+12V → → valves → relay coil → buck converter / regulator input regulated output → → ESP32 → sensors → optional low-voltage UI parts GND → common ground bus
Grounding
All DC components share a common ground reference.
Powering the ESP32
The ESP32 must never be connected directly to 12V.
Using a buck converter
- connect the buck converter input to +12V and GND
- power the low-voltage system
- measure the output with a multimeter
- adjust the converter to 5.0V
- power off
- connect the regulated output to the ESP32 5V input
- power on again
Always verify voltage levels with a multimeter before connecting sensitive electronics.
DIY Air Mattress Controller V1 • Open Source Project