Digital display for half wave detector with cubic spline interpolation – part 2

Digital display for half wave detector with cubic spline interpolation – part 1 laid out the design concepts of a power meter display.

Whilst the preferred target was an Arduino Zero (SAMD21G) for its 32bit architecture, speed, and 12bit ADC, the code was developed to run on a Zero or a Arduino Nano (ATmega328P). Initially, my preferred approach of storing device calibration parameters in EEPROM was shelved because the SAMD21G does not have EEPROM, and it’s NVM alternative is not nearly as convenient.

Notwithstanding that, EEPROM support has been plumbed in and tested. For devices supporting Arduino EEPROM library, calibration coefficients can be supplied in EEPROM, or inline in source code.

The interpolation table is calculated separately in Excel (using a custom VBA function library), but could be done in any suitable tool.

Above is a screen shot  extract of the spreadsheet, the column on the right is C array initialisation code for pasting into the project source code. The same values are loaded into the EEPROM data structure if used.

Above is a screenshot showing the EEPROM data for a LTSPICE-BAT46 calibrated model.

Next

Next step is to evaluation ADC noise on some more dev board candidates.

Though so far the Arduino Zero dev boards evaluated have had unacceptable ADC noise, another option with either the Zero or Nano is to use an external I2C ADC module.

A work in progress..

Continued at Digital display for half wave detector with cubic spline interpolation – part 3.