Tell us about yourself!

Complete Your Profile
  • nikospax commented on deba168's instructable DIY Arduino Battery Capacity Tester - V1.0 10 hours ago
    DIY Arduino Battery Capacity Tester - V1.0

    #include <LiquidCrystal.h> /* The circuit:LCD Pinout * LCD RS pin to digital pin 12 * LCD Enable pin to digital pin 11 * LCD D4 pin to digital pin 5 * LCD D5 pin to digital pin 4 * LCD D6 pin to digital pin 3 * LCD D7 pin to digital pin 2 * LCD R/W pin to ground * 10K pot: * ends to +5V and ground * wiper to LCD VO pin (pin 3) */ #define Relay_Pin 6#define Bat_Pin A0#define Res_Pin A1#define Buzzer_Pin 9float Capacity = 0.0; // Capacity in mAhfloat Res_Value = 10.0; // Resistor Value in Ohmfloat Vcc = 4.53; // Voltage of Arduino 5V pin ( Mesured by Multimeter )float Current = 0.0; // Current in Ampfloat mA=0; // Current in mAfloat Bat_Volt = 0.0; // Battery Voltage float Res_Volt = 0.0; // Voltage at lower end of the Resistor float Bat_High = 4.3; // Battery High Voltagefloa...

    see more »

    #include <LiquidCrystal.h> /* The circuit:LCD Pinout * LCD RS pin to digital pin 12 * LCD Enable pin to digital pin 11 * LCD D4 pin to digital pin 5 * LCD D5 pin to digital pin 4 * LCD D6 pin to digital pin 3 * LCD D7 pin to digital pin 2 * LCD R/W pin to ground * 10K pot: * ends to +5V and ground * wiper to LCD VO pin (pin 3) */ #define Relay_Pin 6#define Bat_Pin A0#define Res_Pin A1#define Buzzer_Pin 9float Capacity = 0.0; // Capacity in mAhfloat Res_Value = 10.0; // Resistor Value in Ohmfloat Vcc = 4.53; // Voltage of Arduino 5V pin ( Mesured by Multimeter )float Current = 0.0; // Current in Ampfloat mA=0; // Current in mAfloat Bat_Volt = 0.0; // Battery Voltage float Res_Volt = 0.0; // Voltage at lower end of the Resistor float Bat_High = 4.3; // Battery High Voltagefloat Bat_Low = 2.9; // Discharge Cut Off Voltageunsigned long previousMillis = 0; // Previous time in msunsigned long millisPassed = 0; // Current time in msfloat sample1 =0;float sample2= 0;// initialize the library with the numbers of the interface pinsLiquidCrystal lcd(12, 11, 5, 4, 3, 2);void displayLCD(void) { if ( Bat_Volt < 1){ lcd.clear(); lcd.setCursor(0, 0); //set col,set row lcd.print("No Battery"); } else if ( Bat_Volt > Bat_High){ lcd.setCursor(0, 0); //set col,set row lcd.print("High Volt"); } else if(Bat_Volt < Bat_Low){ lcd.setCursor(14, 1); //set col,set row lcd.print("LV"); } else if(Bat_Volt >= Bat_Low && Bat_Volt < Bat_High ){ lcd.setCursor(4, 0); //set col,set row lcd.print("V "); lcd.setCursor(14, 0); //set col,set row lcd.print("mA"); lcd.setCursor(0, 1); //set col,set row lcd.print("mAh: "); lcd.setCursor(0, 0); //set col,set row lcd.print(Bat_Volt); lcd.setCursor(8, 0); //set col,set row lcd.print(mA); lcd.setCursor(6, 1); //set col,set row lcd.print(Capacity); }}//******************************Buzzer Beep Function ********************************************************* void beep(unsigned char delay_time){ analogWrite(Buzzer_Pin, 1); // PWM signal to generate beep toneold value was 20 delay(delay_time); // wait for a delayms ms analogWrite(Buzzer_Pin, 0); // 0 turns it off delay(delay_time); // wait for a delayms ms } //*******************************Setup Function *************************************************************** void setup() { Serial.begin(9600); pinMode(Relay_Pin, OUTPUT); pinMode(Buzzer_Pin, OUTPUT); digitalWrite(Relay_Pin, HIGH); // RELAY IS ACTIVE LOW, Serial.println("CLEARDATA"); Serial.println("LABEL,Time,Bat_Volt,capacity"); lcd.begin(16, 2); // set up the LCD's number of columns and rows: //Serial.println("Arduino Battery Capacity Tester v1.0"); //Serial.println("BattVolt Current mAh"); } //********************************Main Loop Function*********************************************************** void loop() { // Vcc = readVcc()/1000.0; // Conevrrt mV to Volt //************ Measuring Battery Voltage *********** // lcd.clear(); displayLCD(); //dispay stantard for(int i=0;i< 100;i++) { sample1=sample1+analogRead(Bat_Pin); //read the voltage from the battery delay (2); } sample1=sample1/100; Bat_Volt = 2*sample1 *Vcc/ 1024.0; // ********* Measuring Resistor Voltage *********** for(int i=0;i< 100;i++) { sample2=sample2+analogRead(Res_Pin); //read the voltage from Resistor delay (2); } sample2=sample2/100; Res_Volt = 2*sample2 * Vcc/ 1024.0; //********************* Checking the different conditions ************* int k=0; if ( Bat_Volt > Bat_High){ digitalWrite(Relay_Pin, HIGH); // Turned Off the MOSFET // No discharge beep(200); Serial.println( "Warning High-V! "); delay(1000); } else if(Bat_Volt < 1){ digitalWrite(Relay_Pin, HIGH); // beep(200); Serial.println( "No Battety "); k=1; delay(1000); } else if(Bat_Volt < Bat_Low and k==0){ digitalWrite(Relay_Pin, HIGH); beep(200); Serial.println( "Warning Low-V! "); delay(1000); } else if(Bat_Volt > Bat_Low && Bat_Volt < Bat_High ) { // Check if the battery voltage is within the safe limit digitalWrite(Relay_Pin, LOW); millisPassed = millis() - previousMillis; Current = (Bat_Volt - Res_Volt) / Res_Value; mA = Current * 1000.0 ; Capacity = Capacity + mA * (millisPassed / 3600000.0); // 1 Hour = 3600000ms previousMillis = millis(); Serial.print("DATA,TIME,"); Serial.print(Bat_Volt); Serial.print(","); Serial.println(Capacity); delay(4000); } }

    View Instructable »
  • nikospax made the instructable DIY Arduino Battery Capacity Tester - V1.0 3 months ago
    DIY Arduino Battery Capacity Tester - V1.0

    I use a LCD 16x2, a custom 10Ohm resistor and a 5v relay

    View Instructable »
  • nikospax commented on JuanF92's instructable DIY CNC for Less of 160€ With Arduino1 year ago
    DIY CNC for Less of 160€ With Arduino

    Hi, can't find the excel file with materials.You made a nice job!

    View Instructable »