Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am looking into a project to measure the temperature inside a water heater and turning it on based on: time, temp, etc.

I am only on the theoretical phase since I am not sure it is possible.

I will probably need a middle device to send the actual current to the heater but I am not sure how to tackle this.

I would like to send a 'true' signal through the Pi based on specific conditions, which in turn will turn on the water heater.

share|improve this question
Is this an electric hot water heater? or gas/oil fired? – Steve Robillard Sep 22 '12 at 1:16
Electric water heater – raam86 Sep 22 '12 at 3:20
This question is a duplicate of raspberrypi.stackexchange.com/q/1633/626 - please help to improve good questions and answers to common questions instead of just raising the number of questions! – Jakob Sep 23 '12 at 7:55
You didn't specify if it was a 3 phase heater or not! But if it is a 3 phase, this rely should work: se.farnell.com/carlo-gavazzi/rz3a60d25/ssr-25a-600vac/dp/… – Christian Sep 23 '12 at 8:13
up vote 0 down vote accepted

You can use a relay. I'm assuming if you plan to do this, that you know the basic working of what relays are and how they apply to your use. Although i think you may not be able to find a relay that can handle high enough current for a water heater that the RPi can trigger, so you may need a relay to switch a bigger relay. (much like a darlington transistor pair)

share|improve this answer
I suggest to also use some extra components to switch the first relay itself, I don't think the Raspberry Pi will be very happy to switch highly inductive loads without any precautions. (At least use an extra diode to dissipate the switch-off current peek, better switch a transistor with the Raspberry Pi and let this transistor switch the relay, better safe then sorry) – ikku Sep 22 '12 at 12:59
Yes. The difference in current actually makes me nervous. I will probably extend something from the boiler and relay that – raam86 Sep 22 '12 at 14:35
The difference in current between the primary (coil) and secondary (contacts) side of the relay is nothing to worry about, that is why they are what they are, relays. The problem is that switching a coil on and off has some secondary effects that you do not want on your GPIO pins, you need to protect the GPIO pins from these effects, this diode will help a lot and to be sure switching a transistor instead of the relay itself will make sure that any effects (if over time the diode might fail) will only blow up your transistor and not your GPIO port. – ikku Sep 22 '12 at 19:13

You should use a transistor driven relay, and for the temperature measurement you should use a thermocouple.

You should not connect the relay directly to the PI for two reasons 1: it might not be able to source enough current 2: safety, when you turn the relay off the collapsing magnetic field, see http://electronics.stackexchange.com/questions/51744/how-to-control-4-relays-with-a-not-chip-7404

The thermocouple: as I don't know what accuracy you don't need ill just guess that you don't need capabilities much over 100 degrees Celsius. Also your accuracy wont be crucial so i would say just get the cheapest one, K-type probably.

share|improve this answer

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

Extended answer... much more helpful. Thanks! – Andrew Dec 24 '12 at 9:14

You will probably have to use a Relay that is powered by the Pi's GPIO to turn on the power to the heater.

This may be something like what you want, although it is a little expensive.

Of course the voltage may be important, and you need to know the amperage of your water heater. Also, mains electricity can be dangerous, so be very careful if working with it, or better, hire somebody who is qualified to.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.