Products > Embedded Computing

Arduino Internal Pullup Resistor Question - Starting out and in the weeds

<< < (4/5) > >>

retrolefty:

--- Quote from: rstofer on February 25, 2019, 08:27:15 pm ---
--- Quote from: Kagord on February 25, 2019, 06:44:20 pm ---"The concept of the internal pullup resistor seems a lot simpler than what you are making out of it.  Not clear why it is so important?"

It's not important, but I'm trying to really understand this, "end to end", what's going on.  I realize it's not a good sign that this is only the 2nd circuit I have looked at in my life, the first one being a blinking led (pin 13) on the Arduino, and I'm hung up on this 2nd circuit.

--- End quote ---

There is quite a path to understanding all of this but here's another rule:  Never let CMOS inputs float.  The voltage on the pin needs to be either higher that VIH or lower than VIL.  As long as you use a reasonable pullup resistor and pull to ground with a switch, you will meet the requirements.  I told you the VIH had to be higher than 0.6VCC and, for a 5V device this needs to be > 3V.  OK, our pullup resistor can drop 2 volts (5V - 3V) with 1 uA current (remember IIH?).  That means the maximum resistor value is 2V / 1 uA or 2 MOhms.  A resistor less than or equal to 2 MOhms will guarantee the logic level is met.

Then you were told that the current through the switch should be on the order of 5 mA.  Again, for a 5V device that works out to 5V / 0.005 A or 1K Ohms.  So, something on the order of 1K will CLEARLY meet the logic level requirements and also the minimum current through the switch.

That's all there is to the concept.  Well, there are a couple of other things like the 330 Ohm series resistor that I recommend but for which there is no absolute requirement and  if you decide to use a pulldown resistor and pull up to Vcc, I would absolutely use the series resistor.  I don't like dumping a solid VCC into a pin.  This is a 'yesterday' kind of rule but I still like it.

Start with Ohm's Law.  Migrate to the Real Analog course at Digilent
https://learn.digilentinc.com/classroom/realanalog/
Or the EE program at Khan Academy

Do NOT involve yourself in the electron flow versus conventional current flow debate.  For almost every practical purpose, conventional current flow is the accepted way of dealing with things.  To my knowledge, only the US Navy insisted on electron flow for their ET program.  In the end, it doesn't make any difference but it is simply easier to assume current flows from + to -.

With conventional current flow, you can follow the arrow on transistors and diodes.  You don't have to think in terms of electrons flowing upstream.  You can read schematics from top to bottom (usually drawn with + rail on top).  Now, if you want to major in Physics, I suspect you would use electron flow.  Just for the device physics.  The engineers, the guys who hook things up, are going to use conventional current flow.

--- End quote ---

The US Air Force also taught electron flow, we were told to just ignore the historical error that is 'conventional flow'

Richard Crowley:
Anybody who has been stuck in Los Angeles traffic for 3 hours intimately understands "hole flow".
At least from the perspective of the electron.

Simon:
I spent years trying to understand it from the electron point of view and I got nowhere. Once i tarted to look at everything flowing from positive things made sense.

Kagord:
Start with Ohm's Law.  Migrate to the Real Analog course at Digilent
https://learn.digilentinc.com/classroom/realanalog/

Started last night, Pre-Requisites, Calculus, Differential Equations,  I think this is going to take a wee bit longer than a few weeks.  |O

Edit, I found the Multi-Meter, there's a battery of the month club card in the box, going to Radio Shack next for my free battery, there's some no name cheap tandy that is kind of a mess.

Simon:
You don't need calculus. Calculus is for things live Fourier analysis and control systems. All you need is good old algebra and start to work on some basics of electronics.

[#] Next page

Go to full version