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
Terminal-to-terminal wiring
| From | To |
|---|---|
| 24 V source + / − | PWR INTF DC INPUT + / − |
| PWR INTF 5 V / GND | Teensy VIN / GND |
| PWR INTF 12 V / GND | OUT-4 CN1 DC+ / DC− |
| Teensy D3 | OUT-4 CN2 IN1 |
| Teensy GND | OUT-4 CN2 GND |
| Voltage-free contact | Teensy 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
- 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.
- 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.
- 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.
- 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
| Observation | First check |
|---|---|
| OUT-4 PWR OK dark | Check 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 closed | Check D3, IN1 and CN2 GND. |
| OUT1 LED on; no fan rotation | Power OFF; check CN3 V+/OUT1 and fan rating. |
| Teensy resets | Review the 5 V rail and fan inrush. |
| Fan always runs | Check 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 firmware (.ino)
Related application notes
- Choose and wire a 12 V or 24 V fan supply (AN-09). Use the PWR INTF fan interface for supply selection, PWM and tach feedback.
- Read dry-contact switches with PWR INTF (AN-10). AN-10 reads contacts through PWR INTF. AN-01 reads the contact directly at Teensy D2. Use the wiring and firmware for the selected interface.
Return to the application-note index
Product manuals and documentation · PWR INTF · PWR INTF quick start · OUT-4 · OUT-4 quick start
