Hi,
I have fixed up an old MIG welder and it works again, but the gas flow is uninterupted (I need to close the valve on the bottle to stop the flow). So I will fit an electric valve and this gives me the opportunity to add some functions. What I want is the gas to flow before the wire feed starts and the wire feed to stop before the gas flow does.
I have done some Arduino project, but I've always copied other people's handywork. Here is my first ever sketch. Would this work? It seems almost too easy...
/*
* This sktech is used to switch on the wire feed of my MIG welder a little later then the gas flow starts, and to keep the gas flowing a bit longer after the wire feed is stopped
*/
// declaring the pins:
int WireFeed = 4;
int GasFlow = 6;
int Switch = 8;
void setup() {
// define in and out puts:
pinMode(WireFeed, OUTPUT);
pinMode(GasFlow, OUTPUT);
pinMode(Switch, INPUT);
// set everything low to start with:
digitalWrite(WireFeed, LOW);
digitalWrite(GasFlow, LOW);
}
void loop() {
// Turning on the gas flow before the wire feed:
if (digitalRead(Switch) == HIGH && digitalRead(GasFlow) == LOW && digitalRead(WireFeed) == LOW)
{
digitalWrite(GasFlow, HIGH);
delay(750);
digitalWrite(WireFeed, HIGH);
}
// Leaving the gas flow on a bit after cutting the wire feed:
if (digitalRead(Switch) == LOW && digitalRead(GasFlow) == HIGH && digitalRead(WireFeed) == HIGH)
{
digitalWrite(WireFeed, LOW);
delay(1500);
digitalWrite(GasFlow, LOW);
}
}