
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.
1) Are you using that pull down with a Digital Port ?
White - Digital Port
Black - GND
Red - VCC
1.1) Red - voltage value ?
2) Resistor value ?
EZB voltage ?
The digital ports of the EZ-B v4 are unregulated power. This means that the power you provide to the EZ-B v4 is outputted to the power pin of the digital ports.
This is because digital ports are generally used for servos. It is very energy inefficient to regulate power for servo motors and therefore generates a lot of heat, kills batteries quickly, etc.. It is recommended to power the EZ-B v4 with a 7.4v LiPo battery so servos do not require regulators.
The ports are unregulated, I am using a LiPo battery.
This is my understanding of the pinouts:
Black is ground. Red is VCC, White is signal (i/o).
You are lucky If your EZB and/or the PORT are still good...
Still would like to know how to setup the a switch as I stated.
1) Use the Digital Port but connect the red wire to an Analog's VCC pin (3.3v)
OR
2) Use an Analog Port
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.
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.
Alan
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.
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
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?
1) always open (Input Pin = GND)
2) Pushed (Input Pin = 3.3 and power consumption)
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.
VCC = ideal 3.3v, no more than 5V.
Resistor = same rules
@Dave:
I believe you can use that logic for robot bumper switches, imagine the robot hits the wall.
If the idea is to monitor switches states, can be problematic if the verification code takes longer and misses a transition.
It is a stationary robot and I am using to determine if it gets lifted, knocked over, etc..
you're right, my initial concern was the voltage on the red pin, before serious damage.
but i missed something:
I would change the wiring (post 19)
I have 6 bumper switches, 3 front, 3 back, you have more digital ports than analog ports so why not ?
@dbeard
Can you provide more details ? you have our attention
Trying to understand.
I know you must be getting tired of me. But I have a question about post 19.
So there are 3 pins coming off of the EZB. Black Red White, with Black being ground, Red is VCC, and white is signal.
So based on your drawing the Switch gets connected to Black and White.
I put the resistor on Red and connect inline with the white pin.
1) disconnect the cable/plug mod you showed in the picture from the Digital port
2) connect the cable/plug mod to ADC port 0
Voila.
It would be really cool if one of the electronics people would put together a tutorial on this. I think there is some assumed knowledge around electronics that some of us don't have, especially how this wiring stuff relates to the ports on the EzB.
PTP - Thanks for you time and hanging in there with me. I appreciate the help.
Also, thanks to everyone else who jumped in and added support.
Code:
I agree. A tutorial on pull up/pull down resistors and why and where they are used would be great.
Alan