Skip to content

Commit

Permalink
Minor change
Browse files Browse the repository at this point in the history
  • Loading branch information
mwreef committed Oct 25, 2017
1 parent 918f69e commit f806222
Show file tree
Hide file tree
Showing 5 changed files with 112 additions and 93 deletions.
8 changes: 4 additions & 4 deletions .project
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@
<link>
<name>core/core</name>
<type>2</type>
<locationURI>ECLIPSE_HOME/arduinoPlugin/packages/arduino/hardware/avr/1.6.19/cores/arduino</locationURI>
<locationURI>ECLIPSE_HOME/arduinoPlugin/packages/arduino/hardware/avr/1.6.20/cores/arduino</locationURI>
</link>
<link>
<name>core/variant</name>
<type>2</type>
<locationURI>ECLIPSE_HOME/arduinoPlugin/packages/arduino/hardware/avr/1.6.19/variants/eightanaloginputs</locationURI>
<locationURI>ECLIPSE_HOME/arduinoPlugin/packages/arduino/hardware/avr/1.6.20/variants/eightanaloginputs</locationURI>
</link>
<link>
<name>libraries/LiquidCrystal_I2C</name>
<type>2</type>
<locationURI>ECLIPSE_HOME/arduinoPlugin/libraries/LiquidCrystal_I2C/1.1.2</locationURI>
<location>C:/Users/renzo/git/LiquidCrystal_I2C</location>
</link>
<link>
<name>libraries/Thermistor_library</name>
Expand All @@ -54,7 +54,7 @@
<link>
<name>libraries/Wire</name>
<type>2</type>
<locationURI>ECLIPSE_HOME/arduinoPlugin/packages/arduino/hardware/avr/1.6.19/libraries/Wire</locationURI>
<locationURI>ECLIPSE_HOME/arduinoPlugin/packages/arduino/hardware/avr/1.6.20/libraries/Wire</locationURI>
</link>
</linkedResources>
</projectDescription>
16 changes: 8 additions & 8 deletions .settings/org.eclipse.cdt.core.prefs
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,10 @@ environment/project/io.sloeber.core.toolChain.release.214820771/A.EXTRA.TIME.DTS
environment/project/io.sloeber.core.toolChain.release.214820771/A.EXTRA.TIME.DTS/value=3600
environment/project/io.sloeber.core.toolChain.release.214820771/A.EXTRA.TIME.LOCAL/delimiter=;
environment/project/io.sloeber.core.toolChain.release.214820771/A.EXTRA.TIME.LOCAL/operation=replace
environment/project/io.sloeber.core.toolChain.release.214820771/A.EXTRA.TIME.LOCAL/value=1507934478
environment/project/io.sloeber.core.toolChain.release.214820771/A.EXTRA.TIME.LOCAL/value=1508945542
environment/project/io.sloeber.core.toolChain.release.214820771/A.EXTRA.TIME.UTC/delimiter=;
environment/project/io.sloeber.core.toolChain.release.214820771/A.EXTRA.TIME.UTC/operation=replace
environment/project/io.sloeber.core.toolChain.release.214820771/A.EXTRA.TIME.UTC/value=1507927278
environment/project/io.sloeber.core.toolChain.release.214820771/A.EXTRA.TIME.UTC/value=1508938342
environment/project/io.sloeber.core.toolChain.release.214820771/A.EXTRA.TIME.ZONE/delimiter=;
environment/project/io.sloeber.core.toolChain.release.214820771/A.EXTRA.TIME.ZONE/operation=replace
environment/project/io.sloeber.core.toolChain.release.214820771/A.EXTRA.TIME.ZONE/value=3600
Expand Down Expand Up @@ -313,7 +313,7 @@ environment/project/io.sloeber.core.toolChain.release.214820771/A.RUNTIME.IDE.VE
environment/project/io.sloeber.core.toolChain.release.214820771/A.RUNTIME.IDE.VERSION/value=10802
environment/project/io.sloeber.core.toolChain.release.214820771/A.RUNTIME.PLATFORM.PATH/delimiter=;
environment/project/io.sloeber.core.toolChain.release.214820771/A.RUNTIME.PLATFORM.PATH/operation=replace
environment/project/io.sloeber.core.toolChain.release.214820771/A.RUNTIME.PLATFORM.PATH/value=${eclipse_home}/arduinoPlugin/packages/arduino/hardware/avr/1.6.19
environment/project/io.sloeber.core.toolChain.release.214820771/A.RUNTIME.PLATFORM.PATH/value=${eclipse_home}/arduinoPlugin/packages/arduino/hardware/avr/1.6.20
environment/project/io.sloeber.core.toolChain.release.214820771/A.RUNTIME.TOOLS.ARDUINOOTA-1.1.1.PATH/delimiter=;
environment/project/io.sloeber.core.toolChain.release.214820771/A.RUNTIME.TOOLS.ARDUINOOTA-1.1.1.PATH/operation=replace
environment/project/io.sloeber.core.toolChain.release.214820771/A.RUNTIME.TOOLS.ARDUINOOTA-1.1.1.PATH/value=${eclipse_home}/arduinoPlugin/packages/arduino/tools/arduinoOTA/1.1.1
Expand Down Expand Up @@ -436,7 +436,7 @@ environment/project/io.sloeber.core.toolChain.release.214820771/A.TOOLS.AVRDUDE.
environment/project/io.sloeber.core.toolChain.release.214820771/A.TOOLS.AVRDUDE.UPLOAD.PARAMS.VERBOSE/value=-v
environment/project/io.sloeber.core.toolChain.release.214820771/A.TOOLS.AVRDUDE.UPLOAD.PATTERN/delimiter=;
environment/project/io.sloeber.core.toolChain.release.214820771/A.TOOLS.AVRDUDE.UPLOAD.PATTERN/operation=replace
environment/project/io.sloeber.core.toolChain.release.214820771/A.TOOLS.AVRDUDE.UPLOAD.PATTERN/value="${A.TOOLS.AVRDUDE.CMD.PATH}" "-C${A.TOOLS.AVRDUDE.CONFIG.PATH}" ${A.TOOLS.AVRDUDE.UPLOAD.VERBOSE} ${A.TOOLS.AVRDUDE.UPLOAD.VERIFY} -p${A.BUILD.MCU} -c${A.UPLOAD.PROTOCOL} -P${A.SERIAL.PORT} -b${A.UPLOAD.SPEED} -D "-Uflash\:w\:${A.BUILD.PATH}/${A.BUILD.PROJECT_NAME}.hex\:i"
environment/project/io.sloeber.core.toolChain.release.214820771/A.TOOLS.AVRDUDE.UPLOAD.PATTERN/value="${A.TOOLS.AVRDUDE.CMD.PATH}" "-C${A.TOOLS.AVRDUDE.CONFIG.PATH}" ${A.TOOLS.AVRDUDE.UPLOAD.VERBOSE} ${A.TOOLS.AVRDUDE.UPLOAD.VERIFY} -p${A.BUILD.MCU} -c${A.UPLOAD.PROTOCOL} "-P${A.SERIAL.PORT}" -b${A.UPLOAD.SPEED} -D "-Uflash\:w\:${A.BUILD.PATH}/${A.BUILD.PROJECT_NAME}.hex\:i"
environment/project/io.sloeber.core.toolChain.release.214820771/A.TOOLS.AVRDUDE.UPLOAD.VERIFY/delimiter=;
environment/project/io.sloeber.core.toolChain.release.214820771/A.TOOLS.AVRDUDE.UPLOAD.VERIFY/operation=replace
environment/project/io.sloeber.core.toolChain.release.214820771/A.TOOLS.AVRDUDE.UPLOAD.VERIFY/value=
Expand Down Expand Up @@ -472,13 +472,13 @@ environment/project/io.sloeber.core.toolChain.release.214820771/A.UPLOAD.TOOL/op
environment/project/io.sloeber.core.toolChain.release.214820771/A.UPLOAD.TOOL/value=avrdude
environment/project/io.sloeber.core.toolChain.release.214820771/A.VERSION/delimiter=;
environment/project/io.sloeber.core.toolChain.release.214820771/A.VERSION/operation=replace
environment/project/io.sloeber.core.toolChain.release.214820771/A.VERSION/value=1.6.19
environment/project/io.sloeber.core.toolChain.release.214820771/A.VERSION/value=1.6.20
environment/project/io.sloeber.core.toolChain.release.214820771/JANTJE.ARCHITECTURE_ID/delimiter=;
environment/project/io.sloeber.core.toolChain.release.214820771/JANTJE.ARCHITECTURE_ID/operation=replace
environment/project/io.sloeber.core.toolChain.release.214820771/JANTJE.ARCHITECTURE_ID/value=avr
environment/project/io.sloeber.core.toolChain.release.214820771/JANTJE.BOARDS_FILE/delimiter=;
environment/project/io.sloeber.core.toolChain.release.214820771/JANTJE.BOARDS_FILE/operation=replace
environment/project/io.sloeber.core.toolChain.release.214820771/JANTJE.BOARDS_FILE/value=${eclipse_home}/arduinoPlugin/packages/arduino/hardware/avr/1.6.19/boards.txt
environment/project/io.sloeber.core.toolChain.release.214820771/JANTJE.BOARDS_FILE/value=${eclipse_home}/arduinoPlugin/packages/arduino/hardware/avr/1.6.20/boards.txt
environment/project/io.sloeber.core.toolChain.release.214820771/JANTJE.BOARD_ID/delimiter=;
environment/project/io.sloeber.core.toolChain.release.214820771/JANTJE.BOARD_ID/operation=replace
environment/project/io.sloeber.core.toolChain.release.214820771/JANTJE.BOARD_ID/value=nano
Expand Down Expand Up @@ -517,13 +517,13 @@ environment/project/io.sloeber.core.toolChain.release.214820771/JANTJE.PACKAGE_I
environment/project/io.sloeber.core.toolChain.release.214820771/JANTJE.PACKAGE_ID/value=arduino
environment/project/io.sloeber.core.toolChain.release.214820771/JANTJE.PLATFORM_FILE/delimiter=;
environment/project/io.sloeber.core.toolChain.release.214820771/JANTJE.PLATFORM_FILE/operation=replace
environment/project/io.sloeber.core.toolChain.release.214820771/JANTJE.PLATFORM_FILE/value=${eclipse_home}/arduinoPlugin/packages/arduino/hardware/avr/1.6.19/platform.txt
environment/project/io.sloeber.core.toolChain.release.214820771/JANTJE.PLATFORM_FILE/value=${eclipse_home}/arduinoPlugin/packages/arduino/hardware/avr/1.6.20/platform.txt
environment/project/io.sloeber.core.toolChain.release.214820771/JANTJE.PROJECT_NAME/delimiter=;
environment/project/io.sloeber.core.toolChain.release.214820771/JANTJE.PROJECT_NAME/operation=replace
environment/project/io.sloeber.core.toolChain.release.214820771/JANTJE.PROJECT_NAME/value=
environment/project/io.sloeber.core.toolChain.release.214820771/JANTJE.SELECTED.PLATFORM/delimiter=;
environment/project/io.sloeber.core.toolChain.release.214820771/JANTJE.SELECTED.PLATFORM/operation=replace
environment/project/io.sloeber.core.toolChain.release.214820771/JANTJE.SELECTED.PLATFORM/value=${eclipse_home}/arduinoPlugin/packages/arduino/hardware/avr/1.6.19
environment/project/io.sloeber.core.toolChain.release.214820771/JANTJE.SELECTED.PLATFORM/value=${eclipse_home}/arduinoPlugin/packages/arduino/hardware/avr/1.6.20
environment/project/io.sloeber.core.toolChain.release.214820771/JANTJE.SIZE.SWITCH/delimiter=;
environment/project/io.sloeber.core.toolChain.release.214820771/JANTJE.SIZE.SWITCH/operation=replace
environment/project/io.sloeber.core.toolChain.release.214820771/JANTJE.SIZE.SWITCH/value=${A.RECIPE.SIZE.PATTERN}
Expand Down
121 changes: 70 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,65 +1,84 @@
# Battery Capacity Tester Arduino NANO #
Another Battery capacity tester.
Create from an idea of http://www.instructables.com/id/DIY-Arduino-Battery-Capacity-Tester-V10-/.
Another Battery capacity tester.
With this device you can check the 18650 battery capacity. For safe I added with thermistor the temperature of power resistance and battery to prevent explosion.
I'm doing some change from original project and now It's quite fine:
v01
- VCC of Arduino now It's automatically calculated;
- Voltage on screen now It's correct;
- Added variable to change setting in more confortable way.
- Added percentage of discharging
- Added temperature of battery and power resistor

