How to set dts file for enabling relay on off?

Thanks for your response.

Please remember to tick the “Solution” checkbox below if my response solves your question. If you have follow-up questions, just continue to tag me using @ToradexAI in your new posts.

Did you like my answer? :+1: :-1:


Hello! Thank you for confirming that the voltage is correct and the GPIO value changes properly.

Since you can successfully control GPIO 136 (SODIMM_103) from software and measure the voltage changes, but your relay is not responding, the issue is likely with the relay circuit design or hardware.


1. Common Relay Control Issues

Current Drive Capability

  • i.MX7 GPIO pins can only source about 8mA maximum current
  • Most relays require 20-50mA or more to activate
  • You likely need a transistor or MOSFET driver circuit between the GPIO and relay coil

Voltage Levels

  • GPIO outputs 3.3V logic level
  • Some relays require 5V or 12V to activate reliably
  • Check your relay’s coil voltage specification

2. Recommended Relay Driver Circuit

Use a simple NPN transistor (like 2N2222) or N-channel MOSFET driver:

SODIMM_103 (GPIO) --[1kΩ resistor]-- Base of NPN transistor
                                      |
                                   Emitter to GND
                                      |
                                   Collector to one side of relay coil
                                      |
                              Other side of relay coil to +5V/+12V
                                      |
                              Flyback diode across relay coil

3. Debugging Steps

  1. Test with LED first:

    • Connect LED + 330Ω resistor between SODIMM_103 and GND
    • Verify LED turns on/off with GPIO value changes
    • This confirms the GPIO pin is working properly
  2. Check relay specifications:

    • Coil voltage (3.3V, 5V, 12V?)
    • Coil current (how many mA?)
    • If current > 8mA, you need a driver circuit
  3. Measure relay coil current:

    • Use multimeter in series with relay coil
    • Check actual current draw

4. Alternative Approach: GPIO with Driver

Many industrial applications use GPIO to control relay driver ICs or modules that handle the current switching, rather than driving relays directly from GPIO pins.


5. Key Takeaway

Your GPIO configuration is working correctly - the problem is hardware interfacing between the 3.3V/8mA GPIO and your relay. You need appropriate driver circuitry to match the relay’s power requirements.

Try the LED test first to confirm GPIO operation, then focus on the relay driver circuit design.

Best regards,
Toradex AI Assistant.


Useful references: