Looks like the control line for my furnace is 80V AC and the thermostat shorts it (with a relay) to turn on the heating.
I'd like to make an ESP32 detect whether the heating is on, so I guess an optoisolator in parallel to the thermostat? With a 4k resistor for 20mA through the LED?
I'm open to advice.
Per Piggo's advice, I decided to rectify that 80V before passing it to the optoisolator.
In the meantime I took a 4.7k resistor in series with an ammeter, and connected it to that 80V, to see what kinda current it'd give me.
It gave me 1.2mA... and turned on the heating. So the furnace must have a 60k-ish resistance inside it. That means I need a much bigger resistor and much smaller current, begat the question: will an optocoupler even detect that?
1/
I bought a PC817 optocoupler, which is fairly popular. It's datasheet specifies current transfer factor only down to 1mA input current, so I had to test myself what happens below that.
It appears that at 35uA through the diode (input), I get 1uA through the phototransistor (output).
Not exactly an amplification, but at least it's something.
Now to figure out if this is something ESP8266 can detect
(yeah turns out I have ESP8266 not ESP32)
Ok, so it appears that a 1M pull-up resistor is too much for the ESP's GPIO, and so is 500k, but 250k is fine.
That means I'd need around 10uA to flip the GPIO.
With the PC817 optocoupler, that requires 100uA on the input, which is IMO kinda close to the 300uA that turns on the heating... I'd much rather pull only 30uA from the furnace's control line.
If I had a darlington optocoupler, like an LTV-355T that would probably solve all my problems, but they don't have it in the nearby store. I'll check another store.
If I don't get an LTV, I'll try adding a separate transistor after the optocoupler to amplify the signal.
Basically it'd be the same schematic as the LTV but the second transistor wouldn't be inside the optocoupler, so more room to pick up interference. We'll see how it goes...
I didn't have time to go to the other store but I found a random 2SC1815 transistor laying around.
Measured its hFE, it was 166, so I figured I may as well try adding it as an emitter-follower to the PC817 optocoupler.
Lo and behold, I can totally detect 35 uA through the optocoupler's LED (which was 1uA through the phototransistor last time I checked).
I can even detect 10uA through the LED, resulting in a nice 0.7V low state on ESP's GPIO.
@wolf480pl Please tell me that's not some kind of electricity-powered penis.
@wolf480pl Of course not, it would have ruined the fun. But I'm glad you don't see the resemblance.