Arduino digital pins voltage stays high after setting low

Hi,

I am attempting to drive an n channel mosfet by providing voltage to the mosfet gate via a digital pin. Once gate voltage is received the drain and source are connected to complete ground to an led. The issue is that once I set the digital pin to high any further attempt to set it to low doesn't work and the pin stays high.

I've disconnected everything and connected my ohm meter to arduino ground and digital pjn. The test proved conclusively that the pin wouldn't go low after being set high. I tested on a second arduino nano and get the same results.

I not a newbie to the arduino and in the process of modifying an existing program that leverages digital output high and low operations to drive a relay, leds and inputs so this is a bit odd to me.

I just recently downloaded the latest arduino developer version and am not sure if this could be causing an issue. For some reason I had to revert back to the old atmega328 bootloader because the new version failed. I was still able to compile and upload via old bootloader though.

Any advice? Could the new release be affecting the arduino nano digital functions?

Thanks

"the pin wouldn't go low after being set high. "

You might need to put a resistor between the gate and ground to ensure the gate does not float some after the pin is no longer high.

Any advice?

Start by posting a small program that illustrates the problem

Have you set the pinMode() of the pin to OUTPUT ?

Hi Zoomkat,UKHelibob,

To answer both 1) I have a 10k resistor between digitial pin and ground to protect against floating. 2) I am setting pinMode to Output 3) The issue was a coding issue in that I was not allowing enough time to sense voltage change when going from high to low state. :o

Thanks again, but marking this one up to trying to do too many things at once and not focusing properly.

All is functioning as expected now.

Health and best regards to you and your family,

Don