Transformerless AC to DC Conundrum

Not open for further replies.

Thread Starter


Joined Oct 15, 2018
I am trying to design a circuit that measures humidity in my bathroom and when it reaches a certain threshold, it will power up a ceiling fan to extract the moisture.

I live in Australia where we have 240V mains (modelled as V2) and to make the circuit entirely maintenance free, I have introduced a transformerless AC to DC component to provide ~5V DC (C1 to maintain line voltage drop, D1, as a voltage regulator, D3 for rectification, C2 for filtering) (this is the point between D3 and C2) in the circuit below.

View attachment 161623

For the modelling, the 5V DC taken from the AC is not currently connected to the DC rail. Rather, I have put in a 5V DC voltage source (V4) and used that to drive the potentiometer (R7) (to set the threshold), a DC pulse generator (V3) (to simulate the humidity detector switching on off) and a Comparator (U1) to detect when the “humidity” goes over the threshold.

The output of the Comparator drives the gate of a Triac (X4) which is in turn connected to the AC source (V2); R6 represents the fan (snubber to be installed later).

The circuitry works pretty much as I intended (see bottom two plots in the screen snap below). I shall seek to install a bleed resistor across C1 at a later point. I am well aware of the critical need to property ground and insulate this circuit prior to deployment.

View attachment 161624

Where I am struggling is when I remove V4 and connect the DC (from AC) directly to the potentiometer (R7) and Comparator (U1). When the Comparator switches on, it draws ~25mA through the power pin which in turn is output into R8 and X4. The current flow into C2 as it builds charge is of the order of a hundred microamp (most of the AC current passes through the Zener (D1).

I suspect that the Comparator is consuming the stored DC faster than the AC-DC circuit can charge the capacitor and thus causing the circuit to fail (top two plots in the screen snap above)

Would anyone have any suggestions for me on this?
Last edited by a moderator:
Not open for further replies.