Pin to pin via Resistor, Safe? - Netduino Plus 2 (and Netduino Plus 1) - Netduino Forums
   
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

Pin to pin via Resistor, Safe?

pin resistor safe

Best Answer Mario Vernari, 25 August 2013 - 05:33 AM

Michael, that's not surprising at all!

Any Netduino (Plus) 2 input does not require any current, or -better- that's unreadable with a normal multimeter. Now, since the Ohm's law says that V=R*I, a "zero" current yields a "zero" voltage drop, even when the resistance is high.

 

A resistor across two pins is always a good bet, not just because -as explained- an input will suck current, but you may wrongly set the pin as an output, and that could lead to an improper working state and a lot of stress for the outputs.

To be clear, I'd say that a 180 Ohms resistor is the *minimum*, but I would avoid to consider a borderline point.

Go to the shop and buy a couple dozen of 10k Ohms resistors: that's a midrange value which adapts to a lot of contexts. You'll never feel to have trashed your money!

 

BTW, when you switch a multimeter for current measurements, it does expose a pretty low resistance across its leads: it could span from some Ohms to some hundreds/thousand, depending on the actual range displayed/switched. The lower is the full-scale range, the higher is the resistor. If you use the "special" 10A current loop, the resistor is probably below 1 Ohm.

So, no wonder on the equivalent effect of the multimeter in place of a "real" resistor: you probably wired an equivalent resistor lower than 180 Ohms!

 

Bear in mind that, yes, a resistor will protect the circuit/chip from erroneous settings/wiring, but even in case of short the chip should be designed to resist for a indefinite time. In other words, your errors hardly kill the Netduino, but won't lead it happy as well.

 

Finally, a word about the inputs.

It's a very good practice avoiding leaving inputs floating, that is without any "strong reference". That's because an input without some "hook" require a very little energy to swing high-and-low, keeps strange levels (between low and high), and excessive current consumption as well.

When an input is not used (I mean wired), you should choose among one of these:

  • activate the internal pull-up, if that's an available feature;
  • place your own pull-up externally, by using a "famous" 10k Ohms resistor (of course, one resistor for each pin);
  • set the pin as an output, and leave it open.

Note that the options are ordered by preference, whereas the latest is the most undesirable.

 

Hope it helps.

Cheers

Go to the full post


  • Please log in to reply
3 replies to this topic

#1 Michael E

Michael E

    New Member

  • Members
  • Pip
  • 8 posts
  • LocationCanada

Posted 25 August 2013 - 01:38 AM

This is a newbie question but I want to be careful not to overload any of my pins, I want to feed D5 to D6 where D5 is on PWM and D5 an interrupt, such that I can count pulses.  I know the pins can handle no more then 25mA max so I figure a resistor of 180 should yield about 18 to 19 mA at max.  Does the following circuit diagram look safe?

 

Posted Image


“I have not failed. I've just found 10,000 ways that won't work.”
? Thomas A. Edison


#2 Michael E

Michael E

    New Member

  • Members
  • Pip
  • 8 posts
  • LocationCanada

Posted 25 August 2013 - 03:29 AM

