Argon
Posts: 109
Joined: Thu Aug 25, 2011 11:04 am

Will this harm the RasPi or SD card ?

Sun Oct 14, 2012 7:04 pm

Hello,

I want to use a Raspi in my bathroom with Squeezeplug installed so I can play local music on my Nas and also music from a Livestream while i'm in the bathroom. So far, that all works.

The Raspi will be powerd on when the light go on in the bathroom but will powerd off when i switch the lights out. So, the RasPi will not do a proper shutdown (eg Halt commando). Will this harm the RasPi and or the SD card?

Squeezeplug just reads music from my nas, so it hasn't installed an important SQL database or other important things.

Any recommendations?

User avatar
malakai
Posts: 1382
Joined: Sat Sep 15, 2012 10:35 am
Contact: Website

Re: Will this harm the RasPi or SD card ?

Sun Oct 14, 2012 7:09 pm

without a proper shutdown sd corruption occurs so you would definitely be rewriting the sd card image. Also with the humidity in the bathroom moisture would become a problem would need to seal up a case so moisture doesn't build up on the components.
http://www.raspians.com - always looking for content feel free to ask to have it posted. Or sign up and message me to become a contributor to the site. Raspians is not affiliated with the Raspberry Pi Foundation. (RPi's + You = Raspians)

Argon
Posts: 109
Joined: Thu Aug 25, 2011 11:04 am

Re: Will this harm the RasPi or SD card ?

Sun Oct 14, 2012 7:17 pm

Hello,

Moisture can be a problem yes, but my RasPi will be in the ceiling and in a case. So, it is possible, but I can give it a try.

SD corruption: I thought the same, but it depends off course when there is corruption. If this will be every weer for example, this is not a good solution. But if this wil last 6 months, then there is no problem for me :-). Off course I know that no one can give me the time when the corruption will appear. I just want to hear a couple off opinions.

User avatar
daveg
Posts: 137
Joined: Thu Dec 01, 2011 9:36 am

Re: Will this harm the RasPi or SD card ?

Sun Oct 14, 2012 7:53 pm

It's so frugal on power why not just leave it powered on?

Either that or ssh in and shutdown from another machine.
Turning it on an off with the light switch isn't really a good idea unless you want to re flash the sd card every other day!

Argon
Posts: 109
Joined: Thu Aug 25, 2011 11:04 am

Re: Will this harm the RasPi or SD card ?

Sun Oct 14, 2012 8:04 pm

Hello Daveg,

It's a long story to explain why I can't power the Raspi all the time without the light switch (construction problems that are off-topic :-) )

Therefore my question here to see others opinions.

User avatar
Vindicator
Posts: 314
Joined: Sat Sep 17, 2011 11:10 pm
Location: Susanville Ca USA
Contact: Website

Re: Will this harm the RasPi or SD card ?

Sun Oct 14, 2012 8:29 pm

You are going to be using external speakers I would assume so leave the raspi on and just have the speakers turn on and off with the light switch.

No corruption on SD and the end result is the same, the raspi configured that way will only use about 6 watts which includes its power supply and that is about the same power usage as a incandescent night light uses.
If you are more worried about ,spelling, punctuation or grammar you have probably already missed the point so please just move on.

Argon
Posts: 109
Joined: Thu Aug 25, 2011 11:04 am

Re: Will this harm the RasPi or SD card ?

Sun Oct 14, 2012 8:36 pm

Hello,

There is a construction problem here at home to leave the Raspi continue powerd. I don't have any outlet there. The only thing i can do is take power from the 220v (Europe) lights and connect this to the Raspi. I already have 2 other Raspi's (1 webserver / 1 Squeezeplug ) that is powerd on 24/24 7/7.

User avatar
Vindicator
Posts: 314
Joined: Sat Sep 17, 2011 11:10 pm
Location: Susanville Ca USA
Contact: Website

Re: Will this harm the RasPi or SD card ?

Sun Oct 14, 2012 9:23 pm

The only other ways I could see for now would be a battery setup that keeps the pi powered when the lights are off.

Or use the GPIO to attach a button that you can hit to shutdown the raspi through interrupt with a script to perform a proper shutdown when the button is pressed, but you would have to wait X amount of seconds after pushing button and before turning off your light switch.

Or a combination of both so you could hit the button and then hit the switch and the battery would keep it powered while it shuts down or even a relay from the light switch goes to the GPIO and when the light switch is turned off the GPIO then starts the script for shutdown and a battery powers it till it is shutdown properly.
If you are more worried about ,spelling, punctuation or grammar you have probably already missed the point so please just move on.

User avatar
Burngate
Posts: 6184
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: Will this harm the RasPi or SD card ?

Mon Oct 15, 2012 8:55 am

