Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

There is always 0.7 volts on digital pins even when they're not active.


  • Please log in to reply
20 replies to this topic

#1 Fabien Royer

Fabien Royer

    Advanced Member

  • Members
  • PipPipPip
  • 406 posts
  • LocationRedmond, WA

Posted 20 February 2011 - 09:02 AM

Hi Chris, In the application that I'm working on, I use a transistor as a switch to power a servo only when needed. The base of the transistor is connected to a digital pin through a resistor. It turned out that the base of the transistor was always getting a small voltage, just .7 volts, even when the digital pin controlling the base of the transistor was turned off. 0.7 volts is just enough to saturate the junction of the transistor and to switch it ON. I had to add a 1n4001 rectifier diode (which always drops the forward voltage by 0.7 volts) to eliminate the unexpected 0.7 volts, at which point everything started behaving properly. This appears to be an issue specific to the mini as I am not experiencing this on the regular netduino using the same configuration. I was wondering if this is a known behavior of the mini? Cheers, -Fabien.

#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 20 February 2011 - 10:42 AM

Hi Fabien, The ports have built-in pullup resistors. When the ports are not being used, they may be configured as inputs with the pullups enabled. If you drive them as an OutputPort and set their state to false (0V), do you still see power? This should be identical on the Netduino and Netduino Mini... Chris

#3 Fabien Royer

Fabien Royer

    Advanced Member

  • Members
  • PipPipPip
  • 406 posts
  • LocationRedmond, WA

Posted 20 February 2011 - 05:49 PM

If you drive them as an OutputPort and set their state to false (0V), do you still see power?


Yes, I see 0.7 volts, even when the output port is set to false.

#4 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 20 February 2011 - 06:26 PM

Yes, I see 0.7 volts, even when the output port is set to false.


Fabien,

Are you using the Pins. enumeration (which gives you GPIO pins 5-20) instead of the Cpu.Pin enumeration?

If you set the OutputPort to true, do you see 3.3V?

Chris

#5 Fabien Royer

Fabien Royer

    Advanced Member

  • Members
  • PipPipPip
  • 406 posts
  • LocationRedmond, WA

Posted 20 February 2011 - 09:02 PM

Are you using the Pins. enumeration (which gives you GPIO pins 5-20) instead of the Cpu.Pin enumeration?


Here's what I'm doing (NETDUINO_MINI is defined in this case):

#if NETDUINO_MINI
        private static readonly OutputPort _servoPowerEnable = new OutputPort(Pins.GPIO_PIN_16, false);
        private static readonly PushButton _pushButton = new PushButton(Pin: Pins.GPIO_PIN_17, Target: PushButtonHandler);
        private static readonly OutputPort _ledOverride = new OutputPort(Pins.GPIO_PIN_13, false);
        private static readonly OutputPort _ledServoPowerEnable = new OutputPort(Pins.GPIO_PIN_15, false); 
        private static readonly PWM _ledLowHeat = new PWM(Pins.GPIO_PIN_18);
        private static readonly PWM _ledHighHeat = new PWM(Pins.GPIO_PIN_19);
        private static readonly HS6635HBServo _servo = new HS6635HBServo(Pins.GPIO_PIN_20,minPulse: 700, centerPulse: 1600);
#else
        private static readonly OutputPort _servoPowerEnable = new OutputPort(Pins.GPIO_PIN_D3, false);
        private static readonly PushButton _pushButton = new PushButton(Pin: Pins.ONBOARD_SW1, Target: PushButtonHandler);
        private static readonly OutputPort _ledOverride = new OutputPort(Pins.GPIO_PIN_D2, false);
        private static readonly OutputPort _ledServoPowerEnable = new OutputPort(Pins.GPIO_PIN_D4, false);
        private static readonly PWM _ledLowHeat = new PWM(Pins.GPIO_PIN_D5);
        private static readonly PWM _ledHighHeat = new PWM(Pins.GPIO_PIN_D6);
        private static readonly HS6635HBServo _servo = new HS6635HBServo(Pins.GPIO_PIN_D9,minPulse: 700, centerPulse: 1600);
#endif

Complete source: http://netduinohelpe...29%2fProgram.cs

If you set the OutputPort to true, do you see 3.3V?


Actually ~1.4 volts in this case because of a voltage divider configuration on the pin. But yes, it would be 3.3v without it.

#6 Fabien Royer

