Avatar
BATTERY PORTABLE SOLDERING IRON
Aug 17th, 2021 | by: ELECTRONOOBS | Views 436
Views 436

Finally I've made a working battery based portable soldering iron. This one can melt solder in under 10 seconds, which is amazing. The soldering iron weighs just above 100 grams, is comfortable to use, it can reach more than 300 degrees, it's very fast, we can recharge it with a USB connector since we have a protection IC inside on the PCB and on the screen, we can see the battery level, the internal resistance of the iron tip and we can set the heating time and maximum power. On the PCB we have a current sensor so we can measure the current and with that the power, we have an amplifier to measure the low resistance of the tip, and we have a MOSFET to control the power that is going to the tip.

Part 1 - What we need?

So for the components we need, of course the PCB which in my case, I’ve made it with PCBWAY. The MOSFET, the ATmega328 microcontroller together with the crystal oscillator, the SMD resistors and capacitors which are all in a 0603 package, the small SMD buzzer, some LEDs, the USB connector, the LM358 amplifier, the small OLED screen and the AMS712 current sensor. Along these components we also need some clips for the battery connection for positive and negative. The entire package cost me just 1 dollar. As for the tip, I’ve ordered a few which are marked as 15W. And to add the iron tip, we need a screw socket which also cost me just a few cents. Like this we can screw or unscrew the tip whenever we want.

 

Part List
Part 2 - Schematic

The schematic is this one below. To control the power output, we use the MOSFET. This could work up to 6 amps at 20V. Is not really necessary since the supply voltage is the same as the gate voltage, but I’ve also use a small BJT as a gate driver. Then we have the charging module connected to the USB connector and on the other side to the battery and this will give us VCC value. As you have seen on the screen, we also measure the resistance of the iron tip. To do that, we use a voltage divider between the tip resistance and the R8 resistor and since the output voltage is so low, we use an operational amplifier to amplify that voltage and read it with the Arduino ADC. Below we have the current sensor, the ACS712. The PCB also has the UART pads so we could program the microcontroller and also the pads connections for the small OLED display.

Schematic
Part 3 - The PCB

Get the GERBER files from below and maybe also consider supporting my work. Then go to PCBWAY.com for example. There we quote now, and add the settings such as thickness, color of the solder-mask, amount of PCBs and so on, and then we save to cart and finally we upload the GERBER files. 10 PCBs will cost you only 5 dollars plus shipping. Once we make the payment, we receive the PCBs from PCBWAY in just a couple of days. Then I make a quick inspection, I can say that the PCBs quality is great so we can continue with assembling the PCB.

PCB Design
Part 4 -The 3D Case

Is time to add the case. You have the design for download on the link below. I’ve printed the case with PLA material, 2 perimeters and 20% infill and without supports. The case is made in such a way that it will keep the battery pads in place. Once I’ve made sure the PCB fits inside together with the battery, I’ve sand paper it a little bit to be smoother and also painted it black with some spray paint. I also add some details with a different color to make it look better.

Making the case
Part 5.1 - Add solder Paste

Let's solder the components. You can do this one by one, or do as I did, and use the SMD stencil, solder paste and reflow all the components at once using my homemade reflow hot plate. To make it fast and easier, I’ve took my ATMega238 microcontroller from an old Arduino NANO, in this way it already has a bootloader and I know that it works. Prepare all the components on the side before you apply the paste. Now I add some other PCBs around using scotch tape so my PCB will stay fixed in place. Then I put the SMD stencil on top to be aligned with the pads. I add some paste and using a spatula I fill all the holes. Now, all pads have some paste.

Adding components
Part 5.2 - Add components and Reflow

One by one, I now add all the components using some tweezers. This is a slow process but is faster than soldering the components one by one. All components are in place. I get my homemade reflow station and turn it on. I place the PCB on top and reflow the components. SHOW. And there you go. All components are soldered in their place. Once you have the PCB, connect an external FTDI programmer to the UART pads and upload a test code to make sure that it works. In my case I always upload a counter and open the serial monitor. If you get the numbers, then the microcontroller works.

