Background
My cottage has a cellar which is relatively humid, so I purchased a system that keeps the humidity at reasonable levels using a set of fans and a dehumidifier. The system runs two different control loops as far as I can determine.
One controls the fans: when the absolute humidity is lower outdoors than indoors, the fans run to swap in the dryer air and out the more humid air. The control box controls four 24V DC fans by driving them directly.
The other one controls the dehumidifier: when the relative humidity is above a particular threshold, the unit is started. I think it is some sort of simple PID controller, but I am not sure. The control box controls a 240V relay with a 12V signal (as far as I can determine).
As it is black box system, I don't know exactly what is going on. I have managed to reverse engineer the protocol between the box and the PC software in order to read out the humidity values, but I cannot determine using that protocol if either of the loops are engaged.
My thinking is therefore that I would like to use my Raspberry Pi (which is already connected to the box) to detect voltage changes on the fan controller and on the relay controlling the dehumidifier.
Question
How do I safely detect voltage changes using my Raspberry Pi? Design priorities are (1) safety, (2) reliability, (3) cost, in that order. As this system controls the humidity, it is critical that my measurement does not interfere with the operation of the contorl box.
Ideas I have thought of, and my conclusions:
- Using LEDs on the control box: Cannot be done, LED status does not correlate with fan or dehumidifer controls. :-(
- Using some sort of optical measurement for the fans: could work, as all of them are operated in unison it would be reasonable to place an RPM metering system on one of them. Drawback is lots of cables.
- Using some sort of switch that can detect the air movement: could be simple, but I don't know how reliable. Also involves a lot of cables.
- Using some sort of voltage detection: seems most reasonable, but I don't want to toast the Raspberry Pi or interfere electrically with the operation of the control box.
My thinking so far is to build some sort of voltage divider circuit as I have done with an Arduino, but the Raspberry Pi lacks an ADC. An option would be to use a digital input, but my window of error shrinks: I need to be able to hit the 3.3V within a margin, and the voltage spikes from a DC fan controller I guess are terrible news for a Raspberry Pi GPIO port. Another alternative would be to introduce an external ADC, but how do I then connect it to the fan controller to avoid interfering with the control box?
Are there any standard patterns for this kind of thing?
Kindly advise! Thanks! :-)