24V Grid Logic: HVAC Controller Retrofit
A standard $10 Arduino relay handles simple DC loads. The HVAC Controller Retrofit replaces a $200 Nest or Honeywell thermostat on the living room wall. It requires completely mastering the legacy 24V AC Control Infrastructure built inside 99% of modern residential heaters. The programmer must seamlessly switch these 24V high-loads using specific, isolated relay cascades while crunching non-stop temperature algorithms to keep a physical 2,000-square-foot house perfectly at 70°F!

The Standard HVAC Wire Standards (Rh, G, W, Y)
You cannot plug a furnace directly into an Arduino. The wall has 4 or 5 specific copper wires!
Rh (Red): The massive 24 Volt AC Transformer Hot source directly from the basement unit!G (Green): Activates the intense physical Fan Blower.W (White): Violently engages the Heating stage (Ignites the Fire/Gas valve!).Y (Yellow): Triggers massive outdoor Air Conditioning compressors!- The Execution Trap: To turn on the heat, the system must establish an exclusive physical connection bridging
Rh (24V)directly intoWandGconcurrently!
24V AC Relay Matrix Isolation
The Arduino cannot output 24V AC, it outputs 5V DC.
- You MUST utilize an enormous 4-Channel 5V Relay Module.
- Relay 1 (FAN) hooks
CommontoRed, andNOtoGreen. - Relay 2 (HEAT) hooks
CommontoRed, andNOtoWhite. - The C++ Software Safety Dead-Bands:
// If the House Temp is 68, and the Goal is 70!
if (currentTemp < (targetTemp - 1.0)) { // Minus 1 to prevent violent AC rapid-cycling!
digitalWrite(RelayFan, HIGH);
delay(5000); // 5 SEOND DELAY RULE! Never ignite gas before the fan spools up!
digitalWrite(RelayHeat, HIGH); // Ignite furnace!
}
- If the system ignores "Rapid Cycling" protection, it will violently turn the compressor ON/OFF 30 times a minute as the temperature fluctuates 0.1 degree, permanently destroying a standard $5000 Air Conditioning unit within an hour!
Industrial Thermodynamic Loadout
- ESP32 or NodeMCU (Brings the thermostat explicitly into HomeAssistant or the IoT Cloud Web UI!).
- DHT22 or BME280 Precision I2C Sensor (Must track decimal temperatures precisely for the Dead-Band loop).
- Absolute Multi-Channel 5V Optoisolated Relay Board.
- (DANGER: This directly interfaces with expensive Home Infrastructure! The 24V AC transformer can easily start a fire or destroy control boards if wired incorrectly to ground. Ensure the logic completely separates 5V DC and 24V AC systems!).