Reflow
Part 5.3 - Final Assemble

Now we can upload the soldering iron code that you could find below on the next chapter if you want to use it. Compile and upload the code to the PCB. Now we pass the screw terminal though the hole and tight the nut on the other side. The case is made in such a way that it should fit perfectly. Now solder the wires back to the PCB and fix the board in place. Check if the USB connector could be inserted and charge the battery. If yes, we add these tiny buttons to the top case and close it. To close it we use some small screws and that’s it. My homemade portable and battery based soldering iron is complete.

Final product
Part 6 - Code

Get the code from below and maybe consider supporting my work as well. You will aslo need the library for the OLED screen so download taht as well and go to sketch, include library adn add .zip library and there select the zip file you have just downloaded. Compile, connect the FTDI mdoule to the PCB and uplaod the code. Read the comments in the code for more.

 

Downlaod Library: http://electronoobs.com/eng_arduino_Adafruit_GFX.php

Downlaod Library: http://electronoobs.com/eng_arduino_Adafruit_SSD1306.php


/* Battery portable soldering iron by Andrei Gabriel from ELECTRONOOBS
 * Tutorial: http://electronoobs.com/eng_arduino_tut157.php
 * Schematic: http://electronoobs.com/eng_arduino_tut157_sch1.php
*/

//Variables
bool SW1_state = true;
bool SW2_state = true;
bool SW3_state = true;
float ON_counter = 0;
float min_ON_time =  2.0;
float max_ON_time =  15.0;
unsigned long previousMillis,currentMillis, sleepMillis;  
int refresh_rate = 100;
bool after_hot = false;
float on_time = 10;
float max_power = 20;
float min_power = 5;
float pid_power = 10;
bool no_tip = false;
bool after_hot_beep = false;
int PWM_value = 30;
bool sleepMode = false;
int sleep_time = 10000; //in ms

unsigned long SW2_UP_counter, SW2_DOWN_counter, SW2_counter, SW3_UP_counter, SW3_DOWN_counter, SW3_counter; 
bool change_time = false;
bool change_power = false;


static const unsigned char PROGMEM  battery_1[] =

B00111100, 
B10000001, 
B10000001, 
B10000001, 
B10000001, 
B10000001,
B10000001, 
B10000001,
B10000001, 
B10000001, 
B10000001,
B10000001, 
B10111101, 
B10111101,
B10000001, 
B11111111
};


static const unsigned char PROGMEM  nulo[] =

B00000000,B00111100,B00000000, 
B00000001,B11000011,B10000000, 
B00000010,B00000000,B01000000, 
B00001100,B00000000,B00110000, 
B00001000,B00000000,B00010000, 
B00110000,B00000000,B00111100, 
B00100000,B00000000,B01100100, 
B01000000,B00000000,B11000010,
B01000000,B00000001,B10000010, 
B01000000,B00000011,B00000010, 
B10000000,B00000110,B00000001, 
B10000000,B00001100,B00000001, 
B10000000,B00011000,B00000001, 
B10000000,B00110000,B00000001, 
B01000000,B01100000,B00000010,
B01000000,B11000000,B00000010, 
B01000001,B10000000,B00000010, 
B00100011,B00000000,B00000100, 
B00110110,B00000000,B00001100,  
B00001100,B00000000,B00010000,  
B00001100,B00000000,B00110000, 
B00000010,B00000000,B01000000,  
B00000001,B11000011,B10000000, 
B00000000,B00111100,B00000000
};


static const unsigned char PROGMEM  hot_iron[] =

B00000000,B00000000,B00100100,  
B00000000,B00000000,B01001001,
B00000000,B00000000,B01010010,
B00000000,B00000000,B10010100,
B00000000,B00000000,B10101000,
B11111111,B11111100,B00000000,
B11111111,B11111111,B11111000,
B11111111,B11111100,B00000000
};

