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):
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.