G+_Dennis Millican Posted March 31, 2017 Share Posted March 31, 2017 Hi Padre. I am watching Arduino 102 and you are talking about low current and high current on a digital pin. Am I wrong to think of the logic values as low and high voltage levels? I thought the purpose of a pull down resistor was to present a near zero voltage to the sensor pin and reduce the short circuit current from the 5V from the switch to ground when operated. Link to comment Share on other sites More sharing options...
G+_Fr. Robert Ballecer, SJ Posted March 31, 2017 Share Posted March 31, 2017 Not wrong... but less correct. :) Current, voltage and resistance are all related. (In a given circuit, the current is proportional to the voltage and INVERSELY proportional to the resistance. (i.e. raise the voltage and increase the current, raise the resistance and lower the current) ) The analog pins on an Arduino CAN measure voltage (That's what we use when we use potentiometers to change values on our WS2812 Steampunk goggles) by using an analog-to-digital converter that reads voltages between near-0 and 5 volts as a value between 0 and 1023. However, the digital pins on an Arduino only measure a high and low state, with a VERY small current needed to flip state between 5v and near-0. (So you're right), but because it's a digital pin, you're not REALLY measuring voltage, but just the current. Link to comment Share on other sites More sharing options...
G+_Robert Buchholz Posted March 31, 2017 Share Posted March 31, 2017 Actually, per the Arduino website, the impedance of the digital pins for input is 100 MegOhm. That means that the circuit with the switch closed looks like the attached diagram for simulation purposes. The two resisters in parallel means that the effective resistance is approximately 50 MegOhms. The total current draw would be .0000001 amps, or about one tenth of a microamp. 1000 times more of that current would be running through the 100 K resister than through the 100 M resistance of the Arduino. That means the current going into the Arduino pin would be effectively zero. The reason behind the 100 K resister to ground is to eliminate capacitive coupling. Quote directly from the Arduino website: "This also means however, that pins configured as pinMode(pin, INPUT) with nothing connected to them, or with wires connected to them that are not connected to other circuits, will report seemingly random changes in pin state, picking up electrical noise from the environment, or capacitively coupling the state of a nearby pin." https://www.arduino.cc/en/Tutorial/DigitalPins Link to comment Share on other sites More sharing options...
G+_Jason Marsh Posted April 3, 2017 Share Posted April 3, 2017 Pull-down or pull-up resistors on inputs are there to maintain a particular state at an inactive input, or to provide appropriate voltage to trigger the logic when active. Essentially, they're there to ensure that an input is either 0 or 1 (low or high, on or off, active or inactive), and nowhere in-between, because a digital input that is neither high or low, but somewhere in the undefined region, will function erratically and unpredictably. Generally, they are quite high in resistance because you don't want to build a lot of heat in your IC by draining a lot of current through it. Without a pull-down/pull-up, the input voltage can fluctuate, even climb very high due to static charges and inductive or capacitive coupling to nearby circuits, etc. This can cause damage to the IC or cause erratic operation as the potentials change. The low and high voltage levels are specific to the type of input/IC. Some are <= 0.49V low and >= 0.5 high, while others represent a low as <= 0.8v and high >= 2v. You should always check your documentation for logic levels used on your IC or system. An input without a pull-down/pull-up is called a floating input. They are necessary when using more than a two-level logic system. Imagine not just off and on, but degrees of on (or off) as well. There are many different logic levels that can be implemented in an IC, but most assembled systems will stick to only one definition of logic levels. I could go on forever, but I'll just leave you with a wiki entry that does a succinct job of it... en.wikipedia.org - Logic level - Wikipedia Link to comment Share on other sites More sharing options...
Recommended Posts