static const unsigned char PROGMEM  exclamation[] =

B00000000,
B00111100,
B00111100,
B00111100,
B00111100,
B00111100,
B00111100,
B00111100,
B00111100,
B00111100,
B00111100,
B00111100,
B00111100,
B00111100,
B00111100,
B00111100,
B00111100,
B00111100,
B00111100,
B00111100,
B00111100,
B00111100,
B00111100,
B00111100,
B00000000,
B00000000,
B00000000,
B00111100,
B00111100,
B00111100,
B00000000,
B00000000,
};


static const unsigned char PROGMEM  battery_2[] =

B00011111, B11111000,
B00011111, B11111000,
B11111111, B11111111,
B11111111, B11111111,
B11000000, B00000011,
B11000000, B00000011,
B11000000, B00000011,
B11000000, B00000011,
B11000000, B00000011,
B11000000, B00000011,
B11000000, B00000011,
B11000000, B00000011,
B11000000, B00000011,
B11000000, B00000011,
B11000000, B00000011,
B11000000, B00000011,
B11000000, B00000011,
B11001111, B11110011,
B11001111, B11110011,
B11001111, B11110011,
B11000000, B00000011,
B11000000, B00000011,
B11001111, B11110011,
B11001111, B11110011,
B11001111, B11110011,
B11000000, B00000011,
B11000000, B00000011,
B11111111, B11111111,
B11111111, B11111111
};

static const unsigned char PROGMEM  ohm[] =

B01110000,
B10001000,
B10001000,
B10001000,
B01010000,
B01010000,
B11001100
};

#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>         //download here: https://www.electronoobs.com/eng_arduino_Adafruit_GFX.php
#include <Adafruit_SSD1306.h>     //downlaod here: https://www.electronoobs.com/eng_arduino_Adafruit_SSD1306.php
#define OLED_RESET 2
Adafruit_SSD1306 display(OLED_RESET);

//Inputs/Outputs
#define MOSFET 3
#define BUZZER 5
#define RES_DIVIDER 4
#define BAT_IN A0
#define ACS_IN A2
#define LM358_1 A1
#define LM358_2 A3
#define SW1 8
#define SW2 10
#define SW3 9

void setup() { 
  pinMode(MOSFET, OUTPUT);
  digitalWrite(MOSFET, LOW);

  TCCR2B = TCCR2B & B11111000 | B00000001;    // pin 3 and 11 PWM frequency of 31372.55 Hz
  
  pinMode(BUZZER, OUTPUT);
  digitalWrite(BUZZER, LOW);
  pinMode(RES_DIVIDER, OUTPUT);
  digitalWrite(RES_DIVIDER, LOW);
  
  pinMode(SW1, INPUT_PULLUP);
  pinMode(SW2, INPUT_PULLUP);
  pinMode(SW3, INPUT_PULLUP);  
  digitalWrite(BAT_IN, INPUT);
  digitalWrite(ACS_IN, INPUT);
  digitalWrite(LM358_1, INPUT);
  digitalWrite(LM358_2, INPUT);
  
  
  Serial.begin(9600); 
  analogReference(INTERNAL); 
  
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);  // initialize with the I2C addr 0x3C (for the 128x32 or 64 from eBay)
  delay(100);
  display.clearDisplay();
  display.setTextSize(1); 
  display.setTextColor(WHITE);
  display.setCursor(15,6);
  display.print("ELECTRONOOBS"); 
  display.setCursor(15,14); 
  display.setTextSize(2); 
  display.print("IRON V1.0");   
  display.display();
  delay(1000);

  
  currentMillis = millis();
  previousMillis = currentMillis;
  sleepMillis = currentMillis;
}