I figured this has to be safe so to be sure I wired it up but with the wire from D6 disconnected.  Then I used my multimeter to connect D6 to the resistor trying to measure its current value.  What I got was a suprise, it was reading 0 but however with the meter disconnected, and thus D6 dangling, I was getting triggers on my OnInterrupt rutine.  My led would randomly flash which means the interrupt while not conected was picking up something so I enabled the glitch filter and it did the same.  If i disconnect the wire completely, it stops.

        public App()        {            count = 0;            Led = new OutputPort(Pins.ONBOARD_LED, false);            BLANK = new OutputPort(Pins.GPIO_PIN_D8, false);            GSCLK = new PWM(Pins.GPIO_PIN_D5);            GSCLK.SetDutyCycle(50);            counter = new InterruptPort(Pins.GPIO_PIN_D6, true, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeHigh);            counter.OnInterrupt += new NativeEventHandler(counter_OnInterrupt);        }        void counter_OnInterrupt(uint data1, uint data2, DateTime time)        {            // Only reset BLANK when nessisary            if (BLANK.Read() == true) BLANK.Write(false);            if (count == 4096) // Every 4096th pulse, send BLANK            {                count = 0;                BLANK.Write(true);#if DEBUG                Led.Write(true);                Thread.Sleep(1000); // So we can visualy see count 4096 was reached                Led.Write(false);  #endif                          }            count++; // Count pulses        }

“I have not failed. I've just found 10,000 ways that won't work.”
? Thomas A. Edison


#3 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 25 August 2013 - 05:33 AM   Best Answer

Michael, that's not surprising at all!

Any Netduino (Plus) 2 input does not require any current, or -better- that's unreadable with a normal multimeter. Now, since the Ohm's law says that V=R*I, a "zero" current yields a "zero" voltage drop, even when the resistance is high.

 

A resistor across two pins is always a good bet, not just because -as explained- an input will suck current, but you may wrongly set the pin as an output, and that could lead to an improper working state and a lot of stress for the outputs.

To be clear, I'd say that a 180 Ohms resistor is the *minimum*, but I would avoid to consider a borderline point.

Go to the shop and buy a couple dozen of 10k Ohms resistors: that's a midrange value which adapts to a lot of contexts. You'll never feel to have trashed your money!

 

BTW, when you switch a multimeter for current measurements, it does expose a pretty low resistance across its leads: it could span from some Ohms to some hundreds/thousand, depending on the actual range displayed/switched. The lower is the full-scale range, the higher is the resistor. If you use the "special" 10A current loop, the resistor is probably below 1 Ohm.

So, no wonder on the equivalent effect of the multimeter in place of a "real" resistor: you probably wired an equivalent resistor lower than 180 Ohms!

 

Bear in mind that, yes, a resistor will protect the circuit/chip from erroneous settings/wiring, but even in case of short the chip should be designed to resist for a indefinite time. In other words, your errors hardly kill the Netduino, but won't lead it happy as well.

 

Finally, a word about the inputs.

It's a very good practice avoiding leaving inputs floating, that is without any "strong reference". That's because an input without some "hook" require a very little energy to swing high-and-low, keeps strange levels (between low and high), and excessive current consumption as well.

When an input is not used (I mean wired), you should choose among one of these:

  • activate the internal pull-up, if that's an available feature;
  • place your own pull-up externally, by using a "famous" 10k Ohms resistor (of course, one resistor for each pin);
  • set the pin as an output, and leave it open.

Note that the options are ordered by preference, whereas the latest is the most undesirable.

 

Hope it helps.

Cheers


Biggest fault of Netduino? It runs by electricity.

#4 Michael E

Michael E

    New Member

  • Members
  • Pip
  • 8 posts
  • LocationCanada

Posted 25 August 2013 - 07:30 PM

Hi, Thank you for your help with this problem.  Since last night I had done some research as well before bed where I learned also about the pullup/down resistors you mentioned to use on open pins.  I had no idea how that worked but now I do.  I added a 1K pulldown from D6 to GND this was before reading your post just now about the recommended 10k.  I was unable to get any even trigger afterwards even after disabling glitch filter.  I did some more reading about interrupts on this site and found an experiment that was done with the speed capabilities.  In short I have decided the Interrupt is probably being triggered too quickly by the PWM that this might not be my best option to use for a counter.  I have found an ExtendedTimer class in the NETMF Microsoft.SPOT namespace that might lead me better results.  In addition I have ordered 2 SN74HC4060N 14-STAGE BINARY COUNTER with Oscillator chips that I saw being used in a TLC5940 application elsewhere on this site.  I am still waiting for my hardware and this counter test was in preparation for receiving the TLC5941 chips I ordered.  While the test was unsuccessful I learned about floating pins, pullup/down resistors and interrupts.  And the reasons why I was reading 0mA.  Thank you for helping me better understand.


“I have not failed. I've just found 10,000 ways that won't work.”
? Thomas A. Edison






Also tagged with one or more of these keywords: pin, resistor, safe

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.