3 ms·
> How do I monitor whether the contacts are closed or open? I assume with a GPIO pin, but I’ve never been able to google this question and find anything of use.
by Majromax 2y ago
> How do I monitor whether the contacts are closed or open? I assume with a GPIO pin, but I’ve never been able to google this question and find anything of use.
Without making assumptions about the microcontroller used, attach ground to one of the contacts, then attach a GPIO pin, the other contact, a 10k resistor (or 100k), and VCC together in series. The microcontroller should periodically read the GPIO pin. If it reads high, the contact is open and the alarm is not sounding; if it reads low then the contact is closed and the alarm is sounding.
The GPIO / contact / resistor / VCC arrangement acts to pull up that side of the circuit to the high logic level, and the resistor will limit the current that flows whenever the contacts close. If your microcontroller has an internal pull-up configuration for GPIO pins, you may be able to attach the pin directly to the contact without the extra hardware. (Conversely, if it has a pull-down configuration you can reverse things, attach VCC to the contact and the GPIO directly to the other. Read your microcontroller's documentation for available features and any current limitations.)
- wdfx 2y agoYou're assuming the tank switch is low voltage. The very first thing to do is read the manual for the installation and/or parts used. Second, approach the tank setup with a high voltage multimeter and carefully and safely take measurements of what you might be dealing with.
- quickthrowman 2y ago> The very first thing to do is read the manual for the installation and/or parts used. Second, approach the tank setup with a high voltage multimeter and carefully and safely take measurements of what you might be dealing with. Good call, I’ll make sure it’s not 120v or 24v with a multimeter before attaching anything that expects dry contacts.
- quickthrowman 2y agoThank you for the detailed instructions, this is extremely helpful! I’ll throw a multimeter across the contacts on the septic tank alarm to make sure they aren’t putting out 24v.