Small leakeage voltages on all pins

I am measuring like 30-60 mVolts on all pins on my arduino nano.I tried setting them as input and output mode in the hope that i may get 0V when they are low.Is this normal or am i missing something? I am trying to feed an opamp with analogWrite() function but analofWrite(8,0) gives me 60 mVolt on the output.

Thank you

  • Always show us a good schematic of your proposed circuit.
    Show us good images of your ‘actual’ wiring.

  • It might be your OP amp circuit biasing. :thinking:

  • Why are you feeding a PWM Arduino output to an OP Amp circuit ?


  • In the Arduino IDE, use Ctrl T or CMD T to format your code then copy the complete sketch.
    Use the < CODE / > icon from the ‘posting menu’ to attach the copied sketch.

What model of Arduino is this and which pin?

On most Arduino models, analogWrite() does not output a voltage between 0 and 5V. The name of the analogWrite() function is misleading. In fact, it outputs a digital PWM signal. The signal is always 0V or 5V (or close to those values) but the duty cycle can be varied so that the average voltage changes.

What does the data sheet information for your processor say about the possible voltage on the pins when set to 0 in the associated register? Zero for your processor can be any value below some minimum value. Remember, the processor is a digital machine, not an analog machine.

1 Like

That sounds like an instrumentation problem to me. You need to validate all of your connections and let us know what type of meter you are using. Also tell us what it reads when the test leads ace connected only to each other.

And... The specs for the ATmega chip say a digital low output is guaranteed to be 0.8V or less and a digital high is 4.1V or more. The input specs are slightly "loser" so that an output going to an input are always correct. That's the "magic" of digital... It doesn't have to be perfect as long as you can tell a 1 form a 0. (That's with a 5V supply and within certain current limits.)

1 Like

As all pins stick to the same semiconductor piece there can be some internal current flow that increases the ports base voltage.

When you say 0V do you mean 0.0V or 0.00V or 0.000V or 0.0000V or 0.000000V?

Measuring relative to what pin?

That is nonsense. On classic Nano pin8 is not a PWM output, so the analogWrite() function is inapplicable for that pin.

Yes it is normal, you will never get 0V from an output pin on a digital system.

If you want to feed this into an operational amplifier, you first have to pass it through a DC offset circuit to tune out any offset you have. Read this to see how.

gain and offset.pdf (230.0 KB)

It's not a good idea to feed a digital output into an amplifying opamp circuit because there is no guaranteed constant offset voltage on the output. Use of a comparator then is the recommended solution.

I don't understand why you say that. It is simple to apply an offset to the output as explained in the PDF.

By making the offset adjustable, that is adding a small variable resistor to the larger fixed resistor you can tune that offset value to what you want it to be.

I used the same technique when I was working with active filters for the Admiralty Underwater Weapons Establishment, many years ago.

An constant offset only.

in analog circuits with one time or regular calibration.

No!

Why not show a circuit that the OP can use?

There exists none, see my previous reply.

Why not give an example where an offset at a digital output is important?