I am using a 2000:1 coil around one leg of an AC main to simply detect the presence of current or not.
The coil leads are across a simple half wave rectifier (1n4148) with a 100 ohm resistor. I have a ESP32 as the test controller with code that reads A0 and prints the value every second. My scope reads 4.2v across A0 and ground.
The readings stay above 0 and will count up to 4095 and stay there for 20 or more ticks and then start slowly dropping to 0. It will stay at 0 for several counts then start counting up to 4095. The scope wave and voltage does not waver. What is going on that I'm not getting?
All I want to do is detect a value greater than 0 to determine current is on the main with a non-intrusive coil.
Thanks for the thoughts.
20:21:36.278 -> sensor = 0
20:21:37.305 -> sensor = 0
20:21:38.287 -> sensor = 0
20:21:39.298 -> sensor = 160
20:21:40.284 -> sensor = 416
20:21:41.317 -> sensor = 720
20:21:42.302 -> sensor = 944
20:21:43.287 -> sensor = 1149
20:21:44.271 -> sensor = 1264
20:21:45.302 -> sensor = 1476
20:21:46.284 -> sensor = 1633
20:21:47.314 -> sensor = 1742
20:21:48.293 -> sensor = 1884
20:21:49.273 -> sensor = 2031
20:21:50.300 -> sensor = 2163
20:21:51.285 -> sensor = 2303
20:21:52.318 -> sensor = 2409
20:21:53.302 -> sensor = 2518
20:21:54.285 -> sensor = 2655
20:21:55.318 -> sensor = 2761
20:21:56.293 -> sensor = 2879
20:21:57.278 -> sensor = 2991
20:21:58.313 -> sensor = 3115
20:21:59.302 -> sensor = 3219
20:22:00.285 -> sensor = 3303
20:22:01.318 -> sensor = 3423
20:22:02.300 -> sensor = 3503
20:22:03.281 -> sensor = 3568
20:22:04.313 -> sensor = 3691
20:22:05.300 -> sensor = 3711
20:22:06.303 -> sensor = 3827
20:22:07.292 -> sensor = 3835
20:22:08.317 -> sensor = 3951
20:22:09.301 -> sensor = 4011
20:22:10.284 -> sensor = 4063
20:22:11.311 -> sensor = 4095
20:22:12.294 -> sensor = 4095
Stayed at 4095 for 20 sec
20:23:20.286 -> sensor = 4095
20:23:21.270 -> sensor = 4095
20:23:22.301 -> sensor = 4095
20:23:23.287 -> sensor = 4095
20:23:24.315 -> sensor = 3409
20:23:25.298 -> sensor = 2733
20:23:26.280 -> sensor = 2275
20:23:27.312 -> sensor = 1776
20:23:28.299 -> sensor = 1328
20:23:29.283 -> sensor = 918
20:23:30.314 -> sensor = 578
20:23:31.298 -> sensor = 244
20:23:32.281 -> sensor = 2
20:23:33.310 -> sensor = 0
20:23:34.293 -> sensor = 0


