datalogging AC voltage

I have some LED lights that flicker from time to time.
the other lights around them are not flickering.

The manufacture does not want to swap out saying there is about $1,500 in parts
and they are going off on some odd possibilities of voltage drops when the HVAC turns on,

I can monitor the voltage, but need to data log the readings.
SD card would be preferred for huge data files
SPIFFS on an ESP for small files.

To continuously data log the 60 Hz (USA) on a single phase would use a lot of storage.

Any suggestions on the best approach to monitor and data log ?

I would try to only log the moments it’s unusual, saves a lot of space on storage, and saves a lot of digging through by and large perfectly normal data later.

Record a single period (so 1/60th second), sampling at 6 ksps for 100 samples per period, starting at the zero crossing. Compare that wave with the expected waveform. If the wave is unusual (e.g. peak voltage <10% below expected) log the data & time it happened as data point: e.g. the rms voltage measured. Or maybe start by logging the complete wave (all 100 samples) with a time stamp of when this wave started, maybe the dips (or peaks?) are shorter than 1/60th of a second.

6ksps would be about 12 kB/s, about 1 GB per day of continuous logging.

I do doubt an ESP8266 is the proper MCU for this, as you want continuous high speed high precision timing of your sampling. That’s not excactly the strong point of that processor… on the contrary, even. I have used the device extensively for high precision time measurement, but that are short periods of time (a few ms at most) where I can afford to simply not give time to background processes, and then it works great. In your case you will have to allow the background processes to run, but even with the WiFi fully off and no web server running I’d not expect it to really be able to do perfectly regular measurements at this 6 ksps. An ATmega MCU is much better at this. Or maybe a Teensy?

I can monitor the voltage, but need to data log the readings.

How are you doing that? Are you sampling the AC waveform? Taking an average? Have you "caught" any anomalies so you know what they "look like"?

I agree that you should only log the anomalies. But you'd have to figure out what you want to consider normal-small variations and what you want to consider and anomaly or glitch.

...I'd try running through a step-down transformer, then rectifying and filtering. Then, monitor the DC. The filter needs to be "slow enough" to smooth the 60Hz but "fast enough" that you don't filter-out the dropouts. You could connect an LED to see if it flickers.

You might also call an electrician to see if they can help. They might have a voltage monitor/logger.

You might also call an electrician to see if they can help. They might have a voltage monitor/logger.

FlukeData logger by my licensed electrician is 2 months out on scheduling. he has a 'cheap' unit but that is committed for the next 2 weeks.
AC is by current limited transformer.
output is AC wave in a (-2.5v)-0-(+2.5V )
on a voltage dividers that lifts 0 to 2.5 for the center point
the result into the analog pin is 0-5v range with 0 at 2.5
I can alter that so 150 VAC is the range larger in the 5v window of an Arduino
this results in the zero-crossing to be at 2.5 volts as far as the Arduino sees it.
the phase lag in not important.
the mechanical / electronical bits are not a stumbling point. openenergymon has the basic schematic.
the code has me scratching my head.
if I watch just the highs and lows.
and establish a normal range, then any event that either exceeds that or falls short should be logged.
time of start of event, and event duration are probably all I need to worry about.