"Pull up" of "Pull down" resistor?

Hey all!

My name is Marco, and i'm new here!
I'm making an old doorbel work again. The plunjer is missing, so i decided to make it work again with Arduino. I'm using the original push button as a 5V switch.

When the doorbell is pushed, 2 solenoids are hitting the gong's.
The arduino does not read 0 without a resistor, so i did use an analogRead.
When over 1000 it turns on. I don't want to leave it that way.

It does work, but, i want to use "digitalWrite". Should i use a pull down, or a pull up resistor to make the arduino read the button is not pushed?

Does the resistor get hot inside the box of the old doorbell?

I'm hoping for your answers.

Kind regards,

Marcovabu

Do you mean digitalRead() instead of analogRead()?

You can use pinMode INPUT_PULLUP, or a resistor of a non-critical value 10K works fine, no it won't get hot.

Wire it from the input pin to 5 volts.

When you read the switch pin, LOW will mean the switch is closed. Pressed.

a7

Hello marcovabu
Post your current sketch, well formated, with comments and in so called code tags "</>" and a schematic, not a Fritzy diagram, to see how we can help.
Have a nice day and enjoy coding in C++.
Дайте миру шанс

No. Since the Arduino has nearly-infinite input resistance, essentially no current flows when the switch is open. When the button is pushed the pull-up or pull-down is "overpowered" by the button/switch and current flows through the resistor. But with a 1k resistor only 5mA flows. 5mA X 5V is 25 milliwatts so not much heat and most resistors are rated are 1/8 or 1/4 Watt. With a 10K resistor it's 2.5mW.

Thanx!

Yeah i did mean digitalRead indeed.

As i would like to use it on battery's, does the difference between pull up and pull down makes a diffference?

How long will it last anyway?

And if, someone wants to hold the button of the doorbell, i want it to cut the power, just to prevent damage. Unless it is harmless to hold the button for a while?

Thanx for the fast and clear answers! :slight_smile:

Ah, that makes a lot of sense. Stupid i didn't see.. Thanx!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.