element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum Raspberry Pi 4 GPIO Leakage Voltage (1.2V) When LOW on Relay Module
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 8 replies
  • Subscribers 693 subscribers
  • Views 353 views
  • Users 0 members are here
Related

Raspberry Pi 4 GPIO Leakage Voltage (1.2V) When LOW on Relay Module

emreeyy
emreeyy 8 days ago

Hi everyone,

I am using a Raspberry Pi 4 Model B to control industrial 24V relay modules. However, I am not using an external 24V power supply; instead, I am routing the Pi's own 3.3V pin to the common power rail of the relays to use them as simple mechanical switches for 3.3V signals.

I have wired the Raspberry Pi GPIO pins directly to the relay signal inputs via a simple terminal block breakout board (no transistors or optocouplers are used yet).

The Problem:

 When the GPIO pin is ⁠HIGH⁠, I read exactly 3.3V on the line, which is correct.

 When the GPIO pin is set to ⁠LOW⁠, instead of 0V, I see a constant 1.2V leakage/floating voltage on the multimeter.

There is currently no common ground (GND) connection between the Raspberry Pi and the panel's internal structure. I suspect this 1.2V is due to a floating ground issue or feedback leakage through the relay's internal coil/status LED.

What is the best way to eliminate this 1.2V leakage and get a clean 0V when the pin is LOW? Should I use an optocoupler module (like PC817) or a transistor driver?

Thanks in advance!

  • Sign in to reply
  • Cancel
  • shabaz
    0 shabaz 8 days ago

    Hi,

    You may need to sketch a diagram, and attach a photo showing your setup, and links to the relay module and any other bits you're using. Right now it's very unclear what your precise set-up is. 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • robogary
    0 robogary 8 days ago

     reference the rpi common to the panel internal structures common and the rpi power input common. Make everyone's common , in common. 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • colporteur
    0 colporteur 8 days ago

    If the Pi is going to power and external device they both have to have a common ground reference. 3.3V on the Pi is referenced to its own ground. If the Pi's ground is not the same as the equipment ground, you will have issues. Let's just say I have had issues until I create the common ground.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • geralds
    0 geralds 8 days ago

    Hello,

    1. Do NOT connect a 24V relay directly to an output of the Raspberry Pi. This will damage the Pi's port.

    2. You need an external driver transistor to control the 24V relay. Alternatively, you can use an optocoupler such as the PC817.

    The GND - normally - is the base of each switched schematic, special circuits can have other base voltages.

    A relay has three operating states:

    a) Turn-on voltage: This is the minimum voltage at which the relay turns on.

    b) Hold voltage: This voltage is slightly lower than the turn-on voltage and can be even lower before the relay turns off. This voltage can help save power.

    c) Turn-off voltage: This voltage is so low that the relay turns off. A voltage may still be applied, but it will no longer be held.

    You can find the voltage states of your 24V relay in its datasheet.

    3. You can use an NPN transistor, for example. BC547 or BC546 or similar switching transistors (emitter to GND, collector to the relay) – the relay is connected to the supply voltage (+24 V).

    4. Don't forget the diode, e.g., 1N4007, in parallel with the relay coil; cathode to the positive supply voltage, anode to the switching transistor collector.

    Alternatively:

    There is another option where the relay is connected to ground (GND) and can be switched with a PNP transistor.

    However, this circuit is somewhat more complex and requires a few more components.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • dougw
    0 dougw 7 days ago

    You need to supply a schematic of the connections. Typically a Pi output pin cannot drive a relay coil because the voltage is too high, the current is too high and the inductive flyback is too high. It sounds like you are trying to pull down a coil pin of a coil whose other pin is connected to 3.3V. The I/O pin cannot sink enough current to pull that pin to ground. A transistor would help, but the coil may need a higher voltage and it would definitely need a snubber diode.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • robogary
    0 robogary 7 days ago

    Hi emreey.y.

    Please reference my spring clean 2026 project: The WrongCo Garden Guardian (a.k.a. Rube Frankenstein).

    I have schematics showing a raspberry pi pico 3v outputs driving 3v relay modules and 3v mosfet boards. The modules then drive 12v circuits. These output driver boards could just as easy pilot 24v devices. 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • DAB
    0 DAB 7 days ago

    The RPI does some interesting things with the GPIO pins.

    You may have to set up some external termination resistors to get the right behavior.

    As I recall, there are some internal options you can set to the output configuration to use internal termination.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • geralds
    0 geralds 7 days ago
    emreeyy said:

    Wenn der GPIO-Pin HOCH ist, messe ich genau 3,3 V auf der Leitung, was korrekt ist.

    Wenn der GPIO-Pin auf LOW statt 0V eingestellt ist, sehe ich eine konstante 1,2V-Leck-/Schwimmenspannung am Multimeter.

    Look here: https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#gpio-pads-control

    most of the port pin are tri-stated pins.

    Yes, it means that the pin can have 1.2V - the middle of the supply voltage as well as meaning this state is in "high-Z".

    This is NOT a "leakage".  Wink

    Z = Impedance in (k)Ohm.

    This function is a very important function if you want to use that pins with different jobs.

    Such port can be driven in: "switched on" (sending high to the output), "h-Z" (the software let the port "swimming"), "switched-off (sending low to the output)

    Gerald
    ---

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube