Relay Control with GPIO

2:15

Reviewing the bill of materials.

Reviewing the bill of materials.

Looking for "Absolute Maximum Ratings for GPIO current" in esp32-c3-wroom-02_datasheet_en.pdf

Looking for "Recommended Operating Conditions: Output current" in esp32-c3-wroom-02_datasheet_en.pdf

Looking for "Table 11 DC Characteristics IOH" in esp32-c3-wroom-02_datasheet_en.pdf

Looking for "Coil resistance" in SRD-05VDC-SL-C-Datasheet.pdf

Looking for "Coil power" in SRD-05VDC-SL-C-Datasheet.pdf

Here’s the comparison (from the datasheets you provided):

Table


ParameterValueSource
ESP1 High-level source current (IOH)40 mA (typical)ESP32-C3 Datasheet, Table 11 DC Characteristics
SRD-05VDC-SL-C Coil current (6 V coil)75 mA (nominal)SRD-05VDC-SL-C Datasheet, Coil Data Chart (6 V)
Equivalent 5 V coil current90 mA (0.45 W/5 V)SRD-05VDC-SL-C Datasheet (0.45 W power draw)
ConclusionGPIO sourcing 40 mA < relay coil 75–90 mAInsufficient to drive coil directly
Because a single GPIO can only source about 40 mA but the relay coil needs on the order of 75–90 mA, you cannot switch these relays directly from [ESP1]’s pins. You’ll need a driver stage (e.g., an N-MOSFET or BJT plus a flyback diode) between the ESP32 and the relay coil.
291 days
I need a logic-level N-channel MOSFET to drive the relay. @library find one in SOT-23 footprint for ≥100 mA coil current.
291 days

2:03

Searching for a component.

Searching library for: "N-channel logic-level MOSFET SOT-23 100mA"

Creating search plan for: "N-channel logic-level MOSFET SOT-23 100mA"

Searching.

Searching.

Searching.

Searching.

Found 65 results.

Searching: "N-channel logic-level MOSFET SOT-23 100mA"

Finished searching for a component.

Here are three SOT-23 logic-level N-channel MOSFETs that can comfortably switch a ≥100 mA relay coil:

Table


PartVDSID (Cont.)RDS(on) @ VGSVGS(th)PdDatasheet
BSS123100 V200 mA7 Ω @ VGS=3 V1–3 V350 mWPDF
2N700260 V200 mA5 Ω @ VGS=4.5 V0.8–3 V200 mWPDF
BSS138LT3G50 V200 mA3.5 Ω @ VGS=2.5 V0.5–1.5 V225 mWPDF
Recommendation:
  • BSS138LT3G offers the lowest RDS(on) at 2.5 V, making it the best choice for 3.3 V GPIO drive.
Which one would you like to add to your design?
Select BSS138LT3G
Select 2N7002
Add BSS123
Check gate charge
291 days

To get started, talk to Flux or create a New Document.

Documents

    Documents are markdown text files which describe project goals, capture details, or even simulation outputs.

    Assets

    ESP32 power meter 4 ways image.png

    ESP32 power meter 4 ways image.png

    ESP32 power meter 4 ways imageThumbnail

    ESP32 power meter 4 ways

    ESP32 power meter 4 ways thumbnail
    Compact 4-channel power meter using ESP32-C3, ACS712 sensors, ADS1015 ADC, relay control and I²C connectivity for efficient energy monitoring. #PowerMeter #ESP32 #IoT #EnergyMonitoring

    Pricing & Availability

    Distributor

    Qty 1

    Arrow

    $8.02–$15.33

    Digi-Key

    $17.28–$28.45

    LCSC

    $15.63–$15.74

    Mouser

    $20.71

    Verical

    $13.37–$19.30

    Controls