iwiber
Posts: 9
Joined: Thu May 02, 2019 1:43 pm

Automate water heater - Temp sensor/110v relay/switch

Thu May 02, 2019 1:49 pm

Hi guys,

I'm quite familiar with computer/linux etc but didn't even know about Raspberry PI until someone tells me I could probably do what I want with it. Here's what I'd like to do, can you please advise on what you'd use?

I basically need to read the temp of a water tank, and create a condition that if water is less than 55°, then turn on the power (110v). If it's more than 59°, turn off the power.

I the temp sensor DS18B20 could do it, and in term of switch/relay I'm having a hard time finding something that could sustain up to 8-10amp.

Any suggestion would be appreciated!

Thanks

User avatar
ptimlin
Posts: 88
Joined: Tue Jan 08, 2019 7:44 pm

Re: Automate water heater - Temp sensor/110v relay/switch

Thu May 02, 2019 6:48 pm

The Pi's GPIO pins are usually not up to the task of driving most mechanical relays and many solid state relays (SSR). Usually you will need some sort of interface between the two.

What is the wattage of the heater you plan to use? I know you said "110V" at somewhere between 8-10 amps, but verifying anyway. I put "110V" in quotes because most people say that for historical reasons (it was what Thomas Edison used originally with his dc system) but modern USA utilities are nominally 120V ~+/-5% (so expect between about 114V to 126V).

Depending on how much you are willing to spend, you could get an SSR for ~$27 usd that could be driven directly off the Pi GPIO and also handle the current you want...
https://www.digikey.com/product-detail/ ... -ND/678179
This one must turn on with 3V on its input, so the GPIO out of 3.3V will work directly. However note the data sheet shows an input current of "3 - 25mA (240 model)" which means if you are going to buy just one, you will want to test it and make sure its input current is less than 16mA, the max of the Pi's GPIO. If on the other hand you were going to be making a lot of these (like for a product) where you were not going to test the input current, then this one is not suitable as many might exceed the 16mA spec. Also note that this type of relay typically requires an additional heatsink for the higher currents.

For just under $34 usd there is this one...
https://www.digikey.com/product-detail/ ... ND/2330435
which is much like the one above but the input current is spec'd to be no more than 14mA so safe to use, although its minimum current is about 10mA, so may not be as low as the one above. The heatsink advise above still applies here.

If you wanted to go much cheaper then for under $5 you could get something like this in a mechanical relay...
https://www.digikey.com/product-detail/ ... -ND/287569
But the problem with mechanical relays is the coil current is almost always going to exceed the current the GPIO can deliver, so you will need to drive the relay with something else. The one I liked it a 12V coil so you would need to drive a relay driver with the Pi's GPIO to turn on the relay's 12V coil voltage which will mean a small IC or converter board. Do you solder? You won't need a heatsink though.

User avatar
DougieLawson
Posts: 36124
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Automate water heater - Temp sensor/110v relay/switch

Thu May 02, 2019 7:01 pm

If you're having to ask how to do this you're probably not qualified to build the electronics needed (even at 120V) to do this switching.

You'd be better off spending twenty-five bucks for https://www.adafruit.com/product/2935 to get a ready built (and therefore safe) unit to do the mains switching.

120V may be safer than Europe's 240V but a fault could still kill, set your house on fire or invalidate your household insurance (or all three).

If you don't like that Adafruit device (or it doesn't have the current rating for your load) you'll need to consult with a qualified electrician to ensure what you're doing is safe and doesn't violate any local wiring codes or laws.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

pfletch101
Posts: 510
Joined: Sat Feb 24, 2018 4:09 am
Location: Illinois, USA

Re: Automate water heater - Temp sensor/110v relay/switch

Thu May 02, 2019 7:26 pm

iwiber wrote:
Thu May 02, 2019 1:49 pm
Hi guys,

I'm quite familiar with computer/linux etc but didn't even know about Raspberry PI until someone tells me I could probably do what I want with it. Here's what I'd like to do, can you please advise on what you'd use?

I basically need to read the temp of a water tank, and create a condition that if water is less than 55°, then turn on the power (110v). If it's more than 59°, turn off the power.

I the temp sensor DS18B20 could do it, and in term of switch/relay I'm having a hard time finding something that could sustain up to 8-10amp.

Any suggestion would be appreciated!

Thanks
Would a regular water heater thermostat switch not do the job for you, without complicating things?

