Go Down

Topic: Uno vs. Nano current source/sink [solved] (Read 1 time) previous topic - next topic


Jan 03, 2013, 06:14 am Last Edit: Jan 09, 2013, 05:40 am by Nick Gammon Reason: 1
I'm happily using Arduino's for various projects (MEGA2560, UNO), and just started using a NANO (v3.1) for another project.  I'm switching a FET (BSS123) to turn fans on/off, and I currently have D6 wired to the FET gate.  I'm seeing that digitalWrite(6,LOW) doesn't seem to pull it all the way to ground, like it can't sink enough current, or there's a big resistance to ground.  I see the same effect if I put a 5V LED (with built-in load) from +5V to D6... D6->LOW won't turn the LED on.  The LED works fine on the UNO using D6, and it works on some other digital pins on the NANO... just not D6 (haven't tried d5).  Oddly, I can get the FET to switch off if I use analogWrite(6, 0), and on with analogWrite(6,255).  Just no luck with digitalWrite.  I can work around with analogWrite, but if anyone has info on why digitalWrite(6,LOW) isn't sinking the current on NANO 3.1, I'd be very interested to know.


The silicon used on the Uno and Nano is the same.

Perhaps your nano's 328 is damaged.
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com



That part has pretty high Rds with Vgs at 4.5V, 10 ohm.
Shouldn't impact driving the gate hi/low, but you do drop a lot of voltage across it that could impact the current you switch thru your load.
For example, at 150mA, you'd have 1.5V across the transistor, and with a 5V source, only 3.5V across your load.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.


Oddly, I can get the FET to switch off if I use analogWrite(6, 0), and on with analogWrite(6,255).  Just no luck with digitalWrite.

That sure sounds like you forgot to use the pinMode command to place pin 6 into output mode. If analogWrite works on pin 6 then there can be no electrical problem with the pin?



Thanks, Lefty, Crossroads and James!  Good suggestions all around.  Turned out it was the pinMode, which I had set correctly originally, but then a copied snippet of code reset it to input, so no ability to sink.  ONce I tracked that down, everything is happy.  Case closed, and I'm back to work!

Go Up