* Z:\home\khalils\Downloads\files\data\raw_asc\07d5c7778427_MultiCellBatteryMeterSim.asc
* Generated by LTspice 26.0.1 for Windows.
* BATT_NEG is the Negative of the Battery. It is NOT the Cell 1 negative.
* +/- 4V
* 4V
* 0-8V => 0-3.3V
* 12V
* +/-40A
* 0-3.3V\n0-1.65V => Charing 20V - 0V\n1.65V => 3.3V Discharging 0V-20V
* 0-4V
* 0-3.3V
* Library below included based on ModelFile attribute of instance XU6 (C:\users\khalils\AppData\Local\LTspice\lib\sym\Switches\ADG5208.asy)
V6 Cell1_v 0 4V
R27 Mux3 N018 20k
V7 TRUE 0 3.3V
R36 0 N009 10k
RShunt1 N001 Vshunt 0.1 pwr=10W
V4 C3_P C2_P 4V
R19 N002 N003 20k
XU6 Vs+ TRUE 0 0 0 TRUE Cell1_v Mux2 Mux3 Mux4 N015 N014 N013 N012 N017 0 ADG5208 ;pnba Vdd)A0)A1)A2)Vss)EN)S1)S2)S3)S4)S5)S6)S7)S8)D)GND
R_load BATT_POS 0 100R
R40 N017 MUX_Out 20K
XU9 N005 N003 Vs+ Vs- N002 LM324/NS ;pnba In+)In-)V+)V-)OUT
R25 N018 C2_P 20K
R39 MUX_Out 0 94.25K
V3 C4_P C3_P 4V
R35 N009 Vs+ 20k
R23 Mux2 N020 20k
V2 Vs+ 0 12V
XU8 N006 N004 Vs+ Vs- ShuntOut LM324/NS ;pnba In+)In-)V+)V-)OUT
XU12 N019 N020 Vs+ 0 Mux2 LM324/NS ;pnba In+)In-)V+)V-)OUT
XU10 N016 N018 Vs+ 0 Mux3 LM324/NS ;pnba In+)In-)V+)V-)OUT
XU7 N009 N007 Vs+ Vs- N007 LM324/NS ;pnba In+)In-)V+)V-)OUT
R37 0 N006 20k
R24 N019 0 20k
R22 N019 C2_P 20K
XU11 N010 N011 Vs+ 0 Mux4 LM324/NS ;pnba In+)In-)V+)V-)OUT
R33 N004 N002 48.48K
R32 N010 0 20k
R31 Mux4 N011 20k
R26 N016 C3_P 20K
R29 N011 C3_P 20K
V5 C2_P Cell1_v 4V
R17 N003 N001 20K
R21 N020 Cell1_v 20K
R34 N006 N007 48.48K
R38 ShuntOut N004 20k
V8 N001 N008 {VSIM}
R1 N008 Vshunt 50R
V1 Vs- 0 -12V
R20 N005 0 20k
R18 N005 Vshunt 20K
R28 N016 0 20k
R30 N010 C4_P 20K
.include nat_semi.lib
.step param VSIM -2000 2000 200
.op
.lib ADG5208.sub
.backanno
.end

* LTspice schematic (.asc):
Version 4
SHEET 1 3916 1784
WIRE 1600 -448 1312 -448
WIRE 2032 -432 2000 -432
WIRE 1600 -384 1600 -448
WIRE 1744 -384 1600 -384
WIRE 1872 -384 1824 -384
WIRE 1920 -384 1920 -432
WIRE 1920 -384 1872 -384
WIRE 2768 -384 2640 -384
WIRE 2880 -384 2848 -384
WIRE 1312 -368 1312 -448
WIRE 1600 -368 1600 -384
WIRE 1872 -336 1872 -384
WIRE 1920 -336 1872 -336
WIRE 2032 -320 2032 -432
WIRE 2032 -320 1984 -320
WIRE 2512 -320 2032 -320
WIRE 2640 -320 2640 -384
WIRE 2640 -320 2592 -320
WIRE 2672 -320 2640 -320
WIRE 1920 -304 1872 -304
WIRE 2880 -304 2880 -384
WIRE 2880 -304 2736 -304
WIRE 2944 -304 2880 -304
WIRE 1744 -288 1712 -288
WIRE 1872 -288 1872 -304
WIRE 1872 -288 1824 -288
WIRE 2672 -288 2640 -288
WIRE 1600 -272 1600 -288
WIRE 1648 -272 1600 -272
WIRE 1712 -272 1712 -288
WIRE 1712 -272 1648 -272
WIRE 1952 -256 1952 -288
WIRE 2000 -256 1952 -256
WIRE 2544 -256 2512 -256
WIRE 2640 -256 2640 -288
WIRE 2640 -256 2624 -256
WIRE 2672 -256 2640 -256
WIRE 1872 -208 1872 -288
WIRE 1312 -192 1312 -288
WIRE 2000 -176 2000 -256
WIRE 3472 -112 3376 -112
WIRE 1872 -80 1872 -128
WIRE 2512 -80 2512 -256
WIRE 2512 -80 2432 -80
WIRE 2672 -80 2672 -256
WIRE 3376 -64 3376 -112
WIRE 1312 -32 1312 -112
WIRE 1600 -32 1600 -272
WIRE 1600 -32 1312 -32
WIRE 2512 -32 2512 -80
WIRE 3376 32 3376 16
WIRE 3488 32 3376 32
WIRE 3552 32 3488 32
WIRE 3376 48 3376 32
WIRE 2432 80 2432 -80
WIRE 2496 80 2496 32
WIRE 2496 80 2432 80
WIRE 3488 80 3488 32
WIRE 2528 96 2528 32
WIRE 2560 96 2528 96
WIRE 2672 96 2672 0
WIRE 2672 96 2640 96
WIRE 2528 144 2528 96
WIRE 3376 192 3376 128
WIRE 3472 192 3376 192
WIRE 2672 208 2672 96
WIRE 2528 256 2528 224
WIRE 3440 256 3376 256
WIRE 3376 304 3376 256
WIRE 2672 368 2544 368
WIRE 2784 368 2672 368
WIRE 1216 400 1168 400
WIRE 1600 400 1216 400
WIRE 2432 416 2272 416
WIRE 2784 416 2784 368
WIRE 3376 416 3376 384
WIRE 3440 416 3376 416
WIRE 1168 464 1168 400
WIRE 2272 464 2272 416
WIRE 2544 464 2544 368
WIRE 2672 464 2672 368
WIRE 2432 512 2432 416
WIRE 2432 512 2400 512
WIRE 2480 512 2432 512
WIRE 3568 544 3456 544
WIRE 1952 560 1920 560
WIRE 2048 560 2032 560
WIRE 2080 560 2048 560
WIRE 2432 576 2432 512
WIRE 2432 576 2400 576
WIRE 2480 576 2432 576
WIRE 2048 608 2048 560
WIRE 2048 608 2000 608
WIRE 3568 608 3568 544
WIRE 1168 624 1168 528
WIRE 1216 624 1168 624
WIRE 1408 624 1216 624
WIRE 1600 640 1600 400
WIRE 1792 640 1600 640
WIRE 1920 640 1920 560
WIRE 1920 640 1872 640
WIRE 2000 640 2000 608
WIRE 2432 640 2400 640
WIRE 2480 640 2432 640
WIRE 2784 640 2736 640
WIRE 2912 640 2784 640
WIRE 1920 656 1920 640
WIRE 1968 656 1920 656
WIRE 2080 672 2032 672
WIRE 2192 672 2080 672
WIRE 2272 672 2272 640
WIRE 2432 672 2432 640
WIRE 2432 672 2272 672
WIRE 1968 688 1920 688
WIRE 2480 704 2400 704
WIRE 1792 736 1744 736
WIRE 1920 736 1920 688
WIRE 1920 736 1872 736
WIRE 1968 736 1920 736
WIRE 1168 768 1168 624
WIRE 2480 768 2400 768
WIRE 3568 768 3568 688
WIRE 1968 784 1968 736
WIRE 2080 784 2080 672
WIRE 2080 784 2048 784
WIRE 2480 832 2400 832
WIRE 1408 864 1408 624
WIRE 1600 864 1408 864
WIRE 1744 864 1744 736
WIRE 1744 864 1600 864
WIRE 2480 896 2400 896
WIRE 1952 912 1920 912
WIRE 2048 912 2032 912
WIRE 2080 912 2048 912
WIRE 2864 928 2736 928
WIRE 2048 960 2048 912
WIRE 2048 960 2000 960
WIRE 2192 960 2192 672
WIRE 2480 960 2192 960
WIRE 2864 976 2864 928
WIRE 1744 992 1744 864
WIRE 1792 992 1744 992
WIRE 1920 992 1920 912
WIRE 1920 992 1872 992
WIRE 2000 992 2000 960
WIRE 1168 1008 1168 832
WIRE 1216 1008 1168 1008
WIRE 1408 1008 1216 1008
WIRE 1920 1008 1920 992
WIRE 1968 1008 1920 1008
WIRE 2080 1024 2032 1024
WIRE 2144 1024 2080 1024
WIRE 2480 1024 2144 1024
WIRE 1968 1040 1920 1040
WIRE 1792 1088 1744 1088
WIRE 1920 1088 1920 1040
WIRE 1920 1088 1872 1088
WIRE 1968 1088 1920 1088
WIRE 2480 1088 2192 1088
WIRE 2864 1088 2864 1056
WIRE 3104 1088 2864 1088
WIRE 1168 1104 1168 1008
WIRE 1968 1136 1968 1088
WIRE 2080 1136 2080 1024
WIRE 2080 1136 2048 1136
WIRE 2864 1136 2864 1088
WIRE 2480 1152 2208 1152
WIRE 1408 1248 1408 1008
WIRE 1600 1248 1408 1248
WIRE 1744 1248 1744 1088
WIRE 1744 1248 1600 1248
WIRE 1952 1264 1920 1264
WIRE 2048 1264 2032 1264
WIRE 2080 1264 2048 1264
WIRE 2608 1280 2608 1216
WIRE 2864 1280 2864 1216
WIRE 2048 1312 2048 1264
WIRE 2048 1312 2000 1312
WIRE 1168 1344 1168 1168
WIRE 1216 1344 1168 1344
WIRE 1408 1344 1216 1344
WIRE 1744 1344 1744 1248
WIRE 1792 1344 1744 1344
WIRE 1920 1344 1920 1264
WIRE 1920 1344 1872 1344
WIRE 2000 1344 2000 1312
WIRE 1920 1360 1920 1344
WIRE 1968 1360 1920 1360
WIRE 2080 1376 2032 1376
WIRE 2144 1376 2080 1376
WIRE 2192 1376 2192 1088
WIRE 2192 1376 2144 1376
WIRE 1968 1392 1920 1392
WIRE 1168 1440 1168 1344
WIRE 1792 1440 1744 1440
WIRE 1920 1440 1920 1392
WIRE 1920 1440 1872 1440
WIRE 1968 1440 1920 1440
WIRE 1968 1488 1968 1440
WIRE 2080 1488 2080 1376
WIRE 2080 1488 2048 1488
WIRE 1168 1584 1168 1504
WIRE 1248 1584 1168 1584
WIRE 1408 1584 1408 1344
WIRE 1600 1584 1408 1584
WIRE 1744 1584 1744 1440
WIRE 1744 1584 1600 1584
WIRE 2144 1584 1744 1584
WIRE 2208 1584 2208 1152
WIRE 2208 1584 2144 1584
WIRE 1168 1632 1168 1584
IOPIN 1952 -352 In
IOPIN 2000 1408 In
IOPIN 2000 1056 In
IOPIN 2000 704 In
IOPIN 1600 1584 In
IOPIN 1600 1248 In
IOPIN 1600 864 In
IOPIN 1600 640 In
IOPIN 2000 -176 In
IOPIN 2080 560 BiDir
IOPIN 2080 912 BiDir
IOPIN 2080 1264 BiDir
IOPIN 3104 1088 Out
IOPIN 2608 1280 In
IOPIN 2944 -304 Out
IOPIN 2672 208 BiDir
IOPIN 2528 256 In
IOPIN 2704 -272 In
IOPIN 2544 0 In
IOPIN 2704 -336 In
IOPIN 2480 0 In
IOPIN 2864 1280 BiDir
IOPIN 2400 640 In
IOPIN 2784 640 In
IOPIN 3552 32 BiDir
IOPIN 2400 576 In
IOPIN 2400 512 In
SYMBOL res 1296 -208 R0
SYMATTR InstName R1
SYMATTR Value 50R
SYMBOL res 2064 1152 M270
WINDOW 0 -27 86 VTop 2
WINDOW 3 2 16 VBottom 2
SYMATTR InstName R27
SYMATTR Value 20k
SYMBOL Opamps\\opamp2 2000 736 M180
SYMATTR InstName U11
SYMATTR Value LM324/NS
SYMBOL Opamps\\opamp2 1952 -384 R0
SYMATTR InstName U9
SYMATTR Value LM324/NS
SYMBOL res 2688 16 R180
WINDOW 0 36 76 Left 2
WINDOW 3 36 40 Left 2
SYMATTR InstName R37
SYMATTR Value 20k
SYMBOL Misc\\cell 1168 768 R0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V4
SYMATTR Value 4V
SYMBOL res 2880 960 M0
SYMATTR InstName R40
SYMATTR Value 20K
SYMBOL voltage 3376 144 M180
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
WINDOW 0 -50 16 Left 2
WINDOW 3 -76 89 Left 2
SYMATTR InstName V1
SYMATTR Value -12V
SYMBOL Misc\\cell 1168 1104 R0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V5
SYMATTR Value 4V
SYMBOL res 1888 752 M270
WINDOW 0 32 56 VTop 2
WINDOW 3 0 56 VBottom 2
SYMATTR InstName R29
SYMATTR Value 20K
SYMBOL res 2880 1120 M0
SYMATTR InstName R39
SYMATTR Value 94.25K
SYMBOL Opamps\\opamp2 2704 -368 R0
SYMATTR InstName U8
SYMATTR Value LM324/NS
SYMBOL res 1888 656 M270
WINDOW 0 32 56 VTop 2
WINDOW 3 0 56 VBottom 2
SYMATTR InstName R30
SYMATTR Value 20K
SYMBOL Opamps\\opamp2 2000 1440 M180
SYMATTR InstName U12
SYMATTR Value LM324/NS
SYMBOL res 1856 -224 R0
SYMATTR InstName R20
SYMATTR Value 20k
SYMBOL Misc\\cell 1168 464 R0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V3
SYMATTR Value 4V
SYMBOL Misc\\cell 1168 1440 R0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V6
SYMATTR Value 4V
SYMBOL voltage 3376 -80 M0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V2
SYMATTR Value 12V
SYMBOL res 2064 1504 M270
WINDOW 0 -28 95 VTop 2
WINDOW 3 0 26 VBottom 2
SYMATTR InstName R23
SYMATTR Value 20k
SYMBOL Switches\\ADG5208 2608 896 M180
SYMATTR InstName U6
SYMBOL res 2640 -272 R90
WINDOW 0 60 95 VBottom 2
WINDOW 3 33 14 VTop 2
SYMATTR InstName R34
SYMATTR Value 48.48K
SYMBOL res 1888 1456 M270
WINDOW 0 32 56 VTop 2
WINDOW 3 0 56 VBottom 2
SYMATTR InstName R21
SYMATTR Value 20K
SYMBOL res 2864 -400 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R38
SYMATTR Value 20k
SYMBOL res 2656 80 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R36
SYMATTR Value 10k
SYMBOL voltage 1312 -384 R0
SYMATTR InstName V8
SYMATTR Value {VSIM}
SYMBOL res 2064 800 M270
WINDOW 0 -25 79 VTop 2
WINDOW 3 3 26 VBottom 2
SYMATTR InstName R31
SYMATTR Value 20k
SYMBOL res 1888 1008 M270
WINDOW 0 32 56 VTop 2
WINDOW 3 0 56 VBottom 2
SYMATTR InstName R26
SYMATTR Value 20K
SYMBOL res 1584 -384 R0
SYMATTR InstName Shunt1
SYMATTR Value 0.1
SYMATTR SpiceLine pwr=10W
SYMBOL res 1936 544 M90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R32
SYMATTR Value 20k
SYMBOL res 2512 128 R0
SYMATTR InstName R35
SYMATTR Value 20k
SYMBOL res 1888 1104 M270
WINDOW 0 32 56 VTop 2
WINDOW 3 0 56 VBottom 2
SYMATTR InstName R25
SYMATTR Value 20K
SYMBOL res 1936 896 M90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R28
SYMATTR Value 20k
SYMBOL res 1840 -304 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R18
SYMATTR Value 20K
SYMBOL res 1840 -400 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R17
SYMATTR Value 20K
SYMBOL res 1936 1248 M90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R24
SYMATTR Value 20k
SYMBOL voltage 3568 592 R0
SYMATTR InstName V7
SYMATTR Value 3.3V
SYMBOL Opamps\\opamp2 2000 1088 M180
SYMATTR InstName U10
SYMATTR Value LM324/NS
SYMBOL res 1888 1360 M270
WINDOW 0 32 56 VTop 2
WINDOW 3 0 56 VBottom 2
SYMATTR InstName R22
SYMATTR Value 20K
SYMBOL res 2608 -336 R90
WINDOW 0 0 81 VBottom 2
WINDOW 3 -28 12 VTop 2
SYMATTR InstName R33
SYMATTR Value 48.48K
SYMBOL res 2016 -448 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 -28 6 VTop 2
SYMATTR InstName R19
SYMATTR Value 20k
SYMBOL Opamps\\opamp2 2448 0 R270
SYMATTR InstName U7
SYMATTR Value LM324/NS
SYMBOL res 3392 288 M0
SYMATTR InstName R_load
SYMATTR Value 100R
FLAG 3488 80 0
FLAG 3472 -112 Vs+
FLAG 1168 1632 0
FLAG 1216 1344 Cell1_v
FLAG 1216 1008 Cell2_v
FLAG 1216 624 Cell3_v
FLAG 1216 400 Cell4_v
FLAG 3440 416 BATT_NEG
FLAG 3440 256 BATT_POS
FLAG 1248 1584 Cell1_Neg
FLAG 3472 192 Vs-
FLAG 1952 -352 Vs+
FLAG 2000 1408 Vs+
FLAG 2000 1056 Vs+
FLAG 2000 704 Vs+
FLAG 1600 1584 C1_P
FLAG 1600 1248 C2_P
FLAG 1600 864 C3_P
FLAG 1600 640 C4_P
FLAG 2144 1376 Mux2
FLAG 2144 1024 Mux3
FLAG 2192 672 Mux4
FLAG 2144 1584 Mux1
FLAG 1648 -272 Vshunt
FLAG 2000 -176 Vs-
FLAG 2080 560 GND
FLAG 2080 912 GND
FLAG 2080 1264 GND
FLAG 3104 1088 MUX_Out
FLAG 2608 1280 Vs+
FLAG 2944 -304 ShuntOut
FLAG 2672 208 GND
FLAG 2528 256 Vs+
FLAG 2704 -272 Vs-
FLAG 2544 0 Vs-
FLAG 2704 -336 Vs+
FLAG 2480 0 Vs+
FLAG 2864 1280 GND
FLAG 2400 640 SEL0
FLAG 2784 640 EN
FLAG 3552 32 GND
FLAG 3568 768 0
FLAG 3456 544 TRUE
FLAG 2272 640 TRUE
FLAG 2912 640 TRUE
FLAG 2784 416 0
FLAG 1872 -80 0
FLAG 1168 1584 BATT_NEG
FLAG 2400 576 SEL1
FLAG 2400 512 SEL2
FLAG 2272 464 0
TEXT 3096 464 Left 2 ;BATT_NEG is the Negative of the Battery. It is NOT the Cell 1 negative.
TEXT 1400 1696 Right 2 !.include nat_semi.lib
TEXT 2064 -344 Left 2 ;+/- 4V
TEXT 2528 -160 Left 2 ;4V
TEXT 2672 -440 Left 2 ;0-8V => 0-3.3V
TEXT 2464 240 Left 2 ;12V
TEXT 1616 -240 Left 2 ;+/-40A
TEXT 2944 -416 Left 2 ;0-3.3V\n0-1.65V => Charing 20V - 0V\n1.65V => 3.3V Discharging 0V-20V
TEXT 2800 904 Left 2 ;0-4V
TEXT 2928 1072 Left 2 ;0-3.3V
TEXT 1168 1720 Left 2 !.step param VSIM -2000 2000 200\n.op