Fume extractor with interlock
Build it step by step
0 of 9 doneSet the buck converter
Connect the 12 V adapter to the LM2596 only and turn the screw until the output reads 5.0 V.
Wire the 5 V rail
LM2596 output to the Nano 5V and GND pins, with the Nano unplugged from USB.
Wire the current sensor
ACS712 VCC to 5V, GND to GND and OUT to A0.
Wire the relays
IN1 to D7, IN2 to D8, VCC to 5V and GND to GND.
Wire the fan path
12 V terminal to relay 1 COM, relay 1 NO to the ACS712 IP+, IP- to the fan red wire, fan black wire to the ground terminal.
Wire the tool and the controls
Relay 2 NO to the strip +, strip - to ground, button D2 to GND, LEDs on D4 and D5.
Upload the sketch with everything off
The monitor says Interlock ready, because the zero point is measured now.
Press the button
The fan starts, and after three seconds the strip and green light switch on.
Press the button again
The strip goes off and the fan keeps running for a minute.
How do you build a fume extractor with interlock?
A work station only lets the tool switch on while the extractor fan is really running. The sketch measures the fan current with an ACS712, so a stuck or unplugged fan keeps the tool off, and it keeps the fan going for a minute after the tool stops to clear the fumes. A 12 V lamp strip stands in for the tool, so it is safe to build and test. You need Arduino Nano, 12 V DC fan 80 mm, ACS712 current sensor module (5 A / 20 A / 30 A), Relay module 2-channel 5 V, 12 V 2 A DC adapter, DC barrel to screw terminal adapter (female), LM2596 Buck Module, 12 V LED strip warm white (5 m, 2835), Tactile push button 6 mm, LED 5 mm red, LED 5 mm green, Resistor 220 Ω × 2, Breadboard 830 Tie Points and Jumper wires male to male (40 pcs, 20 cm). It takes 9 steps and about 120 minutes.
- Level
- Beginner
- Time
- About 120 min
- Parts
- 14
Parts list
- Development BoardsBuyArduino Nano × 1
- Motors & ActuatorsBuy
- SensorsBuy
- InterfacesBuy
- PowerBuy
- PowerBuy
- PowerBuy
- OptoelectronicsBuy
- SwitchesBuy
- SemiconductorsBuyLED 5 mm red × 1
- SemiconductorsBuyLED 5 mm green × 1
- PassivesBuyResistor 220 Ω × 2
- PrototypingBuy
- PrototypingBuy
Tick what you already own. It saves to My Garage, so “Build with what I have” knows.
Wiring
| From | To | Why |
|---|---|---|
| 12 V adapter | Screw terminal adapter | The only 12 V supply |
| Terminal + and - | LM2596 IN+ and IN- | Set OUT to 5.0 V with no load first |
| LM2596 OUT+ and OUT- | Nano 5V and GND | Powers the Nano, relay board and ACS712 |
| Terminal + | Relay 1 COM and Relay 2 COM | 12 V into both relay switches |
| Relay 1 NO | ACS712 IP+ | Fan power goes through the current sensor |
| ACS712 IP- | Fan red wire | Carries the fan current |
| Fan black wire | Terminal - | Completes the fan circuit |
| Relay 2 NO | 12 V LED strip + | The stand-in tool |
| LED strip - | Terminal - | Completes the tool circuit |
| ACS712 VCC, GND and OUT | Nano 5V, GND and A0 | Output is 2.5 V plus 0.185 V per amp |
| Relay board IN1 and IN2 | Nano D7 and D8 | Fan and tool, active LOW |
| Relay board VCC and GND | Nano 5V and GND | Coil power |
| Start button | Nano D2 and GND | Press to ask for the tool |
| Green LED | Nano D4 through 220 ohms to GND | Tool allowed |
| Red LED | Nano D5 through 220 ohms to GND | Fan fault or tool off |
Code
An interlock is a rule that one thing may only happen while another is true. Here the tool may only run while the extractor fan is really spinning. The sketch does not trust the fan relay, which would still click if the fan were jammed or unplugged. It measures the current instead. The fan's red wire passes through the ACS712 sensor, which sends a voltage to A0 that sits at 2.5 V with no current and moves by 0.185 V for every amp. A small 12 V fan draws about 0.15 to 0.3 A, so the change is small, and the sketch averages 64 readings and measures the zero point at start-up with everything off, which makes it steady and removes the sensor's own offset. When you press the button, the fan relay switches on, and three seconds later, once the fan has reached speed, the sketch checks the current. Only if it is above 0.08 A does the tool relay switch on and the green light come on. If the fan is stopped, the red light blinks and the tool stays off. When you press the button again the tool switches off at once, but the fan keeps running for a minute to clear the fumes, which is called a run-on. The stand-in tool is a 12 V LED strip, so you can test everything safely. Never use this board to switch mains. A real station needs a certified mains controller with its own interlock. Set the LM2596 to 5.0 V with a multimeter before you connect the Nano, and do not press the button while measuring zero.
Runs on a virtual Arduino Nano in your browser, with sliders for the sensors. Happy with it? Verify and upload to your real board from the same page (Chrome or Edge on a computer).
const uint8_t BTN = 2;
const uint8_t FAN_RELAY = 7; // active LOW
const uint8_t TOOL_RELAY = 8; // active LOW
const uint8_t GREEN = 4;
const uint8_t RED = 5;
const uint8_t SENSE = A0;
const float AMPS_PER_COUNT = 5.0 / 1023.0 / 0.185; // ACS712 5 A: 185 mV per amp
const float MIN_FAN_AMPS = 0.08; // below this the fan counts as stopped
const unsigned long RUN_ON = 60000; // keep the fan on a minute after the tool stops
const unsigned long SPIN_UP = 3000; // fan needs this long to reach speed
int zeroCounts = 512;
bool toolWanted = false;
bool prevBtn = false;
unsigned long fanOnAt = 0;
unsigned long toolOffAt = 0;
bool fanOn = false;
float fanAmps() {
long sum = 0;
for (int i = 0; i < 64; i++) sum += analogRead(SENSE);
float counts = sum / 64.0;
return fabs(counts - zeroCounts) * AMPS_PER_COUNT;
}
void setFan(bool on) {
if (on && !fanOn) fanOnAt = millis();
fanOn = on;
digitalWrite(FAN_RELAY, on ? LOW : HIGH);
}
void setup() {
pinMode(BTN, INPUT_PULLUP);
pinMode(FAN_RELAY, OUTPUT);
pinMode(TOOL_RELAY, OUTPUT);
pinMode(GREEN, OUTPUT);
pinMode(RED, OUTPUT);
digitalWrite(FAN_RELAY, HIGH);
digitalWrite(TOOL_RELAY, HIGH);
Serial.begin(9600);
delay(500);
long sum = 0; // measure the zero point with everything off
for (int i = 0; i < 128; i++) sum += analogRead(SENSE);
zeroCounts = sum / 128;
Serial.println(F("Interlock ready, press the button for the tool"));
}
void loop() {
bool b = (digitalRead(BTN) == LOW);
if (b && !prevBtn) {
toolWanted = !toolWanted;
if (!toolWanted) toolOffAt = millis();
Serial.println(toolWanted ? F("Tool requested") : F("Tool off, fan will run on"));
}
prevBtn = b;
// The fan runs whenever the tool is wanted, and for a minute afterwards.
bool needFan = toolWanted || (millis() - toolOffAt < RUN_ON && toolOffAt > 0);
setFan(needFan);
bool fanProven = fanOn && millis() - fanOnAt > SPIN_UP && fanAmps() > MIN_FAN_AMPS;
bool toolAllowed = toolWanted && fanProven;
digitalWrite(TOOL_RELAY, toolAllowed ? LOW : HIGH);
digitalWrite(GREEN, toolAllowed);
bool fault = toolWanted && !fanProven && millis() - fanOnAt > SPIN_UP;
digitalWrite(RED, fault ? (millis() / 250) % 2 : !toolWanted && fanOn);
static unsigned long last = 0;
if (millis() - last > 1000) {
last = millis();
Serial.print(F("Fan "));
Serial.print(fanOn ? F("on ") : F("off "));
Serial.print(fanAmps(), 2);
Serial.print(F(" A, tool "));
Serial.println(toolAllowed ? F("ALLOWED") : F("blocked"));
}
}What the serial monitor should show
Open the serial monitor at the baud rate in the code. This is what our simulator prints for a virtual Arduino Nano with its sensors at their default values. Your numbers will follow your real readings, but the format should match.
Interlock ready, press the button for the tool Fan off 0.03 A, tool blocked
Test checklist
What you should see at each check. If a reading is far off, stop and use the troubleshooting list.
| Check | Expected |
|---|---|
| Power up and wait | Fan off, strip off, monitor reads 0.00 A |
| Press the button | Fan starts, then after 3 s the strip is allowed and the green light is on |
| Fan current in the monitor | About 0.15 to 0.3 A for an 80 mm fan |
| Press the button again | Strip off at once, fan runs for about 60 seconds |
| Jam the fan blade with a pencil while it runs | The strip goes off and the red light blinks |
If it does not work
Tool never allowed
Measure the fan current; if it is below 0.08 A lower MIN_FAN_AMPS or check the fan runs through the ACS712.
Current reads half an amp with the fan off
The sensor was powered while measuring zero, so restart the Nano with the fan wires connected but off.
Readings jump around
Keep the signal wire from A0 away from the relay and fan wires.
Relays work the wrong way round
Your board switches on with HIGH, so swap the HIGH and LOW writes.
Nano resets when the relays click
Add a 100 uF capacitor across the Nano power and keep the converter wires short.
Upload fails
Choose the Old Bootloader option for the Nano.
Still stuck? Find the fault step by step with your multimeter →
Common questions
What parts do I need for the fume extractor with interlock?
Arduino Nano, 12 V DC fan 80 mm, ACS712 current sensor module (5 A / 20 A / 30 A), Relay module 2-channel 5 V, 12 V 2 A DC adapter, DC barrel to screw terminal adapter (female), LM2596 Buck Module, 12 V LED strip warm white (5 m, 2835), Tactile push button 6 mm, LED 5 mm red, LED 5 mm green, Resistor 220 Ω × 2, Breadboard 830 Tie Points and Jumper wires male to male (40 pcs, 20 cm).
How long does the fume extractor with interlock take to build?
About 120 minutes for a beginner maker, in 9 steps.
How do I know the fume extractor with interlock works?
Power up and wait: Fan off, strip off, monitor reads 0.00 A. Press the button: Fan starts, then after 3 s the strip is allowed and the green light is on. Fan current in the monitor: About 0.15 to 0.3 A for an 80 mm fan.
Tool never allowed: what should I check?
Measure the fan current; if it is below 0.08 A lower MIN_FAN_AMPS or check the fan runs through the ACS712.
Current reads half an amp with the fan off: what should I check?
The sensor was powered while measuring zero, so restart the Nano with the fan wires connected but off.
Readings jump around: what should I check?
Keep the signal wire from A0 away from the relay and fan wires.
Relays work the wrong way round: what should I check?
Your board switches on with HIGH, so swap the HIGH and LOW writes.
