-->
Page 1 of 1

How to detect higher voltage (8V) changes on NodeMCU GPIOs ?

PostPosted: Thu Sep 23, 2021 12:56 pm
by grinch
I have an 8V bell with a number of bell push + indicator pairs, in parallel, which I'd like to get integrated with my home automation system. The idea is to link each bell push to a GPIO on a NodeMCU. This works when they are linked to a 5V ground during testing, but what about the 8V of the bell?

Image

Re: How to detect higher voltage (8V) changes on NodeMCU GPI

PostPosted: Fri Sep 24, 2021 3:55 am
by eriksl
... which is probably AC as well.

The "overengineered" solution would be to use an optocoupler. Then no matter what voltage would appear, the ESP would survice (but the optocoupler not).

The simple solution would be to use either a voltage divider or a zener diode. The last one would have my preference because it would guarantee voltage remains below 3.3 V.

The GPIO's as input have a real high impedance, something like 1 MOhm or more. So what you should do is to first apply a resistor (as seen from the 8 Volt source), it can be something like 10 kOhm, so you'll have little current running when the voltage is above 3.3 V. Then apply a zener diode connect to negative/mass/earth and then connect to the GPIO. If in your board there is a voltage shifter for the GPIO's (3.3 V -> 5 V), use a 5 V zener instead. Almost all GPIOs output some garbage during boot, if the zener voltage would be too low, either the zener of the GPIO could blow.

Re: How to detect higher voltage (8V) changes on NodeMCU GPI

PostPosted: Sat Sep 25, 2021 5:00 pm
by grinch
eriksl wrote:... which is probably AC as well.

The "overengineered" solution would be to use an optocoupler. Then no matter what voltage would appear, the ESP would survice (but the optocoupler not).

The simple solution would be to use either a voltage divider or a zener diode. The last one would have my preference because it would guarantee voltage remains below 3.3 V.

The GPIO's as input have a real high impedance, something like 1 MOhm or more. So what you should do is to first apply a resistor (as seen from the 8 Volt source), it can be something like 10 kOhm, so you'll have little current running when the voltage is above 3.3 V. Then apply a zener diode connect to negative/mass/earth and then connect to the GPIO. If in your board there is a voltage shifter for the GPIO's (3.3 V -> 5 V), use a 5 V zener instead. Almost all GPIOs output some garbage during boot, if the zener voltage would be too low, either the zener of the GPIO could blow.


Very helpful, thanks @eriksl

This is my current circuit diagram.

* can the step downs and step up converters work fine in this circuit or is it best to add some kind of smoothers/regulators? (I'm not familiar with the lingo and what options are available).

* what component(s) - highlighted as the blue boxes with "?" - would permit the GPIOs to accurately detect when current flowed through to the indicator flags and the bell?

Image

Re: How to detect higher voltage (8V) changes on NodeMCU GPI

PostPosted: Sun Sep 26, 2021 3:52 am
by eriksl
The image is missing apparently.

Step-down (DC/DC) converters can be used to power the ESP8266, but for RF using devices I prefer to have a very smooth power supply, so what I do is to step down to 5 V (actually 4.5 V, saves power) using a DC/DC converter and then add a LM3940 to go further down to 3.3 V, which will smooth out the remaining sawtooth ripple from the DC/DC converter.