help with code (battery tab spot welder)

Oh, It is ac, not dc? About 40 to 60 watts the I guess.
Mos fet will not be good for ac I don't think.

Is your ssr (solid state relay ac or dc)? If it is ac, it may be a good choice for a driver.

the ssr is a 120v relay
Crydom D1210

I've done some reading on just these devices myself in the past few weeks. From what I read, you may not be planning to put enough energy into forming the nugget between the two sheets of metal.

The figure I see commonly quoted is 200 Joules, or to put it another way - Volts * Amps * Seconds = 200
Obviously, this would be useless if the delivery time was (for instance) 200 seconds - 1 Watt for 200 seconds. I've used camera flash capacitors in the past to dump about 100uF or 200uF of ~325v into a 10 ohm load - yeah, it was spectacular - a peak of around 10,000 Watts - The thing would easily vaporize ~8mm of the thin nichrome wire used in electric blankets. Not bad for something powered by a single AA cell, the whole device fitted in a jeans pocket.

You may need to look into either (a) rewinding the secondary on the MOT with fewer turns of thicker wire (I hear car battery jumper leads are ok) or using capacitive discharge. I'd try which ever was going to be the easiest/cheapest while still concentrating the energy transfer enough that the nugget is formed between the two sheets.

Here's the last page I was reading on the things: Zero Emission Vehicles Australia

Well, 120 volt does not really say if it is ac, or dc. There are both kinds, and they can not be switched.
Do you have a URL where it came from?
If not, what are the symbols on the two output terminals? + and - will indicate dc. ~ and ~ will indicate ac.

@enhzflep does the welder need to be low voltage/high amp, or just high watts?
I have some supercapacitors with about 2000 farid, and wired up as 12 volts, they seemed pretty hot. But if the OP is using AC, that would not be usable. Is it different using ac or dc?

@Jack - My understanding is that you want a fairly low voltage at a high current. I've not seen it stated explicitly anywhere, though I suspect this to be the case by virtue of the fact that everyone always uses a bank of large capacitors.

Since the number of joules stored is calculated by: E = 1/2 CV² it's quite clear that doubling the voltage has a larger effect than doubling capacitance. This would indicate the cheapest way to deliver the required # of joules to be high-voltage, low capacitance. But as I say, the designs I see never seem to be setup that way. They always use thick cabling.

The page I linked to talks about using about 1.8F at around 15v. I think you need to use DC, but again - it's not something I know. I've got a kerb-side MOT in the shed (i.e picked up off the side of the road), but like so many other things in there, it's awaiting some of my time and attention.

EDIT: Here's a page detailing a home-brew unit using an ATMega16 or ATMega32 (hex files for each are available)
http://www.pittnerovi.com/jiri/hobby/electronics/welder/

I just looked at my supercapacitors again, and they are 2600 farid, 2.6 volts each, and I have wired them in a series of 6, So I can charge them just like a 12 volt battery.

I think they were taken off busses that used bunches of them for stopping and starting assistance. They are not so cheap tho.

I am suspecting the OP may not have enough amperage also, and if it is ac, caps will not help.

While I was fishing out the link I left in my last post, my eye caught something in the search results.

It may well be an issue of safety. From the time I was dabbling with the camera-flash units, I seem to remember that a heart defibrillator issues a pulse of around 16 joules. I was ever-so careful to not go much above 10J at 325v so that a mistake wouldn't be fatal.

So, it may be as simple as that. Perhaps some googling for the specs of fully automated (industrial, car-welding?) units would provide some more insight into absolute requirements. Naturally, other approaches to the issue may yield easier/faster to obtain results. A bucket-load of expensive capacitors are certainly cheaper than a life! :fearful:

enhz the windings will be 4ga welding cable so your right there. cd discharge is next but got to get the MOT working first super caps dont work well for cd welding so i got 20 120,000 uf caps with a low esr which should be enough since its true farads. but a cd unit will need mosfets to drive it.

well i got to go eat dinner and ill come back and check this thread but you guy are right on track of what i want to do.. now how bout a video of one a guy made but it doesnt have arduino power.. https://www.youtube.com/watch?v=tfJlRnnq6tQ that is pretty much what im making but with more precise control.

Oh, are we talking ac or dc welding. Did you forget to tell us about a large diode somewhere in there? LOL
If you have dc, and caps, then that is where the control circuit should be placed. After the dc caps, so that would put us back to hefty mos fets.
So it sounds like you will use a transformer, to cut the voltage down to around 6 volts, charge capacitors, then zap the welding spot with that large charge. Is that closer to the system?

So your amps for that 1/3 second will be much larger than

it takes 110v in and then does 4-6v out at around 9amps.

Do you know how many amps that will be?

