Solid state relay for arduino

Hi friends, i have a question.. what do you think about this relay with the arduino? will it power it up? i dont know a lot about this kind of relays.. but i see that its possible to run it between 3-32 v. so my question is if its must to be PWM.. i want it to close a very high consumption water heater (250 v 10-15 amps).

what do you think?

PWM doesn’t work well with solid state relays, as it would need to be sync’ed with the phase of the mains in order to be able to do the same thing as dimming a lamp.

But, If you want to just turn on/off a water heater it would work.

However if you want to modulate the power taken by your water heater, you’d need to use a power triac driven through a opto-triac from the Arduino, and the Arduino would need a zero crossing detector (which usually consists of another opto coupler)

Search on Instructables etc there are articles on there about how to do this.

Note. Dealing with mains power is dangerous unless you know what you are doing.

I use a 25A SSR to control a water heater, no problem. (but NOT with PWM)
I’m using this code

/***********************************************************
 * -> program for vv-bereder
/**********************************************************
 * Bruker port B2,B3,B4 OG B5 til SSR (pins 10,11,12 og 13)
 * Tabell for ntc
 * Grader   R     serieR  analog 
 * 50	3592	2700	438
 * 55	2972	2700	486
 * 60	2472	2700	534
 * 65	2066	2700	5  
 * 70	1735	2700	622
 * 75	1465	2700	663
 * 80	1243	2700	700
 * 85	1059	2700	734
 * 90	908	2700	765
 ************************************************************/
#define Gled 8 // Green led
#define Rled 9  // red led

unsigned long neste,nu ; // control timing intervals
int aval;  // read value
int ventetid = 1000; // 1 sek delay between readings
boolean heating=true;


//*********************************
void setup()
//*********************************
{ 
  neste=millis();
  DDRB |= B00111111; // pins 13..8 er OUT-pins
  pinMode(A1,OUTPUT);
  pinMode(A2,OUTPUT);
  digitalWrite(A1,LOW);
  digitalWrite(A2,HIGH);
  Serial.begin(19200);  
}

void start()
{
  PORTB |= B00111100;  // xx1111xx, I/Opins 13..10 slår SSR på
  heating=true;
}

void stopp()
{
  PORTB &= B11000011; // xx00000x, IO 13..9 slår SSR av
  heating=false;
}

//*********************************
void loop()
//*********************************
{
  nu=millis();
  if (nu>=neste) // sjekk kun hvert sek
  {
    neste += ventetid; // note time for next reading
    aval = analogRead(0); 
    if (aval<530) start(); // temp < 60 grader
    if (aval>670) stopp(); // temp > 76 grader
    Serial.println(aval);
    if (heating) 
      digitalWrite(Rled, !digitalRead(Rled)); //blink rød LED
    else
      digitalWrite(Gled,!digitalRead(Gled)); //blink på grønn LED - viser avslått
  }
}

hi,i think i didnt explained my self right… i dont want the pwm… i want the relay work like a mechanical relay… open or close…
knut_ny, i see that your code read the temp from the water heater… i dont have this option… :sob:

but i still dont understand:
if ill connect 5v to the input of the the relay the other side will close like mechanic relay(fully close)?
this is what i want to buy :
ssr relay ebay
if i understand right i need a volt converter to 32v (?)
thanks :slight_smile:

That SSR runs just fine directly from arduino. U can see that I run 4 I/O-pins parallel to share the load. (Thin may not be neccecary - I dint test it)

The relay need enought voltage (and current) to light a LED

I have two projects running this relay to control similar heaters without a problem. I've only triggered them with a single pin.