Go Down

Topic: What if I use 230 ohm resistor with 5V input to Ground? (Read 5488 times)previous topic - next topic

bsld

Aug 05, 2015, 07:02 pmLast Edit: Aug 05, 2015, 07:03 pm by bsld
So I've build up a button like in this example but instead a 10k Ohm resistor I used a 230 Ohm one. The board run fine and the button example works correctly but I'm still worried if there will be any long-time consequences from this. I'm a total newbie at electronics.

Also when the button is pressed for a long time the resistor get a little hot (not like to hurt your skin but still).

ApexM0Eng

The resistor is there to make sure that the pin is connected and pulled-down to ground as its default state. When you close the switch it receives 5V instead. However because your resistor value is so low, it is conducting a fair amount of current. This resistor is meant to limit the amount of current can flow to ground.

As current flows through the resistor it heats up, which is a good indication it should be removed for a larger one.

groundFungus

Or ditch the pull down and wire the switch from ground to the input and enable the internal pullup.

Code: [Select]
`pinMode(pin, INPUT_PULLUP);`

The switch will read LOW when pushed.

ApexM0Eng

#3
Aug 05, 2015, 07:49 pmLast Edit: Aug 05, 2015, 07:49 pm by ApexM0Eng
'Internal pull-ups' is only three tutorials past 'button', you'd think they could put them together to teach about using one or the other. Rather than messing around with external ones first, then telling you there are better ways for simple projects.

jack wp

If only the world was perfect. Then there would be no need for this forum.  LOL

groundFungus

I think it is because people associate LOW with off and have a hard time with off being on.

jack wp

Off subject: but once I applied for a job with Linear (sorta a small scale IBM) about 40 years ago. I knew TTL logic circuits (7400 series ). They gave me a written test, about logic ttl ckts. I failed it. Come to find out, their low was -5v, and their high was ground (I never had a clue). I guess it's all relative.

raschemmel

Quote
have a hard time with off being on.
That's understandable...
Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

jack wp

#8
Aug 05, 2015, 08:28 pmLast Edit: Aug 05, 2015, 08:32 pm by jack wp
"but instead a 10k Ohm resistor I used a 230 Ohm one."
That substitution may draw lots more power than needed, but It will not hurt anything.
In most cases, a button is not held down for a long time, so if the button is only pressed for one second, then there is not much difference is current draw.

But, I suggest you pick up some more resistor values. Other circuits may not be so forgiving.

bsld

Or ditch the pull down and wire the switch from ground to the input and enable the internal pullup.

Code: [Select]
`pinMode(pin, INPUT_PULLUP);`

The switch will read LOW when pushed.
What are the drawbacks of this method - it will consume more energy I guess?

raschemmel

#10
Aug 05, 2015, 08:55 pmLast Edit: Aug 05, 2015, 09:00 pm by raschemmel
Arduino GPIO pins have two modes (INPUT or OUTPUT).
When configured as an INPUT, the pin becomes a high impedance (100 Mohms) input)
If you are sensing a push button, the pin MUST be configured as an INPUT, therefore
you can short it directly to 5V or GND  without using any power to speak of . What you CAN'T do is connect the push button IN BETWEEN 5V and GND and then push the button because you will short your 5V power supply. Thus, ANY DISCUSSION OF POWER CONSUMPTION OF AN I/O PIN CONFIGURED AS AN INPUT is completely irrelevant and non valid. Such a discussion would only  be appropriate for a pin configured as an OUTPUT .

Do you understand the significance of a input impedance of 100 Mohms ?

If you are discussing the power consumption of a 10k ohm pullup resistor, it depends on WHAT you connect that input pin to. By itself , an INPUT pin with a 10k pullup is part of a voltage divider with 10k in the upper position and 100 Mohms in the lower position. Any discussion of input pin power consumption would have to be based on the circuit that you connect to that input pin.
Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

jack wp

"What are the drawbacks of this method - it will consume more energy I guess?"

Depending on how often the button is pressed, and how long it is held down, is the processor run 24/7 ?

With the natural order of things, I think you would be right.  But I still suggest getting a varity pack of resistors.

DVDdoug

Quote
What are the drawbacks of this method - it will consume more energy I guess?
Less power...  IIRC, the internal pull-up is 20k-50k Ohms.

Note that power is only consumed when the switch is on.  (That's true with pull-ups or pull-downs.)

From Ohm's Law 5V/250 Ohms is 20mA, and that's about the same current as an LED.  No big deal, but pull-ups or pull-downs are usually in the range of 1K to 10K.

As far as energy, power is calculated as Voltage x Current, so 250 Ohms is 1/10th of a Watt.

raschemmel

Quote
it will consume more energy I guess?"
How long do you plan to hold the button down ? (effectively connecting a 230 ohm resistor across 5V and GND.

I = V/R = 5V/230 ohms = 0.0217 A (21.7 mA)
P = I x V = 0.0217 A x 5V = 0.1086 W = 109 mW (while the button is held down)

Can you spare 100 mW ? (for 1 second ?)
Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

Grumpy_Mike

For the full lowdown on this question read this:-
http://www.thebox.myzen.co.uk/Tutorial/Inputs.html

Go Up