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
Experts, Learning and Guidance
  • Technologies
  • More
Experts, Learning and Guidance
Ask an Expert Forum Turn on a relay when a signal is low and turn it off with a delay when another signal goes low
  • Blog
  • Forum
  • Documents
  • Leaderboard
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Experts, Learning and Guidance to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 4 replies
  • Subscribers 286 subscribers
  • Views 544 views
  • Users 0 members are here
Related
See a helpful answer?

Be sure to click 'more' and select 'suggest as answer'!

If you're the thread creator, be sure to click 'more' then 'Verify as Answer'!

Turn on a relay when a signal is low and turn it off with a delay when another signal goes low

obones
obones 8 months ago

Hello,

Following my Maintain power thread, the SBC now has enough time to shutdown properly when the main power source goes away.

However, I have an issue when the power comes back on in that the SBC must have been physically disconnected from its power source for it to boot up again.

Now, I know this comes from the fact that I use super capacitors that take a long time to fully discharge, but even after days being unpowered I still need to "unplug/plug" the SBC for it to come back on.

So I thought that's a perfect application for a relay as it does have a physical connection, but I'm struggling with the design of the driving circuit for it apart from the obvious flywheel diode.

Using PlantUML, I represented the following timing of events that I'm trying to achieve:

image

It's also visible online here.

24V is the main power source
5V is the stepped down voltage, backed up by the supercapacitor
PowerLoss is the signal from the previous discussion
PiRunning is a GPIO pin from the SBC that gets set/reset via code running in the SBC operating system
PiPower is the desired On/Off state of the relay

Basically, I want the relay (PiPower) to be in the On state when PowerLoss is 0 and to go to the Off state after a delay when PiRunning has changed to a low state.

I need a delay before the relay is switched off because there is a time gap between the operating system running its last script and the actual power off on the SBC. I believe this can be achieved quite easily, force instance with a NE555 as the needed delay is below 5 seconds.

But what I'm struggling with is the "conversion" of a state signal and a down front signal to a on/off state to drive the relay. As I envision driving it with an N mosfet, I believe the signal to generate would need to be inverted, but that's not much an issue.

Short of asking for a ready made solution, what resources would you suggest that I look at to be able to come up with a working solution?

Many thanks for your help.

  • Sign in to reply
  • Cancel

Top Replies

  • colporteur
    colporteur 8 months ago in reply to obones +3
    Sounding boards like the E14 Community are GREAT for discovering before you start investing capital in a project. I have a lot of original ideas in my head. When I have make them public I discover they…
  • shabaz
    0 shabaz 8 months ago

    Sounds complicated unfortunately, because your requirements might change during testing. It might be good to just throw an Arduino at it, and have, as inputs, the switched voltage, a signal from the Orange Pi showing it is running, and as outputs a signal to instruct the Orange Pi to shut down, and to a relay if you find you need it. 

    It might also be worth investigating if you can customize the OS to use RAM for all temporary files (usually /var/tmp should be RAM anyway; at least with some UNIXes, I don't know about Linix, but worth checking).

    If under control of a microcontroller (such as Arduino or whatever you prefer) then you've got a lot of options if circumstances change.

    Regarding resources, I don't have a directly relevant link, but  maybe take a look here for some ideas:

     Energy Saving: Building a Microcontroller-based System Power Controller 

    That example actually uses a permanently-powered microcontroller (using a coin cell, but it could be a larger battery).

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • obones
    0 obones 8 months ago in reply to shabaz

    I see your point indeed.
    A bit sad to throw code at this, but that's more flexible indeed.

    I have a few PIC microcontrollers lying around, let's hope my PicKit2 is still supported in the latest MPLab. Might be a waste of pins though, the smallest ones I have here seem to be PIC16F628A or PIC16F84

    Or maybe something else programmed using my USB-Serial FTDI232 adapter

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

    Sounding boards like the E14 Community are GREAT for discovering before you start investing capital in a project.

    I have a lot of original ideas in my head. When I have make them public I discover they are not original and many are not practical. The lab in my head is such a wonderful place. In there I never blow a fuse or need batteries.

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • obones
    0 obones 8 months ago in reply to colporteur

    Yeah, we have a saying here that we all "would like to live in theory, as in theory everything works."

    • 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