8 November 2026 · Soldr

Relay module active-low or active-high? Test it with one jumper wire

Short answer: don't guess, test. With nothing connected to the relay contacts, power the board from 5 V and GND, then touch its IN1 pin to GND with a jumper wire, and then to 5 V. Whichever one makes the relay click (and joins COM to NO on a meter) is the level that turns it on. If GND does it, the board is active-low; if 5 V does it, it's active-high. Then write your code around that level.

A two-channel relay module has a control header (VCC, GND, IN1, IN2) and screw terminals for the switched circuit. Code written for one board often runs backwards on another: the relay is on when it should be off, or it clicks at power-up. The cause is the trigger level. Some boards turn a relay on when the input is pulled low, others when it is driven high, and for the board we stock no maker document says which. Our 2-channel relay module reference page says so plainly and leaves the input stage out.

This guide covers the signal side only: the control header and the coil supply. Anything connected to mains through the relay contacts, and the enclosure around it, must be wired by a qualified person.

What active-low and active-high mean

Neither is better. They just need opposite code. Get it wrong and every "on" in your sketch is an "off".

The jumper-wire test

You need the relay board, a board with a 5 V pin (an Uno here), a few jumper wires and, ideally, a multimeter. Leave the relay's screw terminals empty for the whole test.

  1. Power the board: connect the module's VCC to the Uno's 5V and GND to GND, using the labels printed on the module. Leave IN1 and IN2 unconnected for now. Note whether a relay clicks or an indicator LED lights at power-up.
  2. Touch IN1 to GND with a jumper wire. Listen for the click and watch the channel's LED.
  3. Touch IN1 to 5V instead. Listen and watch again.
  4. Confirm with the meter: on continuity, probe the channel's COM and NO terminals. They should beep only while the relay is energised. COM to NC does the opposite.
  5. Write down the result: "on at GND" means active-low; "on at 5 V" means active-high. Repeat for IN2. The two channels should match.

If neither level clicks the relay, check VCC and GND first, then look for a jumper on the board and read its printed labels. Don't change jumpers you don't understand. Note what you found and test again.

Check the input current before you use a pin

The jumper wire carries whatever current the input draws. Before you replace it with a board pin, measure that current: put the meter on its milliamp range, in series between IN1 and the level that switched it. The Uno R3's official datasheet gives 20 mA per I/O pin. The ATmega328P's absolute maximum is 40 mA, but that's a stress limit, not a working current. A normal reading sits well below 20 mA.

Testing for a 3.3 V board

The input stage of our module isn't documented, so its behaviour with a 3.3 V board isn't known in advance. Run the same test with a 3.3 V board's 3.3V pin as the "high" level, still powering the module from 5 V. If 3.3 V switches an active-high board on, or switches an active-low board fully off (no click, no LED, no COM-NO continuity), a 3.3 V pin can drive it. If not, the module needs a transistor or a level shifter between the pin and the input.

Write the code around your result

Name the levels once, at the top of the sketch, so the rest of the code reads "on" and "off":

const int RELAY1 = 7;
const int RELAY_ON  = LOW;   // active-low board: on at GND
const int RELAY_OFF = HIGH;  // swap both if your test said active-high

void setup() {
  digitalWrite(RELAY1, RELAY_OFF);  // set the off level first...
  pinMode(RELAY1, OUTPUT);          // ...then make the pin an output
}

void loop() {
  digitalWrite(RELAY1, RELAY_ON);
  delay(1000);
  digitalWrite(RELAY1, RELAY_OFF);
  delay(1000);
}

Writing the off level before pinMode(OUTPUT) means the pin starts at "off" the moment it becomes an output, instead of briefly driving LOW. On an active-low board, that brief LOW is enough to click the relay at start-up.

Power for the coils

If the relays are marked SRD-05VDC-SL-C, the Songle datasheet gives each coil about 71.4 mA at 5 V, so about 143 mA with both on, plus the board's LEDs and input stage. The relay pulls in at 75% of its rated voltage or less and switches in 10 ms or less. A USB-powered Uno can usually manage two coils, but add them to your budget with the power budget guide. If the coil drives something inductive on the load side, see flyback diodes, and for the mechanics, how relays work.

With Soldr

When you describe a relay build ("I want to build a temperature-controlled 12 volt fan with an Arduino Uno, a DHT22 sensor and a 2-channel relay module"), Soldr writes the code and shows how to wire every part. Run the jumper-wire test first and tell Soldr whether your board is active-low or active-high, so the on and off levels in the code match your board.

On Compoden: 5V dual-channel relay module. Describe your build on app.soldr.ai. Sign in and get 100 credits free.