void loop() {
  
  
  currentMillis = millis();
  if(!sleepMode){
    if(currentMillis - previousMillis > refresh_rate){
      previousMillis = currentMillis;
      
      
      if(!digitalRead(SW1) && !no_tip){
        SW1_state = false;       
        sleepMillis = millis();   
        if( (ON_counter < on_time) && !after_hot){
          ON_counter = ON_counter + 0.1;
          
          
         
          analogReference(INTERNAL); 
          float battery_val = analogRead(BAT_IN)*(5.18/1024.0); //5.18 = 1.1 x 4.709 (voltage divider)     
          analogReference(DEFAULT);     
          float ACS712_voltage = analogRead(ACS_IN)*(battery_val/1024.0); //1.1 x 4.4         
          float ACS712_current =(ACS712_voltage- ((battery_val/2)+0.42))/0.1; //is not 2.5 but 2.89 after tests
          float power = battery_val * ACS712_current;
  
  
          if(power > pid_power){
            PWM_value --;
          }
          else{
            PWM_value ++;
          }
          analogWrite(MOSFET, PWM_value);
          
          display.clearDisplay();  
          display.drawBitmap(0, 3,  exclamation, 8, 32, 1);
                    
          display.setTextSize(3);
          display.setCursor(13,7); 
          display.print(ON_counter,1);
          display.setTextSize(1); 
          display.print("s");
  
          display.setTextSize(2); 
          display.setCursor(92,6);  
          display.print(power,0);        
          display.setTextSize(1);
          display.print("W"); 
  
          display.setTextSize(1);     
          display.setCursor(92,24);  
          display.print(battery_val,1);
          display.println("V");
     
          display.display();
          
        }
        else {        
          digitalWrite(MOSFET, LOW);
          after_hot = true;
          if(!after_hot_beep){
            analogWrite(BUZZER, 200);
            delay(100);
            after_hot_beep = true;
            analogWrite(BUZZER, LOW);
          }
          display.clearDisplay();
          display.drawBitmap(5, 3,  exclamation, 8, 32, 1);
          display.setTextSize(2);
          display.setCursor(20,11);
          display.print("Over ");
          display.print(on_time,0);
          display.print("s");
          display.display();        
        }
            
      }
      else if(digitalRead(SW1)){
        digitalWrite(MOSFET, LOW);
        delay(2);
        after_hot = false;
        after_hot_beep = false;
        ON_counter = 0;
        analogReference(INTERNAL); 
        float battery_val = analogRead(BAT_IN)*(5.18/1024.0); 
      
        digitalWrite(RES_DIVIDER, HIGH);
        delay(10);
        float LM358_2_out = analogRead(LM358_2)*(1.1/1024.0);
        digitalWrite(RES_DIVIDER, LOW);
        
        display.clearDisplay();
        display.setTextSize(1);        
        
        if(LM358_2_out < 1){
          no_tip = false;
          LM358_2_out = LM358_2_out/30.4;
          float res = 150/((battery_val/LM358_2_out)-1);
          
          display.drawBitmap(0, 3,  battery_2, 16, 29, 1);        
          
          display.setCursor(18,9);
          display.print(battery_val,2);
          display.print("v");  
          if(change_time && !change_power){
            display.setTextSize(2);            
            display.setCursor(65,1);         
            display.print(on_time,1);           
            display.print("s");
            
            display.setCursor(70,17);                     
            display.print("TIME");
          }
          else if(!change_time && change_power){
            display.setTextSize(2);  
            display.setCursor(74,1);                      
            display.print("PWR");
                        
            display.setCursor(65,17); 
            display.print(pid_power,1);           
            display.print("w");
          }
  
          else if(!change_time && !change_power){
            display.setTextSize(2);  
            display.setCursor(65,1);         
            display.print(on_time,1);           
            display.print("s");
            display.setTextSize(2);            
            display.setCursor(65,17); 
            display.print(pid_power,1);           
            display.print("w");
          }        
                         
          display.setTextSize(1); 
          display.setCursor(18,17);
          display.print(res,2);     
          display.drawBitmap(42, 17,  ohm, 5, 7, 1);
  
          
        }
        else{
          display.drawBitmap(0, 3,  battery_2, 16, 29, 1);        
          no_tip = true;        
          display.setCursor(17,9);
          display.print(battery_val,2);
          display.println("v");  
  
          display.setTextSize(2);            
          display.setCursor(17,17);
          display.print("No Tip");  
  
          display.drawBitmap(97, 7,  nulo, 24, 24, 1); 
          
        }             
        display.display();
      }
  
  
      if(!digitalRead(SW2) && SW2_state){
        SW2_state = false;
        SW2_UP_counter = millis();
      }   
  
      if(!digitalRead(SW2) && !SW2_state){      
        SW2_counter = millis();
        if(SW2_counter - SW2_UP_counter > 1000){
          change_time = true;
        }
        if(change_time){
          on_time = on_time + 0.1;
          if(on_time > max_ON_time){
            on_time = min_ON_time;
          }
        }
      } 
      
      if(digitalRead(SW2) && !SW2_state){
        SW2_state = true;  
        SW2_UP_counter = millis();      
      }
      else if(digitalRead(SW2) && SW2_state){
        SW2_counter = millis();
        if(SW2_counter - SW2_UP_counter > 2000){
          change_time = false;
        }
      }
      
     
          
      
      
  
  
      if(!digitalRead(SW3) && SW3_state){
        SW3_state = false;
        SW3_UP_counter = millis();
      }   
  
      if(!digitalRead(SW3) && !SW3_state){      
        SW3_counter = millis();
        if(SW3_counter - SW3_UP_counter > 1000){
          change_power = true;
        }
        if(change_power){
          pid_power = pid_power - 0.1;
          if(pid_power < min_power){
            pid_power = max_power;
          }
        }
      } 
      
      if(digitalRead(SW3) && !SW3_state){
        SW3_state = true;  
        SW3_UP_counter = millis();      
      }
      else if(digitalRead(SW3) && SW3_state){
        SW3_counter = millis();
        if(SW3_counter - SW3_UP_counter > 2000){
          change_power = false;
        }
      }
  
      
    }//end of refresh rate
  }//end of !sleepMode

  else{
    if(!digitalRead(SW1)){
      sleepMode = false;
      sleepMillis = millis();
    }    
    display.clearDisplay();    
    display.display(); 
    analogWrite(MOSFET, LOW);  
  }
  if((currentMillis - sleepMillis > sleep_time) && !sleepMode){
    sleepMode = true;  
    analogWrite(BUZZER, 200);
    display.clearDisplay();    
    display.setTextSize(2);
    display.setCursor(40,11);
    display.print("SLEEP");    
    display.display(); 
    delay(400);
    digitalWrite(BUZZER, LOW); 
    delay(600);
   }

  
  

  

}


Part 7 - Test

I get my thermocouple thermometer. I place the tip on top and press the button for 10 seconds. And look, it reached over 300 degrees in only 11 seconds. I think the power is enough and this tool should be more than useful when I work outside my workshop. In a different test, as you can see the tip was cold and I could touch it with my fingers. I press the button and as you can see in less than 8 seconds, we can melt solder. Pretty nice right? Remember that this PCB still has a problem, we have to always remove the battery when we finish working so I’ll have to fix that for the future version. There is no ON adn Off swithc, so the battery is always connected so even if we turn off the screen in sleep mode, the battery will still discharge slowly over time...

Part 9 - See full Video

The iron is small, very comfortable to use, it weighs just a few grams, is very easy to change the tip shape since we have all sort of tips on the market. The battery is rechargeable with a USB connector and 5V adaptor that we all have. The firmware is simple but could be improve a lot with multiple modes and more features. I’m studying a way of also measuring the temperature so stay tuned for more. I hope that you like this project and maybe make one yourself as well. If my videos help you, consider supporting my work on my PATREON or a donation on my PayPal. Thanks again and see you later guys.

0 Comments

Login or Sign Up to post comments on this tutorial.