
PRO
dbeard
USA
Asked
— Edited
I have a switch that is always closed. If it becomes open that is a condition that I take some action. I put together a pull down resistor (based off the attached picture from another post). But I noticed that it gets really warm to the touch. Is that expected? Should I use a larger resistor (or smaller).
Thanks in advance.
Solution:
Regarding the resistor 47 ohm is a strong resistor, a 4.7K is a weak resistor.
Weak or Strong affect two things: current consumption and response time.
For a button, the time it takes to switch the button, plus the code is not executed in the controller (wifi delay, desktop cpu processing etc) is not relevant stronger takes more time to react.
A strong pull resistor would, when the button is pressed and kept pressed, cause a large drain of current from vcc through the resistor to ground, so a weak resistor is better.
I would use a 4.7K resistor, but it can work with 1K.
Ok, just to make sure I understand.
Let me take option 2.
If I use an ADC port do I need the pull down resistor?
If I do, same setup GND and VCC?
Option #1
So connect the pull down resistor to ground and VCC (red), not white as I have it.
I have a 4.7 k resistor will try it.
Thanks for the info.
Wait.... Of the 3 wires, which ones are connected to the switch? If just the white and black, then the discussion about white smoke and such are irrelevant, you are just connecting 3.3v to ground, so it is just a matter of getting the right resister value for the pull down. Most of the threads I have seen suggest a 1k, but I am not that savvy on electronics (mostly a software guy) so not sure how to calculate the optimal value. Resisters to get warm, because what they are doing is slowing down current and throwing it away as waste heat. If it is ~100 degrees, no worries. If it is hot enough to burn, then you have the wrong value, or have wired the unregulated (probably 7.4 if you are using the Lipo) high amp current to the switch (red wire), which is a major issue.
Alan
There has been no smoke.
I have smaller resistors.
I am not an electrician either and browsed many threads talking about the pull down resistor.
So is my solution to install a smaller resistor and make sure the GND and White goto the switch.
My switch has two wires. I want to set it up so that as long as the button is pressed so switch is closed I take no actions, but if the switch is open (or no longer pressed) I want to take an action.
Sorry, work call.
To avoid doubts:
P (Watts) = I * I * R = V * V \ R P = 7.4 * 7.4 \ 47 = 1.16 w your resistor can handle 1/2 = 0.5 W, so eventually will get harm and then black smoke.
P (Watts) = I * I * R = V * V \ R P = 3.3 * 3.3 \ 1000 = 0.01 W
P (Watts) = I * I * R = V * V \ R P = 3.3 * 3.3 \ 4700 = 0.002 W
Like i said i use 4.7K but it can work with 1K, the consumption is not relevant.
Note: you can use the 47 ohm:
P (Watts) = I * I * R = V * V \ R P = 3.3 * 3.3 \ 47 = 0.2 W
You are wasting 0.2W it's your battery
Ok. Will change to 4.7 or 1, whichever I have.
One more stupid question. I want to wire with the button pushed, so it will probably be pushed most of the time. Will this be an issue or if I have it wired correctly with the right resistor I should be OK?
And some low level heat is expected just based on the way a resistor works, but it shouldn't be to hot to handle, correct?
the above scenario:
If you keep the button pushed for a long time, makes sense a weak resistor to avoid battery draining, and is expected the heat dissipated but with 1/2 W or 1/4 resistors you can't fry anything
If you want a different logic e.g. always closed, I would work the logic at the script level, to avoid power consumption.