Have questions about FETS, transistors, measurement, power supplies, or anything else electrical?

User avatar
By Linwood
#83811 New to esp8266 and EE courses several decades past, so would appreciate some help.

I'm trying to get a simple circuit to detect when the doorbell rings. It is a AC doorbell, about 24V rms, and I was experimenting with a NodeMCU chip trying to derive a high/low signal for the GPIO Dx pins.

My idea was to rectify the AC to DC, divide it to get it to the right range, filter a bit to keep it from oscillating outside the "on" range, and limit it (in case when the bell mechanism moves there is a spike).

This is what I came up with (drawning from the falstad site):

circuit.jpg


At the bottom the AC is simulated at 30v peak, goes into a full bridge rectifier of four 1N4007 diodes, the voltage divider is 2200 and 330 ohms with a random capacitor between the output section. At the top I used the NodeMCU's 3.3v pin and ground for the DC voltage source and ground respectively, and another diode there as a voltage limiter.

The simulation says I will hover in about the right voltage range, even if it spikes to 45v (higher I start to exceed 3.7v). It also shows a tiny ripple that ought to be close enough to DC to be just on or off, so I don't have to count pulses, etc.

I hooked this up WITHOUT hooking up the output (shown on the diagonal at the top) and measured with a voltmeter (I have no scope) and got the approximate right voltage, a bit low (I think it showed 2.6V DC instead). I then touched the output to D2 and nothing.

But... I don't think the NodeMCU was on the network because after the above it was fried -- I tried disconnecting it from the circuit, reflashing with USB -- nothing. The big chip on it was quite hot (touchable but barely) when it was hooked up to power. I think it's dead.

My GUESS is there's something wrong with the concept, and further my guess is it's in the voltage limiting portion at the top, that somehow hooking to the 3.3v pin fried it.

or... maybe it was when I touched the output to D2. Though that voltage looked OK (perhaps even low). Note that this testing was just with transformer output, I never got around to pulsing it with the doorbell switch.

There are a number of other possible alternative approaches, from a 24v relay to reed switch near the magnet.. but can someone help me understand where I went wrong in the above? While I'd welcome a more simple solution to the goal, I would really like an understanding of how I blew up that chip. Thanks in advance.

PS. First post here, please redirect me if I'm in the wrong place.
User avatar
By rudy
#83813
My GUESS is there's something wrong with the concept

The problem is that the simulation is far too simplistic and it does not reflect the real life circuit.

The capacitor is not a perfect capacitor. It has internal resistance and inductance. At some frequency (high) it will not look like a capacitor. The filtering will be low to none.

The door bell will have a lot of inductance. It will create a magnetic field. When the power is interrupted any still present magnetic field will collapse, and that will generate a short duration high voltage pulse. (made up up of high frequency components)

I don't know how you are powering the ESP8266 module but if it isn't with batteries (probably not) then there also is capacitance between the module and the door bell circuit. At low frequencies like 60 Hz the capacitance would be irrelevant. But at much higher frequencies, the magnetic field collapse, the capacitance could provide another path for energy to be transfered.

Without a good understanding of all of the potential hazards, a direct connection is not recommended. An optocoupler based circuit would be prefered, but is not a guarantee for success. Bad wiring practice could make a theoretical schematically functional circuit into something marginal. Try to keep wiring from each side of an optocoupler separate.
User avatar
By Linwood
#83815 Thank you. FWIW I tested this without the bell being activated, so I was just getting the AC from the transformer. I powered the NodeMCU with a usb adapter I had lying around that came with a Raspberry Pi.

So please accept as given I'll do something different. But in terms of education:

So it sounds likely that when the bell button is pushed it may get worse, but as tested it should have had simply 60hz 24v coming in. Do you think that, also, is likely to cause a problem as implemented?