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.


3 Answers 3


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 https://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.


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.


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)

  • 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
    Commented Sep 22, 2012 at 12:59
  • Yes. The difference in current actually makes me nervous. I will probably extend something from the boiler and relay that
    – raam86
    Commented Sep 22, 2012 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
    Commented Sep 22, 2012 at 19:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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