Using an SSR to switch 120v/40a

Hi,
I'm new to working with arduino as well as relays, and I am working on a project based on an arduino uno with an ssr rated for a load of up to 240Vac / 40A with a control signal between 5 Vdc and 32Vdc with a control current of about 30mA (datasheet isn't very specific). What i'm trying to, eventualy, accomplish is to measure the current with a non-invasive sensor, estimate the power being drawn and switch the load on or off based on that information.

That being said, the first hurdle seems to be the fact that I can turn the relay on, but it seems to latch on even when i drive the arduino control signal from high to low ...

To test the problem in isolation i made a simpler sketch that only tries to switch the relay on and off, (the idea being that it should stay on for 1s and off for 1s (like the blink example).

void setup() {
  pinMode(0,OUTPUT);
  digitalWrite(0,LOW);
}

void loop() {
  digitalWrite(0,HIGH);//switch relay on
  delay(1000);//I know this will jam the microprocessor ... but i wanted the example to be as simple as possible
  digitalWrite(0,LOW);//should switch the relay off !?

}

To this end I have connected the relay to a single 100W incandecent bulb, and interfaced the dc side of the relay as specified in the schematic attached. I can't seem to see any reason the relay should latch to an on state permanently :confused:

Any help will be greatly appretiated!

Thanks in advance!

void setup() {
  pinMode(2,OUTPUT); // DON'T use pin 0 (or 1) as it is used by the Serial IO
  digitalWrite(2,LOW);
}

void loop() {
  digitalWrite(2,HIGH);//switch relay on
  delay(1000);
digitalWrite(2,LOW);//should switch the relay off !?
delay(1000); // Without this the loop restarts to quick for you to see the amp go off

}

OMG! I Thank you! I've been going over this for a whole day! You just brightened my sunday :slight_smile:
I never knew this about pins 0 and 1! So ive i'm not using any serial communication, say the arduino is operating unplugged from the PC ... then they operate as normal digital pins, right?