Pages: 1 2 [3]   Go Down
Author Topic: Water Heater  (Read 6409 times)
0 Members and 1 Guest are viewing this topic.
Topsham, Vermont USA
Offline Offline
Edison Member
*
Karma: 32
Posts: 1866
... in The Woods In Vermont
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, Some How-To Arduino Power info here:  http://arduino-info.wikispaces.com/ArduinoPower

Water and heating elements have a lot of "thermal inertia".. If you use a Solid State Relay and turn it on and off about 5 times a second, and vary how long it's on each time, you can control the heat input easily. Example: http://goo.gl/jbNwl  which is optically isolated so you have no direct connection between your Arduino and your heater..

DISCLAIMER: Mentioned stuff from my own shop...
Logged

Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info

Offline Offline
Full Member
***
Karma: 0
Posts: 162
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Terry's idea is excellent.  A solid-state relay like that does exactly what you want - control with a digital Arduino pin and safe isolated control of heavy AC load like a heating element.   That's why he's listed as a "God member"  smiley

The only thing is that the built in PWM frequency is much too fast for it. You'll have to do the PWM yourself, called "bit-banging" if you want to search for it.
The following code should let you control 100 levels of heat:
Code:
void setup()
{
  pinMode(13, OUTPUT);
}
void loop()
{
   slowPWM(50);      // must repeatedly call for a pulse with the duty cycle you wish.
}
void slowPWM( int dutyCycle)      // dutyCycle is 0-100   (%)
{
   if (dutyCycle > 0)
   {
       digitalWrite(13, HIGH);
       delay(dutyCycle * 10);         // Turn heater on for 10 - 1000 ms
   }

   digitalWrite(13, LOW);
   delay((100 - dutyCycle) * 10);   // Turn heater off 1 second minus On time
}
« Last Edit: May 29, 2012, 09:24:41 am by Techylah » Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 290
Posts: 25735
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

...bonus marks available for eliminating "delay()"  ;-)
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Offline Offline
Full Member
***
Karma: 0
Posts: 162
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
...bonus marks available for eliminating "delay()"  ;-)
Ok, I'll bite.  Especially with bonus marks from a pro!
This should do the same, but without using delay().
I agree that this is a good coding practice.  There's now more time for anything else to be done.  Why waste time?

Code:
int         dutyCycle = 25;       // or whatever you set duty cycle 0-100 to be
long           toggleTime;                  // the time the next change should happen
boolean      bHeaterIsOn
void init()
{
   pinMode(13, OUTPUT);
   bHeaterIsOn = false;
   digitalWrite(13, LOW);           //  turn heater off
   toggleTime = 0;
}
void loop()
{
   long  currentTime = millis();
   if (currentTime >= toggleTime)
      if (!bHeaterIsOn)                // if heater is off
      {
          digitalWrite(13, HIGH);   //  turn heater on
          bHeaterIsOn = true;
          toggleTime = currentTime + dutyCycle * 10;                // set the turn Off time
      }
      else
      {
          digitalWrite(13, LOW);   //  turn heater off
          bHeaterIsOn = false;
          toggleTime = currentTime + (100 - dutyCycle) * 10;     // set the turn On time
      }
}
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Terry, the Arduino-Info website was really useful. I dindn't know it yet, but I learned a lot there.
Below there is the circuit's image. I think I'm not using the correct symbols.
Do I need to use any resistance or fuse to increase security or precision? I'm careful to not burn anything. xD I know nothing about it yet, but for me it is correct.

Also, I have one last question about water heaters. There are the heaters like this one ( http://www.amazon.com/Heater-Portable-Immersion-Voltage-Beverage/dp/B000VK0DRY/ref=pd_sbs_a_2 ) that Techylah recommend me, but it appears to stop working a lot. If I use one like this: http://www.amazon.com/Camco-02103-1000w-Heater-Element/dp/B0006IX8AA/ref=pd_cp_hi_0 can I use to heat drink water? I don't see any problem, but since I will drink it, is it best to ask.
I think with the relay I can have a good control the temperature of that heater.


Logged

Topsham, Vermont USA
Offline Offline
Edison Member
*
Karma: 32
Posts: 1866
... in The Woods In Vermont
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Zhozer,  Two comments:

- What container will hold the water?  Can you make a hole in the side for the second heater?  That heater is large, maybe 20 cm long.

- Your diagram does not have details..  The relay would not connect directly to the Arduino.  Many people use relay boards like these: http://goo.gl/jJRYM as an example. Or the solid state type may be better: http://goo.gl/jbNwl  Those and other relay boards are shown on the Wiki.

I think your big job first is to decide the container and the heater and make it work by just plugging it in and testing.  After you understand that you can connect and Arduino, temperature sensor and heater.. 

What country are you in? What is the line voltage?
Logged

Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info

Offline Offline
Full Member
***
Karma: 0
Posts: 162
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Zhozer, also make sure it is stainless steel.  Those commercial units may not be, and so might add some bad (or harmful?) taste to the heated water.
This is another type that has lower power, is stainless steel, and is immersion rather than permanently mounted.
Reliability should be much higher than the low end consumer item.
You could even stick it (with the sensor) in a porcelin or china tea pot if you wish.
http://www.amazon.com/Amico-Heating-Element-Cartridge-Heater/dp/B007HKK8TY/ref=sr_1_7?s=hi&ie=UTF8&qid=1338821510&sr=1-7

The solid state relay is by far your best approach.  The one Terry points to requires less than 20ma at 5v and can be driven with a single Arduino pin.
No Darlingtons, simple wiring, and plenty of output current capability.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, I will use the solid state relay. But I have to connect that relay to Arduino to control the turn in/turn off mode. Am I wrong?

Terry, in the first moment I'll use any container (maybe a simple metal kettle that I already have and use on the cooker, or a glass kettle  that I use in a microwave). I intend to make a container only to heat water and then transfer it automatically to a proper kettle to infuse the tea, but that'll be on another step. I have first to learn the basic. Also because there are many good designs comonly used so I pretend to make some tests.

At home I use mainly 110V, but I have also 220V option, so I can choose.

Techylah, that one seems really good. There are some expensive heaters that looks nice, maybe I can change when I make some improvements. Obviously, I don't want to buy many heaters to test. xD

I think the temperature sensor is the easy part to choose, I'll buy that one that's already a waterproof sensor.
« Last Edit: June 04, 2012, 10:19:48 pm by zhozer » Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 162
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Yes, I will use the solid state relay. But I have to connect that relay to Arduino to control the turn in/turn off mode. Am I wrong?
You are right.  Note that only with the solid state relay can you implement your variable heating rate. (See my code delay-less version of code in Reply#33)
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you. I've already bought all I need. When I finish my project I'll update here, so I can help other noobs like me.
Techylah, or code seems good. smiley Maybe I'll make some small modifications, but I'll write here the final code, if I change something.
Logged

Pages: 1 2 [3]   Go Up
Jump to: