Looking for help with cycling a switch

Hi guys I'm new to the Arduino thing, and looking for some guidance. I'm working on essentially a timer for a pump. I'm currently powering a pump with a power supply and I'm need to actuate it with some sort of timer.

I need to turn on the power supply for 65 seconds every hour for anywhere from 24-48 hours. My problem is that the only way to cycle the power supply is with either the switch on the front, or cycling on and off power to the unit.

My question to you guys, is there some sort of switch on the market that can be controlled by a micro-controller and that can handle the current from household power? Does anyone have any experience with this sort of thing and have any other suggestions?

Take a look at the powerswitch tail - it's designed for exactly this purpose and keeps you away from having to work with mains voltage yourself.

Thanks! At first glance it looks close, but in the description is says
"Switches up to 15A (resistive loads) with a 3-12VDC, 3-30mA control signal"

From the power supply, its set to run up to 40A. Yet, during the usual cycle the front of the power supply is saying that I'm only drawing around 20A.

Is there something along these lines with maybe a higher current rating? This style of thing would be absolutely perfect.

I don't know of an equivalent product that'll switch that much current. Of course, you can build your own, but then you're looking at working with high(ish) voltage and current - which is fine if you have experience with those things, but based on your question, I'm guessing you don't. Might be best to find someone who can help with doing it safely.

You're right, I don't necessarily have a ton of experience with it, being an ME. I'd like to buy something off the shelf so I can't really mess it up, but I might not be able to.

What about using a solid state relay? Using a ~40A relay with the ground from the arduino to one pin, the digital to the other. Would I just run my hot(or neutral, more likely?) to the relay?

I'm working on essentially a timer for a pump. I'm currently powering a pump with a power supply

It's madatory knowing the characteristics of the pump, i.e.:

  • power (HP)

  • voltage; # of phases.

  • if it's not a conventional squirrel cage one: r.p.m.; type of on-off cabinet; drive . . .

Regards

Sorry, it's actually a automotive fuel pump.

I don't have any specs for it, besides on the car it is on a 40A circuit. In the case that I'm using it, I'm only seeing around 25A during load. I'm using the power supply because it's easier than buying a inverter and we have a ton of power supplies laying around.

Are you thinking on something like this?

http://www.google.es/imgres?imgurl=https%3A%2F%2Fwww.futurlec.com%2FPictures%2FHFS33_250.jpg&imgrefurl=https%3A%2F%2Fwww.futurlec.com%2FRelays%2FSSRDC100V40Apr.shtml&h=287&w=250&tbnid=CAFwK-R8kX8MKM%3A&zoom=1&docid=znyQEqeQwc85MM&ei=D12YVPzUCIPpaprjgtAC&tbm=isch&ved=0CCEQMygAMAA&iact=rc&uact=3&dur=355&page=1&start=0&ndsp=16

Yep. I believe we actually have some of these laying around.

OK. So now I understand your specs.

Excuse me for a question: You plan to fully dedicate the power supply to this task?. Why not a car battery, I mean?

(Other question: ME stands for mechanical engineer?)

Regards

I'm running a power supply due to availability (many laying around) and I don't have to worry about power loss and recharging a battery. This will be on for around 48 hours at a time and then probably only down for an hour and then back on again.

I originally planned to use some cheap light timer switch from amazon to be my timer, but it got back ordered. Upon further testing,I found I need something a little more precise and more customizable anyways.

This is the SSR I have in my hand in a 40A model.

http://www.crydom.com/en/Products/Catalog/1_dc.pdf

Also, yes I was referring to ME as mechanical engineer. This is not my normal territory.

OK.

Excuse me for my english "manners" (much more for asking obvious things that for the syntax or ortography; I am spaniard).

If you plan to substitute ("emulate") the panel switch of the power supply (I took for granted it's a electronics laboratory type one adjusted to 12 V) you won't need such a big relay (neither solid state -the one we are interchanging links- nor conventional -mechanical-). The front panel switch do not switch the current to the pump (or whatever you are supllying with 12 V): it is made internally.

You have only to switch 240 V AC (125 if you are in England). For this purpose a much smaller mechanical relay will do: you have to switch AC (which is easier than to switch DC) an a smaller current.

You have to look at the back of the power supply to find the current it works at: if it is less than 10 A. you can even use this cheap relay:

http://www.ebay.co.uk/itm/1Pc-New-Optocoupler-Relay-Module-for-Arduino-5V-1-Channel-H-L-Level-Trigger-L5YG/361075200351?_trksid=p5411.c100170.m2943&_trkparms=aid%3D111001%26algo%3DREC.SEED%26ao%3D1%26asc%3D20140131123831%26meid%3Dc216bfe8e2ce495a94d12c0343aed7dc%26pid%3D100170%26prg%3D20140131123831%26rk%3D5%26rkt%3D15%26sd%3D180924375811

Just in case it is bigger you need a bigger relay. As a general rule, for a small project i woudn't use solid state ones (they are a little bit more complicated to connect -and not so obvious working, especially for ME's :wink: )

Regards

No worries! You're English is better than most of my fellow Americans that I work with.

Yes, essentially I am emulating the from panel switch. Sorry I did not explain my whole project very well.

Thank you for setting me straight on the current. I didn't really think the whole thing through. I just assumed current needed on the pump==current needed at the plug. I kind of just ignored what the power supply actually does.

Looking at the power supply I am using it uses 12A. So I guess this puts me back at the first comment with using this:

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

Or just using a cheap relay. I suppose I will just have to look and see what I can get to be delivered first.

Thanks for the advice on the solid state relays! I really need all the indicators I can get frankly (clicking, buzzing, flashing lights). Sometimes even fire lets me know when something isn't/is working!

As far as coding go, I wrote the following to cycle on for one minute and wait for an hour. This should repeat forever correct?

I just want to make sure I am thinking about this correct. I'm sure the pin number is not correct, I don't have the board here yet so I don't know the actual pin location.