yes thats closer with the transformer. i have alot of caps but since im starting out i want to get the simpler transformer one working. the cd discharge will work great for li-ion batterys but its quite abit more complex and would require hefty mosfets and serious 1/4" copper bus bars and also some serious heat sinking for the mosfets. and the code is way to complex for me right now. but i do got a few goodies for my arduino like a 16x2 lcd and alot of 6mm push buttons so in the future thats where i would like to go. but its baby steps for now. just got to get some pcb board and do some etching because with a simple circuit like this one now theres no need to tie up my uno and since i got all the parts to make a standalone arduino might as well use them. the circuit i made using expresspcb also has a header pins for programing the atmega328p-pu chips so i dont have to remove it from the dip everytime i need to program it and chance breaking it. So far my arduino kit has been awesome and so much stuff was included that i can learn alot. im also working on a 48 channel relay board for christmas light controller unit and i must say its coming along great hardware wise. now in my spot welder circuit there is a diode(1n4004) one the coil side of the relay to only allow current to go one direction. It might be wise to add a zener diode to it to (to make it respond quicker not really much faster but it would be quicker.) I also have a resistor (1K) on the (output) line before it gets to the relay. so in all we got a relay,tip120,1n4004 diode,and a 1k resistor. sorry for my ms paint skills but i think it will explain the circuit. thanks 01sensei

jack with the transformer theres no caps... the caps i have are for a different battery tab welder but its much harder to make.. the transformer when wound right becomes the welder the arduino only controls the amount of time it arcs that way once i find the perfect arc time to get good welds where the nugget is left behind on the battery when the tab is pulled away. i just want some degree of precession to my welds instead of just trying to get it right with guessing. In therory it should make my welds more predictable.

This approach seems like overkill to me. Use a supper cap, 2 farads, and a 12 volt power supply. Charge it up through a current limiting resistor maybe 10 ohms. Then discharge it to the body of the object though the item to be welded to. You can adjust the charge time of the cap to get just the amount of charged needed for the particular weld. There are a number of ways to do this that are describe on the internet.

StanK

Oh, You could use a triac with a cap, DC of course. Trigger the triac and it will discharge and turn its self off when it is discharged. Use the processor to measure the cap charge voltage. You can calculate the charge from the size of the cap and the voltage it is charged to. Use a small relay to control the primary side for charging, measure voltage to charge point, Open primary relay, Trigger triac with processor. weld complete. Sorry if someone already said this but I didn't read all the replies.

StanK

01sensei:
So i started over and while its not perfect it does work and it works pretty well.

void loop(){

// read the state of the pedal switch value:
  pedalState = digitalRead(pedalPin);

// check if the pedal switch is pressed.
  // if it is, the pedalState is HIGH:
  if (pedalState == HIGH) {
    delay (500);
    // delays button for 500ms to give you time to release foot pedal
    // turn LED on:   
    digitalWrite(relayPin, HIGH);
    delay (333);
    // sets relay to high for 333ms
  }
  else {
    // turn Relay off:
    digitalWrite(relayPin, LOW);
  }
}

But what if your operator doesn't take his foot off the pedal before 500 + 333 millis have elapsed? The loop will start again and your relay will pull in again.
Take out

} 
  else {

The end of your code should be:

  delay (333);  // sets relay to high for 333ms 
  digitalWrite(relayPin, LOW);  // turn Relay off
  while(pedalState == HIGH); //Do nothing until pedal released
  }
}

lets say you do get two (real) farad caps. Most are not anywhere close to what they say they are you also need low esr. then the next problem is you will need wore the 12v to charge li-ion tab welding needs around 16v. now lets say we did get 2 real farad and they have low esr now we got to run them parallel and use mosfets. A thriodsistor wont really work reason being once they open they dont close till there empty. so that brings use to the use of mosfets (heavy duty ones) and some decent bus bars. then once we have this we need to make a circuit that fires once but doesnt make a weld it only cleans off contaminants the ms after it fires the secondary charge which makes the physical weld. now we have a dual pulse cd welder. Yes you can weld in one pulse but you wont beable to weld li-ion batterys with 12v. you could at 16v. but if you have invested in caps you might want a dual pulse. Also just a not most car caps are crappy caps there are some that are great like the rockford fosgate 1 farad caps. but for me i got a great deal on some 120,000uf low esr caps. now mine are 10v caps but if i make two banks of ten in parallel then wire them in series i will still have a low enough esr and now 20v cap bank... running caps in series doubles you voltage but also doubles your esr and decresses the total size in half so 20 120k uf caps run in two banks in series gives me. 120000 x 20 = 2400000 2400000/1000000 = 2.4 so we got a total of 2.4 farads not we got to devide 2.4/2 = 1.2 so my total is now only 1.2 farads at 20v and 1 real farad is enough to weld li-ion. think i did that correct...

Henry_best

you my friend seen what i wanted all along that safety measure and since i know nothing about coding i hadnt got that far but now that i just read that code you put up it all makes sense. thank you i will add it to my code and see how it works. it would be much safer for a operator to use that way and since my buddys will most likely use it to rebuild there drill batterys it whould make it almost idiot proof. lol

Henry_best
that code will compile but its not working when the pedal button is held down the relay pin still will go HIGH. theres something still missing.

If you only want one timed pulse output each time a switch is closed, have you considered just using a 555 hardware timer? It would be much simpler and cheaper to implement and probably a lot more robust than putting a microcontroller in such a noisy environment.