Is there a way to unplug the Raspberry pi safely without shutting downShutting down the Pi safely without SSH or a monitor?Shut down standalone pi without accessCleanly shutting down daemon on Reboot or Shutdown commandShutting down quickly (And safely)Detect when the rpi3b+ has shut down

Three legged NOT gate? What is this symbol?

What is the difference between 型 and 形?

Is there a way to unplug the Raspberry pi safely without shutting down

The equation of motion for a scalar field in curved spacetime in terms of the covariant derivative

How can I shift my job responsibilities back to programming?

English - Acceptable use of parentheses in an author's name

CTCI Chapter 1 : Palindrome Permutation

Loading military units into ships optimally, using backtracking

Are differences between uniformly distributed numbers uniformly distributed?

Withdrew when Jimmy met up with Heath

Ex-contractor published company source code and secrets online

multiplying two array in python3.7

Can the Action some concentration spells grant be used in Attacks of Opportunity with the War Caster feat?

Trying to write a shell script that keeps testing a server remotely, but it keeps falling in else statement when I logout

In a 2 layer PCB with a top layer densely populated, from an EMI & EMC point of view should the ground plane be on top, bottom or both and why?

Is TA-ing worth the opportunity cost?

Y2K... in 2019?

In SQL Server, why does backward scan of clustered index cannot use parallelism?

changing number of arguments to a function in secondary evaluation

Does a code snippet compile? Or does it get compiled?

What does this double-treble double-bass staff mean?

What is the length of pair of wires after twisting them around each other?

What are the uses and limitations of Persuasion, Insight, and Deception against other PCs?

What should I call bands of armed men in Medieval Times?



Is there a way to unplug the Raspberry pi safely without shutting down


Shutting down the Pi safely without SSH or a monitor?Shut down standalone pi without accessCleanly shutting down daemon on Reboot or Shutdown commandShutting down quickly (And safely)Detect when the rpi3b+ has shut down






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I'm building a kiosk app for a raspberry pi, and the final intention is that it will sit in a pelicase with all the external hardware, with one power cord in. My program has a quit button which safely shuts down the pi by running sudo halt, but it would make it easier if the pi could automatically shutdown when it detects that it has been unplugged. Could this be done if I had a capacitor on the power rails and when the power was disconnected the pi could measure the power drop and shutdown safely if it detected a loss of power? Thanks.










share|improve this question







New contributor



