Water Temperature Controller

Hello,

I'm a totally new to using the Arduino and any electronics equipment to be honest, but I've started a little project which is simply to control the temperature of a liquid.

So far I have an Arduino with Sensor Shield V4 (probably unnecessary in hindsight), which is connected to a temperature probe through a pull-up resistor as shown below:

And it works fine with the library and code that I found:

Now what I want to do is allow my Arduino to control a kettle (connected to the mains(240V)) through an SSR relay which I have (SSR Relay), but I have no idea what I'm doing here, though I understand the risks.

My thoughts are that the relay fits between the cable running from the mains to the kettle, which is also connected to the Arduino, which in turn can turn the relay on/off using 0-5V. Any help with this would be greatly appreciated and I'm happy to read up if I need to, but I don't understand much of what I've come across so far.

If I was trying this project I wouldn't touch the mains.
I would use a powerswitch tail.

http://www.powerswitchtail.com/Pages/default.aspx

Plug the kettle into the powerswitch tail and plug that into the wall outlet.
The arduino then turns the powerswitch tail on and off.

rickyg32:
Hello,

I'm a totally new to using the Arduino and any electronics equipment to be honest, .....
And it works fine with the library and code that I found:

..... but I have no idea what I'm doing here, though I understand the risks.

the work arrogance comes to mind.
if you are new to electronics and have no idea what you are doing, how can you understand the risks ?
can you actually list 3 very real and very hazardous results from your project ?
I will be happy to help, but it is hard to fill a cup that is already full.

Maybe I should have said that I understand there are risks, not what they are. I only know that there are hazards with exposed wire and if not set up correctly could fry the computer through the arduino.

The powerswitch tail seems to avoid the dangers, so I suppose I could use that. I would genuinely like to know how to use the relay though even if I end up avoiding it.

the NEC in the US uses a voltage under 50 as low voltage.
for the average Joe, we think 120 is risky, but safe enough to play with. as there is only one hot wire. you have a 50/50 chance of not getting shocked.

when you use 230v, the risks more than double. there are two hot wires, so that means you have a 100% chance that if you touch a wire, you will get shocked.
put another way, if you screw up. you have a 100% chance of catastrophic failure.

besides your own death, it could be worse, much worse.
you could be blinded by the flash and never see people on-line scold you for taking dangerous thing too lightly. that can be remedied, we can make videos with sound for the blind.

but, if it go really bad, someone else could get shocked. it is one thing to kill or blind yourself, but to hurt others....

if you want to have some fun, get a hot dog. touch the ends of 230v to each end.
imagine that is your hand. not fun.

relays. steppers, most motors, solenoids. electro magnets,

all these are made up of coils. all a coil is, well a coil of wire.
current passing thru a wire will create a magnetic field.
if you put something inside that such as a nail. remember 5th grade when you wrapped wire around a nail to make an electro magnet ?

well, if you wrap wire around a piece of metal, it creates an electro magnet. very little power. lots and lots of magnetism.

if you put your switch on a hinge, you can use a tiny amount of power and create a magnet and that in-turn can open or close the switch.

the switch and the magnet are in close proximity, but have NO ELECTRICAL CONNECTION.
the beauty of a relay is that it isolates.
your 230v line is isolated from your 5v line.

in this respect the relay belongs in the list of things that isolate circuits.

if you are working on 230v here in the States, then BOTH wires to your heater are live, or hot.
if you open either one, the ENTIRE CIRCUIT is hot. this is cause for many people getting burnt.
think walking on coals, if your foot gets hot, so you lift it and put all your weight on your other foot, in the coals.....

for that reason, here in the States, we isolate BOTH legs, so use two separate relays.

I don't know why some here are busting your chops over this. Maybe they are trying to put the fear of God into you regarding playing with power.

I work with this stuff every day. I am an electrician (in the States) and also have a BSEE degree. You just need to be careful. Cover your connections (electrical tape will do the job). I would also secure the SSR to are board so that it does move around. Get yourself a multimeter if you don't have one already. Double check your connections to make sure you don't have shorts across the mains. It would also be a good idea to put a fuse in front of the SSR just as an added level of protection.

As a side note, I don't know if your 230V (I am assuming UK) is really 115 to ground or 230 to ground. Here in the States we have 120V to ground. The neutral is the center tap of the transformer, which is grounded.

As far as your question goes, what you are trying to do is a simple control function. Look for a PID control program (Proportional, Integral, Differential) control. I don't know what the Power Switch Tail has in it for the relay. Could be solid state, but don't know it it handles "high frequency switching" very well. I would use the SSR that you already have.

Use your head and be safe. Don't get cocky and take shortcuts. This stuff can hurt you (or somebody else), but it can be total safe.