In project you can find fritzing, schema, photo and other.

*I use generic character display, and I build the i2c controller and use It with my custom library, but if you want You can take a normal i2c controller (less than 1€) with standard library, the code remain the same.*
*All code of display is in draw function so you can change that without change other.*

Created from an idea of [OpenGreenEnergy](http://www.instructables.com/id/DIY-Arduino-Battery-Capacity-Tester-V10-/).

## Wire schema ##

![Breadboard schema](https://github.com/xreef/BatteryCapacityTesterArduinoNANO/blob/master/Resources/BTester_bb.png)
![Schema](https://github.com/xreef/BatteryCapacityTesterArduinoNANO/blob/master/Resources/BTester_schem.png)

## Assembly list ##
Label Part Type Properties
10K Trimmer potentiometer TRIMPOT package trimpot_pth_s3_lock_3386P; variant variant 2
18650 Battery lipo
2N2222 NPN-Transistor tipo NPN (EBC); package TO92 [THT]; part number 2N2222
Beeper Piezo Speaker
Display LCD screen tipo Character; pins 16
For battery Screw terminal - 2 pins package THT; hole size 1.0mm,0.508mm; pins 2; pin spacing 0.1in (2.54mm)
For power resistor Screw terminal - 2 pins package THT; hole size 1.0mm,0.508mm; pins 2; pin spacing 0.1in (2.54mm)
i2c controller PCF8574 tipo PCF8574; package DIP16 [THT]
IRF744N Basic FET N-Channel tipo n-channel; package TO220 [THT]
MF58 Temperature Sensor (Thermistor) tipo thermistor; package THT; resistance at 25° 10kΩ; thermistor type NTC
MF58 Temperature Sensor (Thermistor) tipo thermistor; package THT; resistance at 25° 10kΩ; thermistor type NTC
Microcontroller Arduino Pro Mini clone (compatible Nano) tipo Arduino Pro Mini (Clone comp Nano); variant variant 1
Power resistor 10kΩ Resistor
R1 10kΩ Resistor package THT; tolerance ±5%; resistenza 10kΩ; bands 4; pin spacing 400 mil
R2 10kΩ Resistor package THT; tolerance ±5%; resistenza 10kΩ; bands 4; pin spacing 400 mil
R3 10kΩ Resistor package THT; tolerance ±5%; resistenza 10kΩ; bands 4; pin spacing 400 mil
R4 10kΩ Resistor package THT; tolerance ±5%; resistenza 10kΩ; bands 4; pin spacing 400 mil
R10 10kΩ Resistor package THT; tolerance ±5%; resistenza 10kΩ; bands 4; pin spacing 400 mil
R11 10kΩ Resistor package THT; tolerance ±5%; resistenza 10kΩ; bands 4; pin spacing 400 mil

## Shopping List ##

Amount Part Type Properties
1 TRIMPOT package trimpot_pth_s3_lock_3386P; variant variant 2
1 LIPO 18650 variant
1 NPN-Transistor tipo NPN (EBC); package TO92 [THT]; part number 2N2222
1 Piezo Speaker
1 LCD screen tipo Character; pins 16
2 Screw terminal - 2 pins package THT; hole size 1.0mm,0.508mm; pins 2; pin spacing 0.1in (2.54mm)
1 PCF8574 tipo PCF8574; package DIP16 [THT]
1 Basic FET N-Channel tipo n-channel; package TO220 [THT]
2 Temperature Sensor (Thermistor) tipo thermistor; package THT; resistance at 25° 10kΩ; thermistor type NTC
1 Arduino Pro Mini clone (compatible Nano)tipo Arduino Pro Mini (Clone comp Nano); variant variant 1
1 10kΩ Resistor Power resistor
6 10kΩ Resistor package THT; tolerance ±5%; resistenza 10kΩ; bands 4; pin spacing 400 mil
| Label | Part Type | Properties |
| --- | --- | --- |
| **(LCD bb)** Display* | LCD screen | pins 16; tipo Character |
| **(LCD bb)** i2c controller* | PCF8574 | tipo PCF8574; package DIP16 [THT] |
| **(LCD bb)** 10K Trimmer potentiometer* | TRIMPOT | variant variant 2; package trimpot_pth_s3_lock_3386P |
| **(LCD bb)** 2N2222* | NPN-Transistor | tipo NPN (EBC); package TO92 [THT]; part number 2N2222 |
| 18650 Battery | LIPO-1000mAh | variant 1000mAh; package lipo-1000 |
| Beeper | Piezo Speaker |
| For battery | Screw terminal - 2 pins | pin spacing 0.1in (2.54mm); pins 2; hole size 1.0mm,0.508mm; package THT |
| For power resistor | Screw terminal - 2 pins | pin spacing 0.1in (2.54mm); pins 2; hole size 1.0mm,0.508mm; package THT |
| IRF744N | Basic FET N-Channel | tipo n-channel; package TO220 [THT] |
| MF58 | Temperature Sensor (Thermistor) | resistance at 25° 10kΩ; tipo thermistor; package THT; thermistor type NTC |
| MF58 | Temperature Sensor (Thermistor) | resistance at 25° 10kΩ; tipo thermistor; package THT; thermistor type NTC |
| Microcontroller | Arduino Pro Mini clone (compatible Nano) | variant variant 1; tipo Arduino Pro Mini (Clone comp Nano) |
| Power resistor | 10kΩ Resistor | pin spacing 400 mil; bands 5; resistenza 10kΩ; tolerance ±5%; package THT; part number Power resistor |
| Resistance of battery volt. 1/2 | 10kΩ Resistor | pin spacing 400 mil; bands 4; resistenza 10kΩ; tolerance ±5%; package THT |
| Resistance of battery volt. 2/2 | 10kΩ Resistor | pin spacing 400 mil; bands 4; resistenza 10kΩ; tolerance ±5%; package THT |
| Resistance of power res. volt. 1/2 | 10kΩ Resistor | pin spacing 400 mil; bands 4; resistenza 10kΩ; tolerance ±5%; package THT |
| Resistance of power res. volt. 2/2 | 10kΩ Resistor | pin spacing 400 mil; bands 4; resistenza 10kΩ; tolerance ±5%; package THT |
| Thermistor battery resistance | 10kΩ Resistor | pin spacing 400 mil; bands 4; resistenza 10kΩ; tolerance ±5%; package THT |
| Thermistor power res. resistance | 10kΩ Resistor | pin spacing 400 mil; bands 4; resistenza 10kΩ; tolerance ±5%; package THT |

## Shopping List

| Amount | Part Type | Properties |
| --- | --- | --- |
| 1* | LCD screen | pins 16; tipo Character |
| 1* | PCF8574 | tipo PCF8574; package DIP16 [THT] |
| 1* | TRIMPOT | variant variant 2; package trimpot_pth_s3_lock_3386P |
| 1* | NPN-Transistor | tipo NPN (EBC); package TO92 [THT]; part number 2N2222 |
| 1 | LIPO-1000mAh | variant 1000mAh; package lipo-1000 |
| 1 | Piezo Speaker |
| 2 | Screw terminal - 2 pins | pin spacing 0.1in (2.54mm); pins 2; hole size 1.0mm,0.508mm; package THT |
| 1 | Basic FET N-Channel | tipo n-channel; package TO220 [THT] |
| 2 | Temperature Sensor (Thermistor) | resistance at 25° 10kΩ; tipo thermistor; package THT; thermistor type NTC |
| 1 | Arduino Pro Mini clone (compatible Nano) | variant variant 1; tipo Arduino Pro Mini (Clone comp Nano) |
| 1 | 10kΩ Resistor | pin spacing 400 mil; bands 5; resistenza 10kΩ; tolerance ±5%; package THT; part number Power resistor |
| 6 | 10kΩ Resistor | pin spacing 400 mil; bands 4; resistenza 10kΩ; tolerance ±5%; package THT |

*\* Only if you want assembly LCD i2c character controller*

## Realization ##
To measuring voltage we use the principle of Voltage divider
https://en.wikipedia.org/wiki/Voltage_divider
https://startingelectronics.org/articles/arduino/measuring-voltage-with-arduino/
in simple word this code
batVolt = (sample1 / (1023.0 - ((batResValueGnd / (batResValueVolt + batResValueGnd)) * 1023.0))) * vcc;
that measure battery voltage is:
batResValueGnd / (batResValueVolt + batResValueGnd) --> this is the multipler factor of the reading voltage because I inserted 2 resistance of batResValueVolt and batResValueGnd ohom value after and before the analog read wire;
sample1 --> is the average analog readings;
vcc --> reference arduino voltage;
1023.0 --> is the reference maximun value of analog read (arduino analog read go from 0 to 1023)
To measuring voltage we use the principle of Voltage divider, more information on:
[Wikipedia](https://en.wikipedia.org/wiki/Voltage_divider) or [Blog](https://startingelectronics.org/articles/arduino/measuring-voltage-with-arduino/), in simple word this code
```cpp
batVolt = (sample1 / (1023.0 - ((batResValueGnd / (batResValueVolt + batResValueGnd)) * 1023.0))) * vcc;
```
measure battery voltage,
`batResValueGnd / (batResValueVolt + batResValueGnd)` this is the multipler factor of the reading voltage, I inserted 2 resistance of `batResValueVolt` and `batResValueGnd` ohom after and before the analog read wire;
`sample1 -->` is the average analog readings;
`vcc -->` reference arduino voltage;
`1023.0 -->` is the reference maximun value of analog read (arduino analog read go from 0 to 1023)

The principle is that we measure the voltage afther and before the power resistor and so we can calculate millihampere that consumes the battery.
The MOSFET is used to stard and stop battery drain from power resistor.
I'm pretty scary, so I inserted 2 thermistors to monitorage battery and power resistor temperature.
The principle is that we measure the voltage afther and before the power resistor and so we can calculate milliampere that consumes the battery.

The MOSFET is used to stard and stop battery drain from power resistor.
I'm pretty scary, so I inserted 2 thermistors to monitorage battery and power resistor temperature.

![Breadboard](https://github.com/xreef/BatteryCapacityTesterArduinoNANO/blob/master/Resources/breadboard01.jpg)
![lcd on discharging](https://github.com/xreef/BatteryCapacityTesterArduinoNANO/blob/master/Resources/lcdDischarging02.jpg)
Expand Down
Binary file modified Resources/BTester.fzz
Binary file not shown.
Loading

0 comments on commit f806222

Please sign in to comment.