Fabien Royer

    Advanced Member

  • Members
  • PipPipPip
  • 406 posts
  • LocationRedmond, WA

Posted 20 February 2011 - 09:20 PM

In case you're wondering, here's what the setup of the board looks like:

Pic 1/3
Pic 2/3
Pic 3/3

Powered by a 9 volts wall-wart.

-Fabien.

#7 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 25 February 2011 - 03:24 AM

Hi Fabien, Okay, I've looked at the schematic, board design, and source... You should have 0.00VDC (GND) on your OutputPorts when you do an OutputPort.Write(false); Is there any chance you could put your Netduino Mini on an empty breadboard, provide power, run a program which creates an OutputPort, set the OutputPort to false (0V) and then measure the voltage between that pin and GND? If you're still seeing voltage at that point, we'll run the same test here and come to a resolution for you. Chris

#8 Fabien Royer

Fabien Royer

    Advanced Member

  • Members
  • PipPipPip
  • 406 posts
  • LocationRedmond, WA

Posted 25 February 2011 - 06:46 AM

Hi Chris, I will do that this weekend and will get back to you. -Fabien.

#9 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 27 February 2011 - 08:34 AM

Sorry guys for the intrusion, but... 1) when you're configuring a GPIO pin as an output, you should have a push-pull driver without any pullup (has no sense to have it). So, Chris is right: true means 3.3V and false is 0.0V, otherwise there's something wrong. 2) Fabien, the voltages you are reporting sound suspects...how much is the resistor connected from the N-pin and the transistor?...I think it's too low and the diode shouldn't used. Better, could you draw on paper the schematic and post a photo of it? Cheers Mario
Biggest fault of Netduino? It runs by electricity.

#10 Fabien Royer

Fabien Royer

    Advanced Member

  • Members
  • PipPipPip
  • 406 posts
  • LocationRedmond, WA

Posted 28 February 2011 - 02:32 AM

Hi Fabien,

Okay, I've looked at the schematic, board design, and source... You should have 0.00VDC (GND) on your OutputPorts when you do an OutputPort.Write(false);

Is there any chance you could put your Netduino Mini on an empty breadboard, provide power, run a program which creates an OutputPort, set the OutputPort to false (0V) and then measure the voltage between that pin and GND?

If you're still seeing voltage at that point, we'll run the same test here and come to a resolution for you.

Chris



Hi Chris,

As you suggested it, I put my other netduino-mini on a breadboard, wrote a proggy setting pin 10 to pin 20 as output pins and powered the netduino-mini using a 5V FTDI cable (5v on pin 21).

Here are the results of my measurements:


pin 10: 0.0v
pin 11: 3.4v
pin 12: 5.0v
pin 13: 0.0v
pin 14: 0.0v
pin 15: 0.0v
pin 16: 0.0v
pin 17: 3.3v
pin 18: 3.3v
pin 19: 3.3v
pin 20: 3.3v

I went to do the same thing when powering the netduino-mini with 9 volts (pin 24 and 23) and... I let the magic smoke out of the 5v voltage regulator. I believe I shorted one of the pins of the voltage regulator as I went to take a measurement and it died with a stinky puff of smoke :(

It's too bad because that was the interesting part of the test since on my other netduino-mini, when powered using 9 volts, pin 16 configured as an output pin shows 0.7 volts even when set of 'false'.

-Fabien.

#11 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 28 February 2011 - 02:45 AM

Fabien, :o Let us mourn our fallen comrade. On your tests... 1) The pins with positive voltage readings...I'm assuming that you set those OutputPorts to TRUE correct? 2) Not sure why pin 12 would read 5V. That's really odd, since the Netduino Mini only drives 3.3V signals. Was a TTL serial cable plugged in when you took the measurements? Chris

#12 Fabien Royer

Fabien Royer

    Advanced Member

  • Members
  • PipPipPip
  • 406 posts
  • LocationRedmond, WA

Posted 28 February 2011 - 03:09 AM

Fabien,

:o Let us mourn our fallen comrade.

On your tests...
1) The pins with positive voltage readings...I'm assuming that you set those OutputPorts to TRUE correct?
2) Not sure why pin 12 would read 5V. That's really odd, since the Netduino Mini only drives 3.3V signals. Was a TTL serial cable plugged in when you took the measurements?

Chris