PhatFil
Posts: 1368
Joined: Thu Apr 13, 2017 3:55 pm
Location: Oxford UK

Re: Automate water heater - Temp sensor/110v relay/switch

Thu May 02, 2019 10:11 pm

check out the devices popular with home automation hobbyists,

i think this may be suitable: https://www.itead.cc/smart-home/sonoff-th.html

I use a number of itead/sonoff devices with this alternative and powerful open source project firmware
https://www.itead.cc/smart-home/sonoff-th.html

scotty428
Posts: 3
Joined: Mon Jul 15, 2019 9:22 pm

Re: Automate water heater - Temp sensor/110v relay/switch

Mon Jul 15, 2019 9:35 pm

I would definitely agree with DougieLawson that it is safer to use a product which has already built and tested for mains switching.

The problem with the switch carried by Adafruit, as well as something like this from ITEAD https://www.itead.cc/smart-home/sonoff-mini.html is that neither are UL listed. That may not matter for a hobbyist, unless the insurance company finds out why your house burned down. It does matter if your business is trying to field a product, since using a non-UL listed product will open your company up to liability issues.

I have searched and searched for an enclosed, professionally produced relay to switch mains current, controlled by 5vdc or 12vdc, which is UL Listed. Does anyone know of such a product?

blimpyway
Posts: 168
Joined: Mon Mar 19, 2018 1:18 pm

Re: Automate water heater - Temp sensor/110v relay/switch

Tue Jul 16, 2019 3:57 pm

the most common relays used in both 5v relay modules and sonoff remote switches are songle relays which in their datasheets they claim as being "UL,CUL,TUV recognized".

scotty428
Posts: 3
Joined: Mon Jul 15, 2019 9:22 pm

Re: Automate water heater - Temp sensor/110v relay/switch

Tue Jul 16, 2019 10:11 pm

I mean no offense, but of course constructing something of UL listed components in no way guarantees any level of safety of the product. It certainly doesn't lessen the insurance liability. It's better than using shoddy components, but still the wiring could be faulty, the circuit traces too small, etc.

I really want to like the sonoff products, because many of them do just what I want, and they are priced nicely. UL testing and certification is not cheap, and their products would likely be more expensive if they conformed to UL standards and carried the UL listing.

blimpyway
Posts: 168
Joined: Mon Mar 19, 2018 1:18 pm

Re: Automate water heater - Temp sensor/110v relay/switch

Wed Jul 17, 2019 10:47 am

You are right, but according to this "regulatory" logic, when you create a "device" made of "parts" it doesn't matter the parts are UL-listed or not since the "device" you just made from those parts is not UL listed.

Which means no matter if you build the relay circuit yourself or you buy the same module that you can build yourself you are covered by insurance when both a. and b. happened:
a.) you are a certified electrician
b.) the accident was provoked by a part which was certified, was used correctly but it still started the fire or leaked high voltage to low voltage side of the circuit.

And not covered when any of following happened:
1. You are not a certified professional, period. No matter what parts you used to build a circuit.
2. You are a certified professional but accident was provoked by something you did wrong like:
2.1 Accident started from a component that is not certified
2.2 You used the parts incorrectly in a manner that increased the likelihood of an accident.
------------------

I mean if you play the regulator's music, you should not tell someone "Just use certified parts to get your ass covered" because it takes more than certified parts to have an ass covered.

pcmanbob
Posts: 6935
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Automate water heater - Temp sensor/110v relay/switch

Wed Jul 17, 2019 11:37 am

Even if you ignore all the regularly requirements , how are you going to cope with the fact that the pi may not recover correctly from a mains failure or may lock up with the relay on , leading to boiling water being produced.

I agree with pfletch101 , in this use case a regular water heater thermostat switch would do the job more reliably and safely as well, and if installed by a professional would not invalidate any insurance.

Yes the pi is a great bit of kit but its not the answer to every problem and never will be......
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

scotty428
Posts: 3
Joined: Mon Jul 15, 2019 9:22 pm

Re: Automate water heater - Temp sensor/110v relay/switch

Thu Aug 01, 2019 5:18 pm

I finally found a product which is UL listed, and can be switched by a low voltage GPIO signal. However, as expected, that UL certification doesn't come cheap! Here's a link to the product:
http://dataprobe.com/iboot-io/

Return to “Other projects”