My DVM project using the Raspberry Pico is still under development, but I have already achieved excellent results such as measuring positive voltages from 0 to 2.500V with good accuracy and stability.
Using an old technology, but still used in Voltmeters today - Dual slope ADC. The counter/timer uses the RP2040 processor clock frequency of 200 MHz. Therefore, the resolution is 5 nanoseconds. This allows for greater precision and resolution for the DVM.
The circuit was assembled with the Raspberry Pico - RP2040. But it can be modified for the Raspberry Pico 2 including WIFI and Bluetooth - Raspberry Pico W.
Currently the DVM measures positive voltages, but it could be implemented to measure negative voltages as well (in future)
To vary the range of voltages to be measured, voltage dividers with precision resistors can be implemented at input of the DVM. The same circuit is used in modern voltmeters.
Digital Voltmeter with 4 ½ digits - Raspberry Picohttps://forums.raspberrypi.com/viewtopic.php?t=391945
Link Github:https://github.com/Gustavomurta/tinyGo_my_experiments/tree/main/Raspberry_Pico/DVM_4halfDigitsUsing Tinygo - easy, fast and amazing language to control microcontrollers.
Voltage at input : 1.025VCalibration: 131000 // Auto Zero Period: 41968 ticks // Voltage Auto Zero: 0.031 V # VIN Period: 1365937 ticks // VIN Voltage: 1.025 V
Calibration: 131000 // Auto Zero Period: 41953 ticks // Voltage Auto Zero: 0.031 V # VIN Period: 1365973 ticks // VIN Voltage: 1.025 V
Calibration: 131000 // Auto Zero Period: 41878 ticks // Voltage Auto Zero: 0.031 V # VIN Period: 1366006 ticks // VIN Voltage: 1.025 V
Calibration: 131000 // Auto Zero Period: 41862 ticks // Voltage Auto Zero: 0.031 V # VIN Period: 1365980 ticks // VIN Voltage: 1.025 V
Calibration: 131000 // Auto Zero Period: 41906 ticks // Voltage Auto Zero: 0.031 V # VIN Period: 1365927 ticks // VIN Voltage: 1.025 V
Calibration: 131000 // Auto Zero Period: 41885 ticks // Voltage Auto Zero: 0.031 V # VIN Period: 1365882 ticks // VIN Voltage: 1.025 V
Calibration: 131000 // Auto Zero Period: 41719 ticks // Voltage Auto Zero: 0.031 V # VIN Period: 1365938 ticks // VIN Voltage: 1.025 V
Calibration: 131000 // Auto Zero Period: 41706 ticks // Voltage Auto Zero: 0.031 V # VIN Period: 1365915 ticks // VIN Voltage: 1.025 V
Calibration: 131000 // Auto Zero Period: 41741 ticks // Voltage Auto Zero: 0.031 V # VIN Period: 1365878 ticks // VIN Voltage: 1.025 V
Calibration: 131000 // Auto Zero Period: 41398 ticks // Voltage Auto Zero: 0.031 V # VIN Period: 1365922 ticks // VIN Voltage: 1.025 V
Calibration: 131000 // Auto Zero Period: 41703 ticks // Voltage Auto Zero: 0.031 V # VIN Period: 1365896 ticks // VIN Voltage: 1.025 V
Calibration: 131000 // Auto Zero Period: 41824 ticks // Voltage Auto Zero: 0.031 V # VIN Period: 1365890 ticks // VIN Voltage: 1.025 V
Calibration: 131000 // Auto Zero Period: 41825 ticks // Voltage Auto Zero: 0.031 V # VIN Period: 1365843 ticks // VIN Voltage: 1.025 V
Calibration: 131000 // Auto Zero Period: 41795 ticks // Voltage Auto Zero: 0.031 V # VIN Period: 1365878 ticks // VIN Voltage: 1.025 V
Calibration: 131000 // Auto Zero Period: 41732 ticks // Voltage Auto Zero: 0.031 V # VIN Period: 1365985 ticks // VIN Voltage: 1.025 V
Since I increased the integration time to 16.666 ms, now the number of bits has increased! Now I can say that it is more than 21 bits
Due to the stability of the measurements, I was able to increase the sampling rate to 10 measurements per second.60Hz period = 1/60 = 16,666,666 (uint32) time in nanoseconds.
Ticks = 16,666,666 / 5 = 3,333,333 (uint32) each tick is 5 ns
VREF = 2.500V
LSB Voltage = 2.500 V / 3,333,333 = 7.5e-7 ( least significant bit: 750 nano Volts!)
2 ^ 20 bits = 1,048,576
2 ^ 21 bits = 2,097,152
2 ^ 22 bits = 4.194.304
Code: Select all
Dual Slope ADC RP2040 V11
AC mains period: 16666666 ns
LSB Voltage: 0.000000750 V
CPU Frequency: 200000000 Hz
Nanoseconds per tick: 5