DEV Community

Cover image for Tiny Contacts Fits Four Relays Onto a 42 x 38 mm ESP32 Board
circuitrocks
circuitrocks

Posted on Originally published at blog.circuit.rocks

Tiny Contacts Fits Four Relays Onto a 42 x 38 mm ESP32 Board

Your ESP32 home automation controller needs four switched outputs, but the enclosure only has room for one of those blue hobby relay modules. Now what?

Sergio Ghirardelli's answer is Tiny Contacts, a four-channel relay board that measures 42 x 38 mm. That is barely larger than the single-channel modules sitting in most parts drawers, except it carries four independent channels. Anyone who has tried to fit a switching board, a 5 V supply, and a dev board into one project box knows why that footprint matters more than any spec on the datasheet.

How does it get that small?

The size comes down to relay choice. Instead of the tall through-hole relays found on inexpensive modules, Tiny Contacts uses four Omron G6K-2F-Y surface-mount relays. Those are signal-grade parts that claim far less PCB area, which is what frees up room for four channels on a board this size. Read the G6K contact rating against your load before you wire anything to a wall outlet, because a signal relay is not a mains appliance switch. The board itself runs from 5 VDC and accepts 3.3 V to 5 V on its control inputs, so ESP32, ESP8266, Arduino, ATtiny, and STM32 boards all drive it without a level shifter.

Why not just drive the coils from a GPIO pin?

Because a relay coil pulls far more current than a GPIO pin should ever source. Tiny Contacts puts a ULN2003A between your microcontroller and the coils. The ULN2003A is a seven-channel Darlington array, and four of those channels supply the coil current here while your GPIO pins only see a logic-level signal. The chip also carries the flyback suppression diodes that absorb the inductive spike when a coil de-energizes. Leave that diode out of a hand-wired relay circuit and you get random resets first, then a dead microcontroller. Onboard LEDs show board power plus per-channel state, which turns "is that output actually closed?" into a glance instead of a multimeter probe.

Try this on your own bench

You do not need the board to learn the circuit. Drop a ULN2003A on a breadboard, tie pin 8 to ground and pin 9 to your 5 V rail so the internal clamp diodes are connected, then run one relay coil from an output pin. Toggle it from GPIO 4 on an ESP32 and watch what happens to your serial output if you disconnect pin 9. That single experiment explains flyback protection better than any diagram. Ghirardelli's write-up on the board is at Hackster, and the Omron G6K and TI ULN2003A datasheets are both worth a read before your next switching build.


Originally published on blog.circuit.rocks.

esp32 #esp8266 #iot #wifi #circuitrocks

Top comments (0)