About #1: all the output ports are set to FALSE. Here's what the app does:


        public static void Main() {
            var pins = new OutputPort[(int)Pins.GPIO_PIN_20 - (int)Pins.GPIO_PIN_10];
            var count = 0;
            for (int pin = (int) Pins.GPIO_PIN_10; pin <= (int) Pins.GPIO_PIN_20; pin++, count++){
                pins[count] = new OutputPort((Cpu.Pin) pin, false);
            }

            while (true) {
                Thread.Sleep(5000);
                Debug.Print("beep...");
            }
        }

About #2: yes, my bad, the FTDI cable was connected when I took the measurement. When disconnected, pin 11 & 12 both read 3.3 volts.

#13 Fabien Royer

Fabien Royer

    Advanced Member

  • Members
  • PipPipPip
  • 406 posts
  • LocationRedmond, WA

Posted 28 February 2011 - 03:28 AM

I changed the proggy to be this:


public static void Main() {
            var p13 = new OutputPort(Pins.GPIO_PIN_13, false);
            var p14 = new OutputPort(Pins.GPIO_PIN_14, false);
            var p15 = new OutputPort(Pins.GPIO_PIN_15, false);
            var p16 = new OutputPort(Pins.GPIO_PIN_16, false);
            var p17 = new OutputPort(Pins.GPIO_PIN_17, false);
            var p18 = new OutputPort(Pins.GPIO_PIN_18, false);
            var p19 = new OutputPort(Pins.GPIO_PIN_19, false);
            var p20 = new OutputPort(Pins.GPIO_PIN_20, false);

            while (true) {
                Thread.Sleep(5000);
                Debug.Print("beep...");
            }
        }


and now, all the pins do show 0.0 volts...
Had forgotten that pin definitions aren't always sequential... <facepalm>
Still, our mystery is not solved yet... Stay tuned.

#14 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 28 February 2011 - 03:38 AM

and now, all the pins do show 0.0 volts.


Okay, great. Now if you put the Netduino Mini back into your circuit using this program...do you still get 0.7V?

Chris

#15 Fabien Royer

Fabien Royer

    Advanced Member

  • Members
  • PipPipPip
  • 406 posts
  • LocationRedmond, WA

Posted 28 February 2011 - 06:22 AM

Ok, mystery solved :) Floating pins show ~0.7 volts when the circuit is powered with 9 volts, even when the corresponding output ports are set to FALSE. -Fabien.

#16 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 28 February 2011 - 06:32 AM

Ok, mystery solved :)

Floating pins show ~0.7 volts when the circuit is powered with 9 volts, even when the corresponding output ports are set to FALSE.

-Fabien.


Hi Fabien,

Which pins are floating? If they're OutputPorts set to false, they should be driven (to 0V) and not floating...

Chris

#17 Fabien Royer

Fabien Royer

    Advanced Member

  • Members
  • PipPipPip
  • 406 posts
  • LocationRedmond, WA

Posted 28 February 2011 - 06:38 AM

For instance, pin 14 in the circuit is not connected to anything (no external pull-up or pull-down resistor) and it showed 0.7 volts.

#18 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 28 February 2011 - 06:40 AM

For instance, pin 14 in the circuit is not connected to anything (no external pull-up or pull-down resistor) and it showed 0.7 volts.


Okay, so just to confirm:

1. When powered via 5V regulated power everything is fine.
2. When powered via VIN (9V unregulated) the output is incorrect?

If that's accurate, when powering via VIN...what voltage do you measure between VIN and GND? 9V exactly?

Chris

#19 Fabien Royer

Fabien Royer

    Advanced Member

  • Members
  • PipPipPip
  • 406 posts
  • LocationRedmond, WA

Posted 28 February 2011 - 07:01 AM

About #1: everything seems fine with 5V About #2: yes, when powering the mini through +VIN with 9v unregulated, I can see 0.7 volts when the pin is floating even configured as an output set to FALSE. I can observe the same thing on the DTR and DRXD pins of COM2. The voltage between VIN and GND is 8.6 volts exactly. -Fabien.

#20 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 28 February 2011 - 11:35 AM

Fabien, I suspect that something is broken, not connected properly or there is a short somewhere. The N mini is somewhat simple: do you measure +5V *after* the N regulator, when the Vin is about 9v? Assuming that you've checked the soldering, could you post the schematic? Mario
Biggest fault of Netduino? It runs by electricity.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.