PI PICO
New tricks for the Pico voltmeter
Tam Hanna expands his basic Raspberry Pi Pico voltmeter to improve accuracy and add a resistor measurement capability.
The code
Get it from linuxformat. com/archives and part one!
OUR EXPERT
Tam Hanna has developed, prototyped and manufactured hardware for various civil and military applications.
The voltmeter built at the end of the last issue introduced basic metrology. It suffered from low accuracy because the input current of the Raspberry Pi Pico caused high voltage losses across the protection resistor. In this follow-up instalment, we’ll use an operational amplifier to solve this problem. We’ll also add a mode for measuring resistances.
Just as in last month’s issue, the goal of this tutorial isn’t to create the perfect tabletop multimeter. Instead, we want to demonstrate additional metrological concepts and inspire you to perform more experiments on your own.
The current must flow
A resistor in series with the ADC input turned out to be a great way to make the multimeter more resilient. Connecting 5V to the ADC input would normally destroy the Raspberry Pi Pico, but our system survived even with the reduced value of the protection resistor. This, however, isn’t ideal. Practical multimeters regularly face hundreds or even thousands of volts in spurious inputs. Undoing this resistor value reduction would be beneficial for the longevity of the product, but we need to solve the problem of the ADC input current.
To recap, our problem is caused by the current flowing into the ADC. It’s a piece of circuitry that performs a relatively complex computation. Logic dictates that this requires current.
Solving this problem sounds easy in theory. If we could integrate another component that handles the output current of the ADC then all of our accuracy problems would vanish in the blink of a flashing LED.
Adding this circuit solves the current flow problem.
A current source doesn’t care much about additional protective elements, such as diodes.
Fortunately, such a component exists in the form of an operational amplifier. An OpAmp is a highly versatile component that can be configured to act as a buffer. This configuration is commonly called a voltage buffer or voltage follower (see diagram, bottom-left).
We need to make the necessary adjustments and perform a quick test. First, connect the output to the 3.3 voltage rail. This should trigger the low mode that worked perfectly before – unfortunately, we see a value of about 2V. This problem is caused by the presence of the operational amplifier. The next attempt involves connecting 5V – switching action doesn’t take place.