Skip to Content

AN-01: Control a 12 V fan with OUT-4

Switch a 12 V DC fan with a dry contact, Teensy 4.1 and KI Maker OUT-4. Follow the wiring and check supply polarity, GPIO control and fan current.

By Frank Kuster

AN-01: Control a 12 V fan with OUT-4 featured image
AN-01: Control a 12 V fan with OUT-4

KI MAKER / APPLICATION NOTE AN-01 · Revision 3.5 · November 2026

Switch a 12 V DC fan using a dry contact, a Teensy 4.1 and the KI Maker OUT-4.

Hardware: PWR INTF, OUT-4, Teensy 4.1

Scope and prerequisites

This Teensy 4.1 example switches a compatible 12 V fan through OUT-4 using a voltage-free contact. PWR INTF receives 24 V DC in this setup and supplies 5 V to the Teensy and regulated 12 V to OUT-4. Follow the terminal-to-terminal table below. The operating checks are expected values, not measured prototype results.

Functional connection diagram

Control a 12 V fan with OUT-4: source functional connection diagram
Extracted from AN-01 Rev 3.5. Functional paths, not physical pin positions. Follow the actual board silkscreen and the equipment documentation. Power OFF before wiring.

Terminal-to-terminal wiring

FromTo
24 V source + / −PWR INTF DC INPUT + / −
PWR INTF 5 V / GNDTeensy VIN / GND
PWR INTF 12 V / GNDOUT-4 CN1 DC+ / DC−
Teensy D3OUT-4 CN2 IN1
Teensy GNDOUT-4 CN2 GND
Voltage-free contactTeensy D2 / GND
Fan + / −OUT-4 CN3 V+ / OUT1

Firmware example

Use the target controller and power/programming procedure described here. Generic Arduino-API pin numbers are examples, not universal pin assignments.

// Contact D2 to GND; D3 to OUT-4 IN1
constexpr int CONTACT_PIN = 2;
constexpr int FAN_PIN = 3;
void setup() {
  pinMode(CONTACT_PIN, INPUT_PULLUP);
  digitalWrite(FAN_PIN, LOW);
  pinMode(FAN_PIN, OUTPUT);
}
void loop() {
  const bool closed = digitalRead(CONTACT_PIN) == LOW;
  digitalWrite(FAN_PIN, closed ? HIGH : LOW);
  delay(10);
}

Commissioning

  1. Confirm the fan is a 12 V model; check maximum, startup and stall current against both boards. Identify and insulate unused PWM/TACH wires; connect power wires only.
  2. With no fan, use a current-limited 24 V source and measure 5 V and 12 V rails. Check PWR OK on the appropriate board.
  3. Power OFF and disconnect external 5 V from Teensy VIN. Program using Arduino IDE and Teensy board support over USB. Unplug USB before restoring VIN and fan wiring with power OFF. For simultaneous USB and external power, follow PJRC Teensy 4.1 VIN/VUSB isolation guidance.
  4. Close the contact and observe expected OUT1 LED/fan ON; open for OFF. Measure fan voltage, rail sag and heating.

Expected operation

Expected: open contact → D3 LOW (approximately 0 V) → fan OFF; closed → D3 HIGH (3.3 V) → fan ON. The 10 ms delay is not debounce. Nominal checks: PWR INTF 5 V to GND approximately 5 V; 12 V to GND approximately 12 V; OUT-4 CN1 DC+ to DC− approximately 12 V. These are nominal values, not measurements.

Troubleshooting

ObservationFirst check
OUT-4 PWR OK darkCheck for approximately 12 V DC across OUT-4 CN1 DC+ and DC− and verify polarity. Here, OUT-4 is fed from the PWR INTF regulated 12 V rail. The PWR INTF board’s own DC input is rated 18–30 V DC. Switch power OFF before inspecting or changing wiring.
OUT1 LED dark with contact closedCheck D3, IN1 and CN2 GND.
OUT1 LED on; no fan rotationPower OFF; check CN3 V+/OUT1 and fan rating.
Teensy resetsReview the 5 V rail and fan inrush.
Fan always runsCheck whether fan negative bypasses OUT1.

Ratings and references

PWR INTF Rev-B input 18–30 VDC; regulated 12 V shared load/thermal budget must be checked; 5 V rail ≤1 A continuous. OUT-4 Rev-A supply 5–24 VDC nominal, ≤1 A/channel and ≤3 A board total; outputs are not short-circuit protected. CN3 V+ stays powered; OUT1 switches the negative lead and is not permanent GND. Common logic ground is required. Teensy GPIO maximum 3.3 V: never apply 12 V. No AC mains; power OFF before rewiring. Independent application; not sponsored or endorsed by PJRC.

Reference: AN-01, Rev 3.5. See the current board manuals, quick starts and specifications for complete operating limits. This example reads the dry contact directly at Teensy D2. AN-10 reads contacts through the PWR INTF interface and uses its own wiring and firmware. The web version makes the OUT-4 terminal name explicit.

Download AN-01 PDF (Rev 3.5)

Download AN-01 firmware (.ino)

Related application notes

Return to the application-note index

Product manuals and documentation · PWR INTF · PWR INTF quick start · OUT-4 · OUT-4 quick start