Arduino Spot Welding Machine, Description:
Arduino Spot Welding Machine- For the last few months, I have been working on Quadcopter drones and electric vehicles for which I need to make some good quality battery packs using Lithium-Ion Batteries. When it comes to making Lithium-Ion battery packs, I simply prefer Spot welding over soldering.
Recently, I built this Semi automatic spot welding machine without the Arduino and it’s working just perfectly. With this spot welding machine, I made 4S and 3S lithium Ion battery packs. Right now, this 100uF capacitor controls the ON time of the transformer and it gives me enough time to weld the nickel-plated strip to the lithium Ion Battery.
Since the ON time of the transformer is limited to a few milliseconds that’s why I can’t use this Spot welding machine to weld other metal parts together and I am also not able to weld thin nickel-plated strips.
Now, in order to be able to weld other metal parts together, I have 2 solutions or options for this.
- I can use a large value capacitor. Or
- I can use a microcontroller board like Arduino, Nodemcu ESP8266, Raspberry Pi, ESP32, Stm32, etc to select the time duration of my choice.
So, let’s say I go with the first option which is the capacitor, obviously, this is the cheapest solution, but I will have to keep changing the capacitor for different welds. So, in the long run, it can be really annoying, and moreover, I will never get that perfect time duration.
Now, if I go with the 2nd option, which is a microcontroller board like Arduino, I can write a few lines of code and then using a potentiometer I can select any time duration for a particular weld job.
Altium Designer is the world’s most trusted PCB design system. Altium Designer enables engineers to effortlessly connect with every facet of the electronics design process. Over 35 years of innovation and development focused on a truly unified design environment makes it the most widely used PCB design solution. With Altium Designer you can create PCB designs with an intuitive and powerful interface that connects you to every aspect of the electronics design process. Route it your way through any angle, tune for the delay, Push, Slide, and Walkaround faster than ever. Interact and collaborate with mechanical designers like never before in a photo-realistic, 3D design environment. If you want to get started with the Altium designer, you can click on the get started.
I am going to connect my 12v adaptor to power up the Arduino and supply 12 volts to the relay module. Next, I am going to set the ON-Time of the transformer using a potentiometer, initially, I am going to start with 105 milliseconds and let’s see, if this time duration is enough to weld these metal strips together.
With this time duration, I am not able to get a strong weld.
Now, I am going to perform my 2nd test, and this time I am going to further increase the ON-Time of the transformer. I set the transformer ON-Time to around 1000 milliseconds. This time the metal strips were nicely welded together, but I wasn’t fully satisfied. So, for the 3rd test, I decided to further increase the transformer ON-Time. I set the ON-Time to 2187 milliseconds.
Now, this is the type of weld which I was looking for; the two metal strips are strongly welded together. Now, the transformer ON-Time duration is in my full control. Anyways, now it’s time to test this Arduino-based Spot welding machine with the Lithium-Ion Battery.
I am going to weld the nickel-plated strip to the Lithium-Ion battery and for this, I am going to reduce the Transformer ON-Time because the 2 seconds time duration will easily destroy the Lithium Ion Battery. I set the ON-Time to 23 milliseconds.
Just look at the welds, seems like if this spot welding is done with a company made spot welding machine. The nickel-plated strip is strongly welded to the lithium Ion Battery. Now, I can confidently use this spot welding machine for making Lithium-Ion battery packs for my Quadcopter Drones and electric bikes without damaging the lithium-Ion batteries. Now, I will explain the connections and working of this Arduino-based spot welding machine with the help of a Proteus simulation and then after that I will explain the Arduino programming. Without any further delay, let’s get started!!!
Other Tools and Components:
*Please Note: These are affiliate links. I may make a commission if you buy the components through these links. I would appreciate your support in this way!
Arduino Spot Welding Machine Connections:
Here I have this simple simulation of the Arduino-based Automatic Spot Welding Machine. First, I am going to explain all the connections and then I will play the simulation. A potentiometer is connected with the Analog pin A0. I am using this potentiometer to control the ON time of the Transformer. The I2C supported 16×2 LCD is used to display the time in Milliseconds. A pushbutton is connected with the digital pin 2. This button is used to signal the controller to turn ON the relay. An LED is connected with the digital pin 8; I am using this LED as an indicator. You will see this LED in action once I explain all the connections.
Pin7 on the Arduino is used to control a 12V relay. This is an SPDT type relay. To drive this relay I am using a 2n2222 NPN transistor. I have a full video on how to use different types of relays and how to design driver circuits. So, if you want to design and make your own relay modules then you should watch my previous video; I will provide a link in the description.
Anyways, one wire from the 220Vac is directly connected with one side of the Microwave Oven Transformer primary side and the other wire from the 220Vac supply is connected with the other side of the primary winding but through this relay. While on the Microwave Oven Transformer’s secondary side the spot welding electrodes are connected. So, that’s all about the connections; and now, let’s play this simulation.
Arduino Spot Welding Machine Working, Simulation:
As I said earlier, I am using this LED as an indicator, when this LED is turned ON it means it’s ready for Welding. Right now the relay is OFF which means you won’t be able to do the welding. On the LCD you can see the time duration in Milliseconds, you can increase and decrease this time duration using this potentiometer, select the time duration as per your welding job. Next, you can press the button, the Arduino will turn ON the relay for that specific time duration, and then the relay will automatically turn OFF.
You might have noticed when I press the button the indicator turns OFF for 3 seconds. When the indicator LED is OFF, even if you press the button the relay won’t turn ON, so you will need to wait for this LED to turn ON, and then again you can press the button to do the welding. This is a kind of protection against if you long-press the button. So, that’s all about the connections and working of the Arduino based Spot Welding Machine. Now, let’s take a look at the programming.
Arduino Spot Welding Machine Programming:
LiquidCrystal_I2C lcd(0x27,16,2); //in simulation use 0x20 and in real use 0x27 i2c address, while 16 = columns, and 2 = rows.
int timedata = A0; // analog pin0 , a Potentiometer is connected with A0 pin of Arduino.
int timerawdata = 0; // stores the value comming from the Potentiometer.
int settime = 0; // time duration in millisconds
int startb = 2; // button to start the welding
int relay = 7; // the output relay
int ReadyLed = 8; // when this led is turned ON, it means you can start the welding
int Sflag = 0; // stops the unnecessary repition of code.
pinMode(timedata, INPUT); // POTENTIOMETER CONNECTED
lcd.init(); //Init the LCD
lcd.backlight(); //Activate backlight
timerawdata = analogRead(timedata);
settime = map(timerawdata, 0, 1024, 0, 4000); // 0 to 4000 milliseconds
if((digitalRead(startb) == LOW)&&(Sflag == 0)) // If you press the start button
Sflag = 1;
if (Sflag == 1)
Sflag = 0;
lcd.print("ON Time: ");
Arduino Spot Welding Machine Program Explanation:
Before, you start the programming, first of all, make sure you download all the necessary libraries.
Right now you can see the address is set to 0x27 this is for the real-world implementation, but when working on the simulation, change this address to 0x20, otherwise, the i2c 16×2 LCD in the Proteus simulation won’t display anything. So, this is really important, when compiling code for the simulation simply change this address to 0x20.
Rest of the code is pretty straightforward, I defined some variables which are well commented. Inside the setup() function, I set the pushbutton and the Potentiometer as the input, while the relay and the LED as the output using the pinMode() function. Finally, I activated the 16×2 LCD.
Inside the loop() function, we simply read the potentiometer and map its value from 0 to 4000. You can change this value if you need more time duration. Anyways, then we store this mapped value in variable settime, and then we simply pass this value into the delay function to control the ON time of the relay.
lcd.print("ON Time: ");
Finally, these instructions are used to print the text “ON Time:” and the time duration on the LCD.
Arduino Spot Welding Machine Test:
I successfully tested my Arduino-based spot welding machine, for the practical demonstration watch video tutorial given below. So, that’s all for now; If you have any questions, let me know in a comment.
Watch Video Tutorial: