This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 1 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Safe Power Down
#11
(2020-11-18, 03:56 AM)Techstyle Wrote: Just a couple of updates:

1.  The 'NC' port on the Relay, should actually be the 'NO' port
2.  The LED/resistor between pin 40 and the 3.3v board ground doesn't trip everytime, as the voltage only drops to 1.25v.  therefore,  I have paralleled (or you can replace) this with a 1k resistor, shutsdown in <5 seconds then

Thanks for the updates. I already wondered about the NC/NO.
I won't be using a LED at all, but for a pull-down a 10K would suffice I think. Also the value of the resistor should not influence the time needed for the shutdown. But that is probably what you meant.
Just noticed that the relay-module needs a minimum of 5V  Dodgy
Have you experienced any problem feeding it with just 3.3V?

Edit:
The 5V relay-module pulls 100mA.
The 3.3V version pulls 160 mA.
Should be fine as the 3.3V regulator can go up to 1.5A but the 5V supply must be able to deliver this extra load.
Reply
#12
(2020-11-18, 03:11 PM)Blue Ocean Wrote: I won't be using a LED at all, but for a pull-down a 10K would suffice I think. Also the value of the resistor should not influence the time needed for the shutdown. But that is probably what you meant.
Yes, I added the LED for Diagnostic and it has a 30K resistor - it will be deleted on the boat version.  the LED/30K resistor was large enough to get the system to shut down, but what was inconsistent was the relay trigger signal going low enough to switch the relay off - I mistakenly changed the shutdown trigger to a 1K, when really I need to do something to the relay trigger line.

The relay trigger line is configured in /boot/config.txt as:
Code:
dtoverlay=gpio-poweroff,gpiopin=20,active_low=1

but, I guess, I am unclear as to what this means, I think it means that the GPIO pin is disconnected from the 3.3v supply when the Pi powers off.  However, if it is not pulled down (or if pulled down really slowly) then it takes a while for the trigger to decay and the relay to return to de-energized state.

on last years version Boat Pi, I didn't have this circuit but did use the same code above attached to the LED in the momentary power switch.  Seems like that LED was enough to pull this down, so I have added it to this circuit between the Relay trigger and GND.  So far works every time

(2020-11-18, 03:11 PM)Blue Ocean Wrote: Just noticed that the relay-module needs a minimum of 5V  Dodgy 
Have you experienced any problem feeding it with just 3.3V?

I have had no problems powering it or triggering it at 3.3V and many people in the Amazon questions and feedback said the same - one of the reason I chose it.  If you wanted to, you could definitely power it straight from the 5V line, I think the trigger could still be the GPIO pin though.  It may actually be more convenient to power direct from the 5v board, this would reduce the lines going to the Pi and free up a 3.3v pin for other things
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)