8/30/2023 0 Comments Pull down resistor![]() Check RB7 in the TRISB register, make sure it's set to 1 to make the pin an input. If the pin is 5V with the switch open, you have the pin configured as an output. If the internal weak pull-ups are enabled, you'll get a small current flow with the switch open, through the weak pullup and your pulldown, and the voltage on the pin will be somewhere in between 0 and 5V, probably somewhere in that in-between never-neverland. No current should flow in or out of the pin itself, unless the pin is configured as an output, in which case you'll get lots of current if the switch is closed and the pin is set to low (this is why you should have a resistor on the switch side too, to avoid damaging the PIC due to a coding error). The 5V and GND pins are present in Arduino, so you can use them with your. If you use a very low-value resistor, a high current will flow to the power ground when the switch is closed, and it can damage the Arduino. The value of the resistor should be between 1k to 100k. ![]() With the switch closed, there will be current flowing from +5V through the switch and resistor to ground (about 500 microamps or 0.5 mA according to Ohm's Law). To connect a pull-down resistor with a switch, check the below figure. With the switch closed, the voltage on the pin should be 5V (through the switch), and with it open, it should be 0 (through the pull-down resistor). Click to expand.Is that with the switch open or closed?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |