Controlling a Pump Powered by AC to DC Transformer using Power Relay Shield

Hi Guys,

I need to turn a pump on and off for a very brief period of time, the cycle I'm trying to achieve is 15 seconds on, 6 minutes off.

I got myself an UNO R3 and a Linksprite Power Relay Shield: Relay Shield For Arduino | LinkSprite Learning Center

The pump is powered by a transformer which takes a standard kettle lead. I've trimmed the lead and exposed the wires and cut the live (brown) wire. I've plugged that into the COM + NO1 (Normally open) header, the kettle lead is then plugged into the pumps transformer and that is plugged into the pump.

In my setup() I switch all power pins OFF, the switch them to OUTPUT. In my loop I switch the appropriate power pin LOW to close the circuit and the pump fires up. After 15 seconds I flip it to HIGH to open the circuit and pump turns off. I then wait for 6 minutes and repeat the cycle indefinitely

However what I am seeing is that after 1 or 2 cycles the pump stops turning off. I'm guessing this has something to do with some voltage kick back when the I cut the circuit to the transformer. I'm an electronics novice so am just guessing based on the research I've done.

Arduino UNO is powered by 5V USB Adapter, Power Relay Shield is powered by 9V Adapter generating 640mA. The transformer powering my pump says it outputs 12V 2A. Could I be overloading the power relay in some way which is preventing it from turning off? Kettle lead is plugged into standard wall socket, then connected to power relay and subsequently pump's transformer

Any advice would be greatly appreciated.

Please post your code. In code tags.
The relay shield can switch a maximum of 35VDC. That may be a problem. How much current does your pump draw?

Using a 35V rated module at mains voltage is awesomely foolish. Trying for the Darwin award?

Warning noted but it would have been more useful if it included why what I'm doing is dangerous and what I should do/read-up on next. I'm happy to put in the ground work but I'm a complete novice at this right now.

I've been programming for quite a while but this my first real foray into controlling electronics. Given same thing worked for a lamp when I was testing my code I (naively) assumed it would hold for the pump's kettle lead.

I'm not sure how much current the pump is drawing. The transformer outputs 12V DC 2A does that help. I really need to get a multi-meter.

#define PUMP_RELAY_PIN 4
#define ON_TIME 15000
#define OFF_TIME 360000
//#define OFF_TIME 5000
void setup() {
  Serial.begin(9600);
  for(int i=0; i < 10 ; i++) {
    digitalWrite(i, LOW);
    delay(1000);
    pinMode(i, OUTPUT);
    delay(1000);
  }
  Serial.println(F("ALL PINS TO OUTPUT + LOW"));
  Serial.flush();
  dumpStatus();
}

void dumpStatus() {
  for(int i=0; i < 10; i++) {
    Serial.print("PIN =");
    Serial.println(digitalRead(i));
    Serial.flush();
  }
}

void loop() {
  digitalWrite(PUMP_RELAY_PIN, HIGH);
  Serial.println("PUMP ON");
  Serial.flush();
  dumpStatus();
  delay(ON_TIME);
  
  digitalWrite(PUMP_RELAY_PIN, LOW);
  Serial.println("PUMP OFF");
  Serial.flush();
  dumpStatus();
  delay(OFF_TIME);
  
}

Use a switch that is designed for mains AC. That could be a solid state relay (SSR) or an electromechanical relay.

SSRs are easy to use with Arduino. If the SSR is like the following, it has a built in current limiting resistor on its input, so you just connect the + input to an Arduino digital output and the other to Arduino ground. http://www.ebay.com/itm/SSR-40DA-Solid-State-Relay-40A-250V-3-32VDC-SSR-40DA-/381354520624?hash=item58ca803030

And please don't electrocute yourself!

Hi Guys,

Just wanted to say thank you. I installed a simple 1 channel SSR last week. It's working a treat been running my pump continuously the whole week.

Really appreciate it

Cheers

Rob