* Z:\home\khalils\Downloads\files\data\raw_asc\3b5e116bd716_AC_voltage_detect_with_frequency_detect.asc
* Generated by LTspice 26.0.1 for Windows.
* I decided that due to issues isolating the signal I will tie the ground to the main circuit ground thats being measured. Think in context of inverter or drive ground rail.
* TVS diodes not connected due to no value set but added for completeness
* 1 digital input\n1 ADC analog input
* Check in real circuit
* Library below included based on ModelFile attribute of instance XU1 (C:\users\khalils\AppData\Local\LTspice\lib\sym\Comparators\LT1716.asy)
;.ac lin 1
D2 N005 N007 RFU02VS6S
R6 N009 0 62k
R3 N002 0 95.3k
V2 N001 0 5v
C1 N006 0 470nF
D3 N010 0 D
V1 N005 0 SINE(0 400 50 0 0 0 1000)
R9 N004 N009 1k
XU1 N004 N002 N001 0 N003 LT1716 ;pnba In+)In-)V+)V-)OUT
C2 N002 0 100nF
D1 N005 N006 UPSC600
R1 N006 N002 7.5Meg
D5 NC_01 NC_02 UMZ5_1N
D4 N008 0 D
C3 N009 0 1nF
R7 N003 0 100k
R5 N007 N009 4.7Meg
.model D D
.lib C:\users\khalils\AppData\Local\LTspice\lib\cmp\standard.dio
.tran 0 1 0 0.1
.lib LT1716.sub
.backanno
.end

* LTspice schematic (.asc):
Version 4
SHEET 1 2460 680
WIRE 1888 -224 1664 -224
WIRE 1664 -192 1664 -224
WIRE 1888 -64 1888 -224
WIRE 1856 -48 1104 -48
WIRE 2080 -32 1920 -32
WIRE 1856 -16 1760 -16
WIRE 656 16 -64 16
WIRE 1360 16 656 16
WIRE 1760 32 1760 -16
WIRE 656 64 656 16
WIRE 1360 64 1360 16
WIRE -64 144 -64 16
WIRE 656 160 656 128
WIRE 928 160 656 160
WIRE 1664 160 1664 -112
WIRE 1872 160 1664 160
WIRE 1888 160 1888 0
WIRE 1888 160 1872 160
WIRE 1360 176 1360 128
WIRE 928 208 928 160
WIRE 656 224 656 160
WIRE 1344 288 1248 288
WIRE 1360 288 1360 256
WIRE 1648 288 1360 288
WIRE 1760 288 1760 112
WIRE 1760 288 1648 288
WIRE 928 320 928 288
WIRE 1024 320 928 320
WIRE 1104 320 1104 -48
WIRE 1104 320 1024 320
WIRE 784 336 784 176
WIRE 1360 336 1360 288
WIRE 1648 336 1648 288
WIRE 1760 336 1760 288
WIRE 2080 336 2080 -32
WIRE 1248 352 1248 288
WIRE 928 368 928 320
WIRE 1024 368 1024 320
WIRE -64 464 -64 224
WIRE 336 464 -64 464
WIRE 656 464 656 288
WIRE 656 464 336 464
WIRE 784 464 784 400
WIRE 784 464 656 464
WIRE 928 464 928 448
WIRE 928 464 784 464
WIRE 1024 464 1024 432
WIRE 1024 464 928 464
WIRE 1248 464 1248 416
WIRE 1248 464 1024 464
WIRE 1360 464 1360 416
WIRE 1360 464 1248 464
WIRE 1648 464 1648 400
WIRE 1648 464 1360 464
WIRE 1760 464 1760 400
WIRE 1760 464 1648 464
WIRE 2080 464 2080 416
WIRE 2080 464 1760 464
SYMBOL voltage -64 128 R0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V1
SYMATTR Value SINE(0 400 50 0 0 0 1000)
SYMBOL res 1344 160 R0
SYMATTR InstName R5
SYMATTR Value 4.7Meg
SYMBOL Comparators\\LT1716 1888 -32 R0
SYMATTR InstName U1
SYMBOL res 912 192 R0
SYMATTR InstName R1
SYMATTR Value 7.5Meg
SYMBOL res 912 352 R0
SYMATTR InstName R3
SYMATTR Value 95.3k
SYMBOL schottky 640 64 R0
SYMATTR InstName D1
SYMATTR Value UPSC600
SYMATTR Description Diode
SYMATTR Type diode
SYMBOL res 1344 320 R0
SYMATTR InstName R6
SYMATTR Value 62k
SYMBOL diode 1344 64 R0
SYMATTR InstName D2
SYMATTR Value RFU02VS6S
SYMBOL cap 1008 368 R0
SYMATTR InstName C2
SYMATTR Value 100nF
SYMBOL zener 1792 400 R180
WINDOW 0 24 64 Left 2
WINDOW 3 24 0 Left 2
SYMATTR InstName D5
SYMATTR Value UMZ5_1N
SYMBOL voltage 1664 -208 R0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V2
SYMATTR Value 5v
SYMBOL cap 640 224 R0
SYMATTR InstName C1
SYMATTR Value 470nF
SYMBOL TVSdiode 768 336 R0
SYMATTR InstName D3
SYMBOL res 2064 320 R0
SYMATTR InstName R7
SYMATTR Value 100k
SYMBOL res 1744 16 R0
SYMATTR InstName R9
SYMATTR Value 1k
SYMBOL TVSdiode 1232 352 R0
SYMATTR InstName D4
SYMBOL cap 1632 336 R0
SYMATTR InstName C3
SYMATTR Value 1nF
FLAG 336 464 0
FLAG 1872 160 0
TEXT -96 488 Left 2 !;.ac lin 1\n.tran 0 1 0 0.1
TEXT 16 616 Left 2 ;I decided that due to issues isolating the signal I will tie the ground to the main circuit ground thats being measured. Think in context of inverter or drive ground rail.
TEXT 912 512 Left 2 ;TVS diodes not connected due to no value set but added for completeness
TEXT 2088 144 Left 2 ;1 digital input\n1 ADC analog input
TEXT 1728 368 Left 2 ;Check in real circuit