Nadim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



























    1















    I'm building a kiosk app for a raspberry pi, and the final intention is that it will sit in a pelicase with all the external hardware, with one power cord in. My program has a quit button which safely shuts down the pi by running sudo halt, but it would make it easier if the pi could automatically shutdown when it detects that it has been unplugged. Could this be done if I had a capacitor on the power rails and when the power was disconnected the pi could measure the power drop and shutdown safely if it detected a loss of power? Thanks.










    share|improve this question







    New contributor



    Nadim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      1












      1








      1








      I'm building a kiosk app for a raspberry pi, and the final intention is that it will sit in a pelicase with all the external hardware, with one power cord in. My program has a quit button which safely shuts down the pi by running sudo halt, but it would make it easier if the pi could automatically shutdown when it detects that it has been unplugged. Could this be done if I had a capacitor on the power rails and when the power was disconnected the pi could measure the power drop and shutdown safely if it detected a loss of power? Thanks.










      share|improve this question







      New contributor



      Nadim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      I'm building a kiosk app for a raspberry pi, and the final intention is that it will sit in a pelicase with all the external hardware, with one power cord in. My program has a quit button which safely shuts down the pi by running sudo halt, but it would make it easier if the pi could automatically shutdown when it detects that it has been unplugged. Could this be done if I had a capacitor on the power rails and when the power was disconnected the pi could measure the power drop and shutdown safely if it detected a loss of power? Thanks.







      shutdown






      share|improve this question







      New contributor



      Nadim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      share|improve this question







      New contributor



      Nadim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      share|improve this question




      share|improve this question






      New contributor



      Nadim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      asked 9 hours ago









      NadimNadim

      61 bronze badge




      61 bronze badge




      New contributor



      Nadim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




      New contributor




      Nadim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.

























          3 Answers
          3






          active

          oldest

          votes


















          1














          What you're asking for is impossible. There's no battery backup on the RPi without additional hardware.



          Pulling the power may be OK 9 times out of ten, but every time you pull the power you risk corruption of your SDCard.



          Even if you move to a HDD or SSD for the root filesystem you risk corruption with a sudden power loss.



          How hard is it to use sudo poweroff then wait ten seconds for that to complete? You know it's complete when the activity LED blinks ten times.






          share|improve this answer
































            1














            To achieve this thing you need two things.



            1. First, the power failure detection circuit.

            2. A power backup system that can give power back up to shut down the raspberry pi.

            There are many ways to implement the power detection circuit. I am giving an example of this





            schematic





            simulate this circuit – Schematic created using CircuitLab
            in this circuit, the R1 and R2 you have to chose such that rpi gpio will get 3.3V, 3mA current. When power presents the gpio get a high signal failure will occur the get low signal.



            For power back up you need a supercapacitor circuitry that can store 5V*2.5mA * 60sec energy minimum such that it can provide power to RPI when it performs shut down the operation.






            share|improve this answer
































              1














              No computer system which writes to internal storage can just be powered off without risk of loss. The Pi is no different in this respect.



              Conventional computers have a managed shutdown and/or battery backup.



              It is not difficult to provide the same to a Pi (the additional circuitry is likely to cost more than the Pi) and there are many articles on this, and a number of commercial products.



              NOTE a capacitor is unlikely to provide sufficient voltage for long enough.



              The other option is to use a read only filesystem, and store working data in volatile storage (RAM) - it depends on your application if this is applicable.






              share|improve this answer

























              • Re: your note about storing data in RAM; I have use AUFS (RAM fs + read only ext4 mount) to successfully implement a Linux driven embedded project that can handle hard power events. Something similar to what is mentioned here: linuxquestions.org/questions/linux-general-1/…

                – sbell
                1 hour ago













              Your Answer






              StackExchange.ifUsing("editor", function ()
              return StackExchange.using("schematics", function ()
              StackExchange.schematics.init();
              );
              , "cicuitlab");

              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "447"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: false,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              imageUploader:
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              ,
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );






              Nadim is a new contributor. Be nice, and check out our Code of Conduct.









              draft saved

              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fraspberrypi.stackexchange.com%2fquestions%2f101509%2fis-there-a-way-to-unplug-the-raspberry-pi-safely-without-shutting-down%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              3 Answers
              3






              active

              oldest

              votes








              3 Answers
              3






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              1














              What you're asking for is impossible. There's no battery backup on the RPi without additional hardware.



              Pulling the power may be OK 9 times out of ten, but every time you pull the power you risk corruption of your SDCard.



              Even if you move to a HDD or SSD for the root filesystem you risk corruption with a sudden power loss.



              How hard is it to use sudo poweroff then wait ten seconds for that to complete? You know it's complete when the activity LED blinks ten times.






              share|improve this answer





























                1














                What you're asking for is impossible. There's no battery backup on the RPi without additional hardware.



                Pulling the power may be OK 9 times out of ten, but every time you pull the power you risk corruption of your SDCard.



                Even if you move to a HDD or SSD for the root filesystem you risk corruption with a sudden power loss.



                How hard is it to use sudo poweroff then wait ten seconds for that to complete? You know it's complete when the activity LED blinks ten times.






                share|improve this answer



























                  1












                  1








                  1







                  What you're asking for is impossible. There's no battery backup on the RPi without additional hardware.



                  Pulling the power may be OK 9 times out of ten, but every time you pull the power you risk corruption of your SDCard.



                  Even if you move to a HDD or SSD for the root filesystem you risk corruption with a sudden power loss.



                  How hard is it to use sudo poweroff then wait ten seconds for that to complete? You know it's complete when the activity LED blinks ten times.






                  share|improve this answer













                  What you're asking for is impossible. There's no battery backup on the RPi without additional hardware.



                  Pulling the power may be OK 9 times out of ten, but every time you pull the power you risk corruption of your SDCard.



                  Even if you move to a HDD or SSD for the root filesystem you risk corruption with a sudden power loss.



                  How hard is it to use sudo poweroff then wait ten seconds for that to complete? You know it's complete when the activity LED blinks ten times.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 8 hours ago









                  DougieDougie

                  1,5821 gold badge2 silver badges10 bronze badges




                  1,5821 gold badge2 silver badges10 bronze badges


























                      1














                      To achieve this thing you need two things.



                      1. First, the power failure detection circuit.

                      2. A power backup system that can give power back up to shut down the raspberry pi.

                      There are many ways to implement the power detection circuit. I am giving an example of this





                      schematic





                      simulate this circuit – Schematic created using CircuitLab
                      in this circuit, the R1 and R2 you have to chose such that rpi gpio will get 3.3V, 3mA current. When power presents the gpio get a high signal failure will occur the get low signal.



                      For power back up you need a supercapacitor circuitry that can store 5V*2.5mA * 60sec energy minimum such that it can provide power to RPI when it performs shut down the operation.






                      share|improve this answer





























                        1














                        To achieve this thing you need two things.



                        1. First, the power failure detection circuit.

                        2. A power backup system that can give power back up to shut down the raspberry pi.

                        There are many ways to implement the power detection circuit. I am giving an example of this





                        schematic





                        simulate this circuit – Schematic created using CircuitLab
                        in this circuit, the R1 and R2 you have to chose such that rpi gpio will get 3.3V, 3mA current. When power presents the gpio get a high signal failure will occur the get low signal.



                        For power back up you need a supercapacitor circuitry that can store 5V*2.5mA * 60sec energy minimum such that it can provide power to RPI when it performs shut down the operation.






                        share|improve this answer



























                          1












                          1








                          1







                          To achieve this thing you need two things.



                          1. First, the power failure detection circuit.

                          2. A power backup system that can give power back up to shut down the raspberry pi.

                          There are many ways to implement the power detection circuit. I am giving an example of this





                          schematic





                          simulate this circuit – Schematic created using CircuitLab
                          in this circuit, the R1 and R2 you have to chose such that rpi gpio will get 3.3V, 3mA current. When power presents the gpio get a high signal failure will occur the get low signal.



                          For power back up you need a supercapacitor circuitry that can store 5V*2.5mA * 60sec energy minimum such that it can provide power to RPI when it performs shut down the operation.






                          share|improve this answer













                          To achieve this thing you need two things.



                          1. First, the power failure detection circuit.

                          2. A power backup system that can give power back up to shut down the raspberry pi.

                          There are many ways to implement the power detection circuit. I am giving an example of this





                          schematic





                          simulate this circuit – Schematic created using CircuitLab
                          in this circuit, the R1 and R2 you have to chose such that rpi gpio will get 3.3V, 3mA current. When power presents the gpio get a high signal failure will occur the get low signal.



                          For power back up you need a supercapacitor circuitry that can store 5V*2.5mA * 60sec energy minimum such that it can provide power to RPI when it performs shut down the operation.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered 8 hours ago









                          PrayuktibidPrayuktibid

                          144 bronze badges




                          144 bronze badges
























                              1














                              No computer system which writes to internal storage can just be powered off without risk of loss. The Pi is no different in this respect.



                              Conventional computers have a managed shutdown and/or battery backup.



                              It is not difficult to provide the same to a Pi (the additional circuitry is likely to cost more than the Pi) and there are many articles on this, and a number of commercial products.



                              NOTE a capacitor is unlikely to provide sufficient voltage for long enough.



                              The other option is to use a read only filesystem, and store working data in volatile storage (RAM) - it depends on your application if this is applicable.






                              share|improve this answer

























                              • Re: your note about storing data in RAM; I have use AUFS (RAM fs + read only ext4 mount) to successfully implement a Linux driven embedded project that can handle hard power events. Something similar to what is mentioned here: linuxquestions.org/questions/linux-general-1/…

                                – sbell
                                1 hour ago















                              1














                              No computer system which writes to internal storage can just be powered off without risk of loss. The Pi is no different in this respect.



                              Conventional computers have a managed shutdown and/or battery backup.



                              It is not difficult to provide the same to a Pi (the additional circuitry is likely to cost more than the Pi) and there are many articles on this, and a number of commercial products.



                              NOTE a capacitor is unlikely to provide sufficient voltage for long enough.



                              The other option is to use a read only filesystem, and store working data in volatile storage (RAM) - it depends on your application if this is applicable.






                              share|improve this answer

























                              • Re: your note about storing data in RAM; I have use AUFS (RAM fs + read only ext4 mount) to successfully implement a Linux driven embedded project that can handle hard power events. Something similar to what is mentioned here: linuxquestions.org/questions/linux-general-1/…

                                – sbell
                                1 hour ago













                              1












                              1








                              1







                              No computer system which writes to internal storage can just be powered off without risk of loss. The Pi is no different in this respect.



                              Conventional computers have a managed shutdown and/or battery backup.



                              It is not difficult to provide the same to a Pi (the additional circuitry is likely to cost more than the Pi) and there are many articles on this, and a number of commercial products.



                              NOTE a capacitor is unlikely to provide sufficient voltage for long enough.



                              The other option is to use a read only filesystem, and store working data in volatile storage (RAM) - it depends on your application if this is applicable.






                              share|improve this answer













                              No computer system which writes to internal storage can just be powered off without risk of loss. The Pi is no different in this respect.



                              Conventional computers have a managed shutdown and/or battery backup.



                              It is not difficult to provide the same to a Pi (the additional circuitry is likely to cost more than the Pi) and there are many articles on this, and a number of commercial products.



                              NOTE a capacitor is unlikely to provide sufficient voltage for long enough.



                              The other option is to use a read only filesystem, and store working data in volatile storage (RAM) - it depends on your application if this is applicable.







                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered 2 hours ago









                              MilliwaysMilliways

                              33.3k14 gold badges59 silver badges126 bronze badges




                              33.3k14 gold badges59 silver badges126 bronze badges















                              • Re: your note about storing data in RAM; I have use AUFS (RAM fs + read only ext4 mount) to successfully implement a Linux driven embedded project that can handle hard power events. Something similar to what is mentioned here: linuxquestions.org/questions/linux-general-1/…

                                – sbell
                                1 hour ago

















                              • Re: your note about storing data in RAM; I have use AUFS (RAM fs + read only ext4 mount) to successfully implement a Linux driven embedded project that can handle hard power events. Something similar to what is mentioned here: linuxquestions.org/questions/linux-general-1/…

                                – sbell
                                1 hour ago
















                              Re: your note about storing data in RAM; I have use AUFS (RAM fs + read only ext4 mount) to successfully implement a Linux driven embedded project that can handle hard power events. Something similar to what is mentioned here: linuxquestions.org/questions/linux-general-1/…

                              – sbell
                              1 hour ago





                              Re: your note about storing data in RAM; I have use AUFS (RAM fs + read only ext4 mount) to successfully implement a Linux driven embedded project that can handle hard power events. Something similar to what is mentioned here: linuxquestions.org/questions/linux-general-1/…

                              – sbell
                              1 hour ago










                              Nadim is a new contributor. Be nice, and check out our Code of Conduct.









                              draft saved

                              draft discarded


















                              Nadim is a new contributor. Be nice, and check out our Code of Conduct.












                              Nadim is a new contributor. Be nice, and check out our Code of Conduct.











                              Nadim is a new contributor. Be nice, and check out our Code of Conduct.














                              Thanks for contributing an answer to Raspberry Pi Stack Exchange!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid


                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.

                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fraspberrypi.stackexchange.com%2fquestions%2f101509%2fis-there-a-way-to-unplug-the-raspberry-pi-safely-without-shutting-down%23new-answer', 'question_page');

                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              ParseJSON using SSJSUsing AMPscript with SSJS ActivitiesHow to resubscribe a user in Marketing cloud using SSJS?Pulling Subscriber Status from Lists using SSJSRetrieving Emails using SSJSProblem in updating DE using SSJSUsing SSJS to send single email in Marketing CloudError adding EmailSendDefinition using SSJS

                              Кампала Садржај Географија Географија Историја Становништво Привреда Партнерски градови Референце Спољашње везе Мени за навигацију0°11′ СГШ; 32°20′ ИГД / 0.18° СГШ; 32.34° ИГД / 0.18; 32.340°11′ СГШ; 32°20′ ИГД / 0.18° СГШ; 32.34° ИГД / 0.18; 32.34МедијиПодациЗванични веб-сајту

                              19. јануар Садржај Догађаји Рођења Смрти Празници и дани сећања Види још Референце Мени за навигацијуу