Your problem appears to be (a) log files etc being written to the card at the point you switch it off and (b) the card may be in the middle of housekeeping when you switch it off.

If you could arrange for a ram file system, then you could have the card as read-only, and both problems would go away!

shawaj
Posts: 113
Joined: Wed Oct 03, 2012 3:36 am

Re: Will this harm the RasPi or SD card ?

Wed Jan 09, 2013 11:23 am

You could have a button located nearby that connects to gpio and shutsdown the pi safely before cutting the power.

As stated before with a relay and a battery backup power supply this would even be possible without a separate switch.

Or alternatively as stated above a read only SD card.
Support The MagPi by purchasing printed copies from one of our retailers - http://themagpi.com/en/buy

Please share with anyone who is interested!

User avatar
RaTTuS
Posts: 10531
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: Will this harm the RasPi or SD card ?

Wed Jan 09, 2013 11:43 am

mixing power and water [i.e. bathrooms] is always a bit dubious [read a lot dubious]
you may have an isolated shaver plug you can use [read better]
you also may have a fan system for expelling wet air that runs for a time after the light has been switched off ?
or power the RPi from elsewhere and only have the speakers in the bathroom.

if you want to do it the naughty way then have a battery / very large capacitor and when the light is switched off then get it to shutdown correctly

personally I would go the speaker only route
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

User avatar
rurwin
Forum Moderator
Forum Moderator
Posts: 4258
Joined: Mon Jan 09, 2012 3:16 pm
Contact: Website

Re: Will this harm the RasPi or SD card ?

Wed Jan 09, 2013 11:53 am

I would use a small NiCd or Lead-Acid rechargeable battery, trickle-charging when the power is on. If NiCd, the capacity must be 500mA * 10 = 5000mAh or larger.

Charge the battery with a constant voltage (for Lead-Acid) or current of capacity/10 mA (for NiCd) while the power is on (of course). Supply at least 500mA, so the Pi will be able to run and not discharge the battery faster than it is being charged.
(NiCd batteries can be charged constantly using a current of no more than capacity/10. Any more than that and you risk damaging the battery.)

Then power the Pi from the battery through a (variable input range) DC-DC converter and then two relays in parallel.
One relay is switched by the mains power.
One relay is switched by a GPIO output.

When the Pi boots it switches on that GPIO. Now even if the mains power is switched off, the Pi is still connected to the battery.

The mains relay also switches on a GPIO input.
A process in the Pi runs every second to detect the mains power going away.
When the mains power is switched off, the process halts the Pi.
As the final action of the halt, the GPIO output is cleared, and the second relay opens, switching the Pi off.


This reminds me of an old friend who in each toilet in the house, had a big old radio, a car battery, and a microswitch attached to the toilet lid. While the lid was lifted, Radio 2 played.

User avatar
cosmo
Posts: 51
Joined: Mon Nov 19, 2012 8:36 pm

Re: Will this harm the RasPi or SD card ?

Wed Jan 09, 2013 9:52 pm

rurwin wrote:... This reminds me of an old friend who in each toilet in the house, had a big old radio, a car battery, and a microswitch attached to the toilet lid. While the lid was lifted, Radio 2 played.
So, did his wife direct him to set that up to make sure he put the lid down? ;)

milhouse
Posts: 642
Joined: Mon Jan 16, 2012 12:59 pm

Re: Will this harm the RasPi or SD card ?

Wed Jan 09, 2013 11:16 pm

Argon wrote: I want to use a Raspi in my bathroom with Squeezeplug installed so I can play local music on my Nas and also music from a Livestream while i'm in the bathroom. So far, that all works.
You could boot the Pi over NFS from your NAS, this way you would minimise (if not eliminate) the possibility of corrupting the SD card, which would only serve to boot the kernel, effectively treating the SD card as read-only storage.

Argon
Posts: 109
Joined: Thu Aug 25, 2011 11:04 am

Re: Will this harm the RasPi or SD card ?

Thu Jan 10, 2013 10:38 am

Hello,

Already solved it on an other way. Made a little hole in the wall and installed the Raspi in the room next-door. There is an outlet, so i have 24/24 7/7 power. But thanks for the suggestions !

rujoking
Posts: 2
Joined: Sat Jan 05, 2013 9:06 am

Re: Will this harm the RasPi or SD card ?

Thu Jan 10, 2013 4:38 pm

cosmo wrote:
rurwin wrote:... This reminds me of an old friend who in each toilet in the house, had a big old radio, a car battery, and a microswitch attached to the toilet lid. While the lid was lifted, Radio 2 played.
So, did his wife direct him to set that up to make sure he put the lid down? ;)
In all seriousness, who wouldn't want their bum to listen to Terry Wogan?

Return to “Beginners”