I just recently found that the word "kettle" is not used in the USA. That's why they have coffee makers but not tea makers.

If you showed us the datasheet for the SSR then perhaps there might be some better suggestions on how to make the wiring safe. Otherwise, just google for mains wiring tutorials and I'm sure there are tutorials online that show you the proper way to carry the earth wire around the relay and keep the active wires safe.

The suggestion of the PID algorithm was spot on there is an Arduino library that works quite nice for what you want to. The heating plate probably draws enough current that you need a heat sink on your SSR, SSR's are not 100% efficient and the much of the lost energy/power goes to generating heat, this heat if not dealt with can cook the SSR to well done.

Yes, be safe with the mains voltage but taking some basic precautions will probably keep you safe. Do the work before a long stint at the pub, lots of ale and mains voltage can be dangerous.

Good luck and have fun,
wade

PID might be overkill but here's a link to the PID library. From the basic example you would let your Setpoint be the temperature you want, your Input is the temperature reading from the DS18B20, and the Output variable will be calculated by the library to a value between 0-255 (by default) which you would analogWrite() to your SSR pin.

MikeLittle:
I don't know why some here are busting your chops over this. Maybe they are trying to put the fear of God into you regarding playing with power.

Use your head and be safe. Don't get cocky and take shortcuts. This stuff can hurt you (or somebody else), but it can be total safe.

the cocky attitude is what struck me.
lots of folks on here are scared to death of 220 and insist you bring in a licensed electrician.
any work can be done safely. something less than 2% of electricians die every year from electrocution.
if you go in thinking it will not hurt, me, you get cocky. if you go in knowing it is a two headed snake, you look twice, think twice and then do in right.

kettle and 240v points to this being a uk post. That means one hot wire and one natural.

now the problems starts with the amp load. kettles can pull over 10 amps so whats the kettle max amp rating and whats the relay max amps.

next problem is there's no way you can mount a solid state relay with out exposed terminals. On a bench that may work for a test but in real life that's a no no. A box would work as long as its splash proof and uses cord grips (installed by a electrician)

Kettles plug in so the box would need to be installed in the kettle lead not in the home wiring.

next the probe is cute and waterproof but will it handle 100 degree C (im talking about the cable not the metal part of the probe)

if this is the uk then you most probably have a whole house gfci so its a little safer than the usa but it will still make you hurt like hell and you will taste your fillings once you get off the floor.

personally I wouldn't suggest this as a project for testing thermal controls even to someone who has experience. If I was to suggest it then I would be looking at a remote receptacle (plugs into a normal receptacle and is controlled by a remote) then have the arduino work the remote button. (this is still based on the remote receptacle being able to handle the amp load of the kettle)

p.s kettles are hard to find in the usa so most people have no idea what one is

youwill need to be carefull with your 240 volt, and a kettle will need over 2 amps, so this setup will not work.
sorry

the NEC in the US uses a voltage under 50 as low voltage.

voltages under 600 ac are low voltages under 50 ac (US) and 30 ac(Canada) are extra low voltages

when you use 230v, the risks more than double. there are two hot wires

Not in most of the world

Better to keep ones mouth closed and appear a fool.

dave-in-nj:
the cocky attitude is what struck me.
lots of folks on here are scared to death of 220 and insist you bring in a licensed electrician.
any work can be done safely. something less than 2% of electricians die every year from electrocution.
if you go in thinking it will not hurt, me, you get cocky. if you go in knowing it is a two headed snake, you look twice, think twice and then do in right.

Dave you are not an electrician, don't sound like an engineer, and disseminate misinformation.
You really should not have an opinion, for your own sake

the cocky attitude is what struck me.

Well, grunt big for daddy and you will probably feel better.

shooter:
youwill need to be carefull with your 240 volt, and a kettle will need over 2 amps, so this setup will not work.
sorry

Kettles are around 1000W so 480W (2A at 240V) is not bad at all. My crock pot is only 250W on high power but I never use that setting because it has a tendency to burn whatever I'm cooking. All he's doing here is maintaining a water temperature anyway.

Mains power needs respect but let's not get paranoid.

Chagrin:
Kettles are around 1000W so 480W (2A at 240V) is not bad at all. My crock pot is only 250W on high power but I never use that setting because it has a tendency to burn whatever I'm cooking. All he's doing here is maintaining a water temperature anyway.

Mains power needs respect but let's not get paranoid.

the op never said where he was from but standard 240v for a kettle suggests that its the uk.

heres a link to a uk web site where I use to shop.

http://www.argos.co.uk/static/Product/partNumber/4028222.htm

cheap kettle 3kw 240volt (single wire 240v not the American 2 legs at 110v). Plugs in the uk are rated and fused at 13amp max.