element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • 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 Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • 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
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • 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
Arduino
  • Products
  • More
Arduino
Arduino Forum Arduino resets when solenoid shuts off
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 54 replies
  • Answers 16 answers
  • Subscribers 396 subscribers
  • Views 8653 views
  • Users 0 members are here
  • emi_protection
  • arduino
Related

Arduino resets when solenoid shuts off

Former Member
Former Member over 11 years ago

I have an arduino hooked to a 2 relay board. Each relay is opto-isolated. The arduino and board each have their own 5V power feed. The relays are switching 12V to controll a motor and a solenoid valve.

Sometimes when the solenoid turns off, the arduino resets. From what I've read, it's likely an EMI problem caused by the solenoid. If I disconnect the solenoid, I don't see the problem.

I've seen various suggestions about using a varistor or a diode, but I don't know which is better or what values to try. Any recommendations?

I'm assuming that the varistor or diode should be as close to the solenoid as possible, shorting the power and ground lines, is this correct?

 

Thanks,

Chris

  • Sign in to reply
  • Cancel

Top Replies

  • c4m4ch0
    c4m4ch0 over 8 years ago in reply to maranatha +3 suggested
    Hello maranatha, you just need to connect the diode as it is in this image
  • Former Member
    Former Member over 11 years ago in reply to michaelkellett +2 suggested
    I put an IN4004 Rectifier Diode across the terminals of the solenoid and that seems to have solved the problem. I also found this page pretty educational: http://en.wikipedia.org/wiki/Flyback_diode
  • maranatha
    maranatha over 8 years ago in reply to Former Member +1
    Hi Chris Do you happen to have the connection diagram? I am facing similar problem and it would be really helpful if you could share a connection diagram (basically how you connect the rectifier diode…
  • maranatha
    0 maranatha over 8 years ago in reply to COMPACT

    The relay shield seems to have decoupling capacitors and the diode for combating the EMF effects.

    I was just wondering if the values of this components should be changed.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • COMPACT
    0 COMPACT over 8 years ago in reply to COMPACT

    Your picture and blurb explains a lot.

    The wiring and components seem right.

     

    What happens if you replace the PIR with a switch to emulate the PIR turning on and off?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • COMPACT
    0 COMPACT over 8 years ago in reply to COMPACT

    I'd replace the Rpi with just a resistor and a LED (or light bulb) until the problem is sorted.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • maranatha
    0 maranatha over 8 years ago in reply to COMPACT

    Hi

     

    I just replaced the PIR sensor with a push button. But it didn't solve the problem. It works when the HDMI display is connected but the relay unlatches when the HDMI display is unplagged from the RPi. Replacing the RPi with a LED will not help me in debugging, since the problem is in my opinion with the HDMI port.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • COMPACT
    0 COMPACT over 8 years ago in reply to maranatha

    What happens with to Arduino behaviour if you power up the RPi directly from the battery pack without using the relay operating with and without the HDMI connection?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • maranatha
    0 maranatha over 8 years ago in reply to COMPACT

    Hi

    That is good point. I just tried that now few times. The arduino behavior is quite normal. It doesn't reset.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • COMPACT
    0 COMPACT over 8 years ago in reply to maranatha

    What happens when you have the Rpi:

     

    a. in close proximity to the Arduino

    b. with just one of the power leads connected to the relay (try each one separately)

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • maranatha
    0 maranatha over 8 years ago in reply to COMPACT

    Hi COMPACT

     

    I am not sure if I understood clearly point b). Does it mean the other lead is just on the air?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • maranatha
    0 maranatha over 8 years ago in reply to maranatha

    Just quickly tested the following (in all conditions raspberry pi doesn't have HDMI display)

    1. I connected one of the power leads to the relay at a time (of course, the circuit is incomplete and doesn't power the RPi). The Arduino behavior doesn't change. When I push the button (the PIR sensor replacement), the relay latches and stay in that position until I manual reset the arduino.
    2. In the same setup, after pushing the button and the relay latches, I waited few seconds and connect the other power lead to the relay to power up the RPi. And it does it without interrupting.
    3. This one is still a mystery. After all these trials,(without having to do anything else), the original problem seems to be solved. I tried to power the raspberry pi few time using the button on the arduino and it did work. The relay didn't unlatch in the boot up process. I am not sure how long this will sustain. Will it work on a different environment, different desk, different devices around?
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • COMPACT
    0 COMPACT over 8 years ago in reply to maranatha

    No - The battery still powers the RPi and but add an extra wire so that one of the battery terminals is connected a relay switch contact.

    • 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 © 2025 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