Save calibration data to ESP32 during manufacturing
Posted: Fri Jul 29, 2022 11:54 am
Hello everyone,
I am working on a smart plug with power measurement features. I use ESP32-C3 and ADE7953 for power measurement.
During development it turned out that calibration constants must be calculated for each and every device.
We have designed a custom calibration device with an accurate reference meter and phantom loads.
Now I am looking for the best way to run the calibration procedure and save the calculated constants to each ESP32-C3.
I have written a python program which communicates with the esp32 over uart, the energy meter and controls the different loads. The python program takes a measurement from both devices(our plug and reference meter) and calculates these constants. Then the constants are sent over uart to esp32 and saved in the NVS.
During normal operation, the smart plug reads the values from the nvs right after boot and assigns them to variables which are after that used for proper calculation of voltage, current, power etc.
What do you think of my approach and can you suggest me a better one?
I am working on a smart plug with power measurement features. I use ESP32-C3 and ADE7953 for power measurement.
During development it turned out that calibration constants must be calculated for each and every device.
We have designed a custom calibration device with an accurate reference meter and phantom loads.
Now I am looking for the best way to run the calibration procedure and save the calculated constants to each ESP32-C3.
I have written a python program which communicates with the esp32 over uart, the energy meter and controls the different loads. The python program takes a measurement from both devices(our plug and reference meter) and calculates these constants. Then the constants are sent over uart to esp32 and saved in the NVS.
During normal operation, the smart plug reads the values from the nvs right after boot and assigns them to variables which are after that used for proper calculation of voltage, current, power etc.
What do you think of my approach and can you suggest me a better one?