The diode does nothing so you can remove it and now that you have the voltage divider, you don't need the 22K resistor anymore.
For the diode, I thought it was still acting as a bit of protection from any stray current from the signal pin of the little relay (there is voltage coming from it when powered on) and I really, really wanted to protect the 12v utility company’s signal. Does it matter I leave it? Part of the circuit is already soldered….
So from my understanding:
Your 22k is now replaced by the 15k+15k+10k = 40k resistance to ground. There is no need to have double the circuitry to pull to ground anyway since now the 40k does that. It does not matter much as when the utility company sends the 12v it will go to the 3.3k (lower) resistance anyway and sature the base of the NPN.
That same 12v will go to the 15k+15k resistors and then to the GPIO pin, being dropped to
(10k/ (10k+30k)) * 12v = 3v
which will trigger the GPIO pin to HIGH
am I getting this right?
Yes and you can leave the diode.
Make sure you don't use INPUT_PULLUP on the GPIO pin and that your esp board does not have a pullup resistor on that GPIO
Then I would suggest a totally different circuit because now your ESP is connected directly to the 12V signal with only a resistor inbetween.
Can you buy parts from Digikey or Mouser?
understood
I can buy parts from digikey, already have in the past.
Honestly I don’t see much issue with exposing the ESP pin. The signal will never be over 12V, the ESP will not break the utility’s module, and if there is an issue, I lose a 1$ ESP board… do you see another big issue?
I don't care about the ESP either, as I said my major concern is protecting the 12V signal. What will happens to the 12V signal if the ESP pin has a pullup or your code goes crazy and sets the pin to 3.3V or 0V, or the ESP should become unpowered?
You might consider this circuit
Assuming the diode should never burn out the worse thing that could happen is if the the MOSFETs short to ground, then 555uA would be drawn from the 12V signal.
Mmm..
I would venture to say that the furnace might get that 3.3v signal and think it is now in high tarrif mode and start using propane as the main fuel.
But I am not sure this is a riskk… see, here is a picture of the setup.
the gray wire comes from the meter outside. It is the input signal. The module is the white box and the green light is on when I am on the low tarrif, and the yellow light on the high tarrif.
Blue wire goes to my furnace.
White goes to the module I am building
I would not think that 3.3 would trigger the module…
I have yet to have the phone call back from the utility company’s engineer, but I will ask what is the threshold to trigger it. I want to be careful when I talk with them less I be put on a black list LOL
very interesting
Can I use my 1N4001 instead of the 1N5819 ?
Can I use any of those NPN instead of the VN2106?
2N2222
2N3904
2N5551
C1815
C945
S8050
S9013
S9014
S9018
No to all.
lol I was about to post. The NPN I have are BJT where your 2N2106 is a MOSFET… so no indeed
The MOSFETs basically don't draw any current fron the 12V signal, so the only load on the 12V signal are the two 22K resistors. So the current draw is onlt 12/44K = 273uA. Miniscule!
The diode will keep any current from going back the the 12V signal source.
I see
I also have the MOSFET IRLZ34NPBF which seems like a good substitute? Or the sipex SPX294OU MOSFET
A a side story, would adding a rectifier diode on the wire that goes to my GPI pin also provide the same protection?
The IRLZ34 would work.
I don't think the SPX2940 is a MOSFET.
No, putting a diode on the ESP GPIO won't protect the 12V signal if the MOSFETs should fail.
I signing off for today.
For sure,
In the meantime I built the circuitry using the 1N4001 and the IRLZ34 for testing purposes, and without the ESP… just the little relay and the diode + resistors + MOSFET and testing the voltage values to understand the circuit.
I get a /2 drop.. not surprising since R1 = R2
here is with 22k and 22k
Sending 6v to my pin would fry the ESP so I took the initiative of finding a fix. This does not seem right.
Here is with a tentative fix R1=30k and R2=10k ending at 3v which would be in the sweet spot for the GPIO pin.
Am I reading this right?
Another question I have: Is there a reason why I could not connect my ESP-SIG to the Drain pin of the Q1 Mosfet? Why 2 mosfets? Is it to isolate the components fully?
Again, thanks so much for your time. I am learning so much!
Is this the device that your electricity company has installed has installed to indicate which tariff is current (High/Low) and which supplies the 12v signal you have been talking about or is this simply a switch for the hot water heater, which also uses the 12v signal to warn you if you are using the high tariff rate ?
The wiring on the panel has a sort of "hobby electrician" look to it.
When Q1 is off, the drain is pulled up to 12volt by the relay module.
Q2 is used in open drain mode, meaning that the ESP pin must pull it's own pin HIGH.
pinMode (signalPin, INPUT_PULLUP); // enable internal pull up on the pin
The fet can then pull the pin to ground when needed.
Leo..
LOL
Yup, that’s the module, in all it’s wired up glory ![]()
Oh!!! for sure, when Q1 is off 12v would flow to the GPIO pin and burn out that ESP in no time. Did not think of that!
So even with Q2 in place, I have to use the pull-up resistor on the ESP or make one manually to avoid the floating state… did not catch this as well, but I see why it is needed.




