Setting pin to REAL Ground?


i need to set a pin on my Pololu stepper driver to GROUND. It is the pin 19. and it can be addressed in three different states (normal, high, low).

the problem is that i need to change the behavior dynamically, so i cannot connect directly to a ground-pin.
when i am switching a pin to ground wit digitalWrite(Pin,LOW); it doesn't work and my micrometer shows a voltage of some MV between a "real" Ground Pin and the switched one. when i do the same with analogWrite(Pin,0), there is no voltage between the pins and the Driver does the desired behavior.

my problem is that i thought it should be the other way round? shouldn't pull digitalWrite(Pin, LOW) the pin to ground, so that it behaves like every ground-pin on the arduino? its just for being sure not to implement something worn in my system...


Any particular Pololu stepper driver board? Please always provide links to all
relevant hardware... Datasheets where possible.

BTW analogWrite (pin, 0) calls digitalWrite (pin, LOW) so your description
sounds impossible. (unless of course you forgot to call pinMode())

BTW a micrometer measures physical object widths, you mean multmeter. MV is a
megavolt, not millivolt (mV).

You cannot use a transistor to connect to +5 (Vcc) or Gnd - there will always be some Vds or Vce across the transistor.
If you really want to reach the full rail, then you need a relay, which is a mechanical switch.

Instead of wasting our time, post a link to the motor driver in question, so we can recommend a proper solution, instead of guessing on what may work.

It does not sound plausible that your driver needs a pin that is user-controlled, and needs to be at absolute ground.

// Per.

The Arduino pins when used as outputs are driven via on-chip MOSFETs with
about 30 ohms of on-resistance. This is very low impedance for logic and allows
loads like LEDs at 20mA to be directly driven. A pin pulled LOW is not the
same as GND (which can handle much larger currents than the absolute max
40mA of an Arduino pin, and which doesn't rise in voltage as the current rises).

If you need to control the power or ground to another chip you cannot use a pin
directly anyway since the decoupling capacitors of the load will overload the pin
completely (they pull larger currents at switch on than the chip itself).

An external transistor or MOSFET is used as a switch in such circumstances.