Electrical – ground a digital pin on an Arduino to provide input

arduinodigital-logicground

I want to monitor whether a fan is turned on or off. No RPM, no voltage levels… simply just is it on or off. The fan is 12V and is controlled by a relay. The relay is closed when a thermocoupler reaches a certain temperature and grounds the internal coil, closing the contacts and providing power to the fan.

I was going to go through the hassle (actually I already did, just haven't installed it yet) of building a small circuit to convert the 12V down to 5V. Then I had a thought… what if I use the internal pull-up pin on the Arduino to set it "HIGH", and when the thermocoupler grounds, let that ground pull the Arduino pin "LOW," signaling that the fan is on?

I expect I will need to put some sort of safety measure inbetween the Arduino and the thermocoupler to guard against over-drawing the Arduino… but that should work right?

EDIT: A "proper" schematic

schematic

simulate this circuit – Schematic created using CircuitLab

Best Answer

A simple diode to the relay should work for you if you use the pull-up on the Arduino input. The diode prevents the fan power from driving into the pull-up. If you are using a 3.3V Arduino you may need to use a germanium diode.

schematic

simulate this circuit – Schematic created using CircuitLab

A small series resistor would not hurt too just in case you happen to drive the pin with the relay closed.