//USE THE FOLLOWING 
void setup() {
  pinMode(13,OUTPUT);
  //defining pin 13 as an output 
  
void loop() {
  digitalWrite(13,HIGH); // kick relay on 
  delay (1000*46); // wait for 60 seconds (1000=1 second) 
  digitalWrite(13,LOW); //kick relay off
  delay (1000*3600); // wait for one hour 
}

If I were to add a switch to it, what would I write? Something along the lines as

pinMode(x,OUTPUT);
pinMode(y,INPUT);

digitalWrite(x,HIGH);
while (pin x= pin y);

Loop the code I wrote above

All it would be doing is turning on and off the "timer" essentially.

EDIT: Also, I didn't think to use just a power switch. That would probably be just as easy.

Hang on. you are getting confused here.

You use the Powerswitch Tail to switch the power supply itself, not the output of the power supply to the pump. For two reasons, one of which is that the Powerswitch Tail is not designed to switch DC. More particularly, the input to the power supply is easily within the capability of the Powerswitch Tail.

Correct, I'm in using the Powerswitch tail, to cycle on and off the power supply. The powerswitch tail is rated for up to 15A and now that vffgaston straightened me out, I realized that the power supply is is only 12A at the plug. So yes, I'm within spec of the Powerswitch.

@vffgaston,
The SSR you linked is NOT an AC SSR ! It is 100VDC SSR. This would NOT work with household AC.

@cph15,
SAME STORY for the SSR YOU linked. It is NOT an AC SSR.

Here is an example of an AC SSR
AC SSR

As far as converting 13.8V @40A to nA @ 120V,

P= I x V = 40A*13.8V= 552W

552W/120V=4.6A (@120V)

The SSR you linked is NOT an AC SSR ! It is 100VDC SSR. This would NOT work with household AC.

You're rigth: in fact I was confused at the begining of the whole matter till I realized that the OP wants to switch the power supply itself. The hardware issue is clear now, as Paul__B has given his bless.

(By the way, I didn't know about such a useful device as this Powerswitch Tail. The rigth tool for this project)

So, once the hardware is fully specified, let's go with software:

//USE THE FOLLOWING 
void setup() {
  pinMode(13,OUTPUT);
  //defining pin 13 as an output 
  
void loop() {
  digitalWrite(13,HIGH); // kick relay on 
  delay (1000*46); // wait for 60 seconds (1000=1 second) 
  digitalWrite(13,LOW); //kick relay off
  delay (1000*3600); // wait for one hour 
}

This is basically correct (you can use pin 13, that gives you a visual output too -the led on the card). I guess that writing 1000**46* (instead of 60) is just because of your excitation writing what -I presume- is one of your first pieces of code. Maybe there are some bracketcs lacking, but I guess you will to debug this simple things yourself.

(Software purists will claim on the use of delay(); don't worry, as long as the 60 seconds gas supply every 3660 -be aware of 3660 instead of 3600- seconds hasn't to have over 99.9% accuracy delay() will do).

As we say in spanish, to have a manual switch to unconditionally switch the pump on is "harina de otro costal" (google translates it for "another matter" that is correct but looses the poetry on it).

As delay tells the controller (arduino) to just wait for delay(seconds*1000) seconds witouht doing anything else, the arduino won't check your external push button to start the pump while it is delaying (thats the reason why you musn't use delay())

It depends on the basic spec:

(I will use the spanish "¿" to pose the questions; I think it gives emphasis): ¿Does the main cycle stop if you manually start the pump?. i.e.: ¿Do you need to count 3600 seconds again every time you feed gas manually?.

Depending on the answer the coding would be different.

Regards.

vffgaston:

//USE THE FOLLOWING 

void setup() {
  pinMode(13,OUTPUT);
  //defining pin 13 as an output
 
void loop() {
  digitalWrite(13,HIGH); // kick relay on
  delay (100046); // wait for 60 seconds (1000=1 second)
  digitalWrite(13,LOW); //kick relay off
  delay (1000
3600); // wait for one hour
}




This is basically correct (you can use pin 13, that gives you a visual output too -the led on the card). I guess that writing 1000**46* (instead of 60) is just because of your excitation writing what -I presume- is one of your first pieces of code. Maybe there are some bracketcs lacking, but I guess you will to debug this simple things yourself.

(Software purists will claim on the use of *delay()*; don't worry, as long as the 60 seconds gas supply every 3660 -be aware of *3660* instead of 3600- seconds hasn't to have over 99.9% accuracy delay() will do).

As we say in spanish, to have a manual switch to unconditionally switch the pump on is *"harina de otro costal"* (google translates it for "another matter" that is correct but looses the poetry on it).

As delay tells the controller (arduino) to just wait for _delay(seconds*1000)_ seconds witouht doing anything else, the arduino won't check your external push button to start the pump while it is *delaying* (thats the reason why you musn't use delay())

It depends on the basic spec:

(I will use the spanish "¿" to pose the questions; I think it gives emphasis): ¿Does the main cycle stop if you manually start the pump?. i.e.: ¿Do you need to count 3600 seconds again every time you feed gas manually?.

Depending on the answer the coding would be different.

Regards.

Sorry I didn't update my notes. I'm staying on for 46 seconds, instead of 60. This is one of my first codes in the "arduino" interface (which is c++?). I mainly write in Matlab and the occasional elementary python. I'm not the best programmer in the world, but I can usually fumble my way around and get something to do what I need it to do. So please bare with me.

So, what your saying is that while in the delay state (when I delayed for an hour) the arduino will not do anything. It won't even check to see if it has met a condition, such as a switch.

All I really need to do is have it run it's burst for x seconds, wait for an hour, repeat. And then after 24-48 hours I need to shut it off for a short time while I change a part.

If I power off the arduino at the plug and then plug it back in, it will automatically run the last script loaded to the device? Or do I have reload a script to the board?

raschemmel:
@vffgaston,
The SSR you linked is NOT an AC SSR ! It is 100VDC SSR. This would NOT work with household AC.

@cph15,
SAME STORY for the SSR YOU linked. It is NOT an AC SSR.

Here is an example of an AC SSR
AC SSR

As far as converting 13.8V @40A to nA @ 120V,

P= I x V = 40A*13.8V= 552W

552W/120V=4.6A (@120V)

Thank you for pointing that out. I didn't look very closely.