hi.
i am trying control a relay directly with a switch.
there is also a connection to the pin of a micro controller. This is to detect if the relay is operating or not.
when the common and N/C of the switch are connected, the micro controller can read the voltage as 5 volts and as a result detect that relay is OFF.
however when the switch is operated, ie common and N/O of the switch are connected, the input of the micro controller is left floating.
while it will probably work most of the time, there is a chance of detecting false positive or false negative.
i was wondering if using that resistor, connected to ground will be able to prevent floating input ? if yes, what value of R should i use ?
or any other alternative ?
oh yeah the +5 volt and ground will probably not be from the arduino.
Why not connect your micro input to the "hot" side of the switch. When on you will get "0" as the pin is pulled to GND along with the relay. When the switch is off the relay is off but will act as your pull up resistor, neat and no extra parts. This assumes negative side witch and your detection logic is reversed, you can use a positive side switch and the detection logic will be "normal" again.
I'm basically saying that what you wanted to do with the relay contacts and a resistor you can do with your manual switch and the relay coil, all you are going to do is duplicate what you already have. When your manual switch is off the 0V end of the relauy will float and act as a pull up resistor to your micro input (assuming 5V relay coil if not yo9ur idea might be best)