Is sharing the same ground between a 12v ptc heater and a 5v fan ok?

Thread Starter

Zeroshin

Joined Oct 8, 2024
1
I have a circuit that consists of a 12vdc in, goes through a buck converter (lm2596) down to 5v. That 5v powers a fan and an esp32. It also powers the relay (a jqc-3ff-s-z to be exact, ignore what is written on the fritzing part). A 12vdc ptc heater positive goes to the 12vdc in positive. Both the ptc and the fan neutral go to the NO part of the relay. The COM of the relay is grounded.

Here is a fritzing of the thing:
Screenshot 2024-10-08 162116.png

The diagram is pretty much exact to the wiring with the exception that the 5v out goes through a switch before powering anything else.
The circuit is made to keep a filament box dry (with a humidity/temp sensor and some code on the esp32).

Thing is, when the relay is triggered, the whole thing shuts down, then back up. Neither the fan nor the ptc heater is powered.

What is wrong?
 

Sensacell

Joined Jun 19, 2012
3,768
Fritzing is horrible. Don't use this software.

Maybe re-draw with a pen and paper?
I cannot make sense out of this diagram.
 

ElectricSpidey

Joined Dec 2, 2017
3,312
There is no problem tying all of the grounds together, but...

Personally, if it were my project I would use a 12-volt fan and power both the heater and fan from the 12-volt supply switching the high side (positive) with the relay.

As far as the reset...it could be EMI from the relay, or it could be pulling down the voltage and resetting the micro.

Try placing a small cap at the input of the micro and see if this helps, say 100uf.
 
Last edited:

MisterBill2

Joined Jan 23, 2018
27,186
Contrary to post #3, it may be that tying the commons together might be a problem. Given that we have no information as to the internal connectivity of any terminals on any of those modules, tying the negative sides to each other could be a big problem. Some of those modules switch the negative side instead of the positive side. And NONE OF THEM are adequately documented.

In addition, powering anything else from the 5 volt supply that powers the processor is asking for trouble.
And certainly following a wiring map instead of a circuit schematic makes an analysis far more challenging. A schematic block drawing with boxes with labeled terminals will be much better.

A simple mechanical thermostat directly switching 12 volt power to the heater and fan will be a much better choice. And using a resistor to drop the voltage to the fan will be OK because the application need heat anyway. And probably the fan is already marked with the voltage and the current, so the math to calculate the resistor will be easy.
 

wraujr

Joined Jun 28, 2022
259
All depends on wire AWG and length.
What is wattage of the Heater (i.e. current)?
What is current of fan?
Current thru switch module is sum of above.
You only have a 3A supply and that supply may not be able to handle current surge of switching heater/fan on, so you may be seeing a "dropout" in your 12V. To handle, you may need couple 1000uf 25V caps on your 12V to prevent dropout.
Another is to isolate your DC/DC from heater by inserting a diode (i.e. 1N4001) and 1000uF cap at input in DC/DC, that way when heater turns on and there is drop/brownout in 12V, the 1000uF input cap keeps DC/DC up and diode prevents heater from draining cap.
As to wiring, I would have dedicated wire from ground (center-terminal) of switch module back to 12V source ground. With your daisy-chain the DC/DC and ESP32 may be seeing ground bounce.
 

wraujr

Joined Jun 28, 2022
259
Just saw, you are running the switch/heater/fan ground through the DC/DC board. NO, do not for many reasons.
The switch/heater/fan should have dedicated ground wire from 12V source.
 

panic mode

Joined Oct 10, 2011
4,866
is the lower left terminal supposed to be "I-" of the regulator? both inputs are marked "I+"
and is this terminal internally connected to "OUT-"?
the only problem i see is that ESP32 does not share reference with this circuit. is ESP32 powered from this circuit?
I think ESP32 is 3.3V so it is probably using own regulator and different power source.

in this case you need to connect 0VDC of your ESP32 to 0VDC (black wire) of this circuit - if that is safe.
if not you need to use an optocoupler to ensure galvanic isolation.
 

wraujr

Joined Jun 28, 2022
259
Also, agree with other statement " Personally, if it were my project I would use a 12-volt fan and power both the heater and fan from the 12-volt supply switching the high side (positive) with the relay."
 

panic mode

Joined Oct 10, 2011
4,866
the reason for switching negative side is because he is trying to use same relay contact to power two devices that are powered from different voltages. if the fan is needed, should have used 12VDC version like the heater.

Thing is, when the relay is triggered, the whole thing shuts down, then back up. Neither the fan nor the ptc heater is powered.

What is wrong?
Voltage regulators are normally series regulators, so is your device (it is a switching mode positive regulator). But... they have no magical voltage clamp or ability to sink current. they can regulate voltage only if the load is connected between regulator output and 0VDC. This is because they can only source current, and not sink it. so when relay is off, your fan is reverse biased. Current flows from 12VDC through fan, back into 5VDC terminal and that is one of the problems. Since that current has no way to go. As a result your 5V rail is not stable. At best you get unintentional pulse. at worst, you get the 5V rail raised above expected 5V and that causes problems for your other devices.

1. remove both fan and heater. measure regulator output and confirm it is 5V.
2. try to power heater alone from the 12VDC supply (connect it directly, without relay board) to see if PSU can handle the load. Measure voltage to be sure it is 12V. chances are your PSU cannot handle heater current.
3. use 12VDC fan and connect it in parallel with heater (only for test).
4. disconnect heater and fan from 12VDC
5. let 5VDC regulator power only relay board. try to see if your circuit works and ESP32 can control relay with no load.
6. if the relay control works, connect heater to relay and 12VDC PSU. try again to make sure it all works.
7. connect fan (12V version) in parallel with heater. test again.
8. if you do not want to replace fan, consider running it permanently of 5VDC. let the relay only handle heater.
9. consider replacing that relay board for a 12V version, then you no longer need 5V regulator. Perhaps get two channel version so fan and heater can be controlled independently (if you need that). or replace it with Mosfet module. this way you could do finer control of the heater using PWM.
1728510856096.png
 
Last edited:

MisterBill2

Joined Jan 23, 2018
27,186
LOOK!!! at the solder side of that switch module in post #9!!! The positive side is not switched, but the negative side is switched. Not an item that I would ever consider using!!
 

MisterBill2

Joined Jan 23, 2018
27,186
Also, agree with other statement " Personally, if it were my project I would use a 12-volt fan and power both the heater and fan from the 12-volt supply switching the high side (positive) with the relay."
That switching module ONLY switches the NEGATIVE SIDE!! look at the photos showing the underside of the PCB.
 

wraujr

Joined Jun 28, 2022
259
That switching module ONLY switches the NEGATIVE SIDE!! look at the photos showing the underside of the PCB.
You misread as I said "high side (positive) with the relay". I obviously was referring to the original post that uses a relay module. The relay is best as it could switch negative or positive side. And as stated, better to use 12V heater and 12V fan and switch positive side with relay mode. See no need for MOSFET switch module when TS has perfectly good relay module.
 

MisterBill2

Joined Jan 23, 2018
27,186
The other question is why is there a processor involved??A simple thermostat, humidity sensor, or a timercould do the job. And probably switch the power directly.
 

panic mode

Joined Oct 10, 2011
4,866
LOOK!!! at the solder side of that switch module in post #9!!! The positive side is not switched, but the negative side is switched. Not an item that I would ever consider using!!
Never? Not a fan of either but... You would refuse even if that is a requirement? What if i told you that half of the world does it...

If you travel to other countries would you insist on driving on "your side" of the road regardless of what they have adopted?
 

MisterBill2

Joined Jan 23, 2018
27,186
I have done equipment for those who demand both sides be switched, I see no problem with that. AND, for home AC compressors using 230 volts it makes sense to switch both hot sides, even though the idiots let them switch only one side. And the incredibly stupid rule is that they only need to switch 2 of the 3 phases to an AC compressor. But consider that very often the supply negative is tied to "ground" as common. At least in most cars and trucks. So switching the negative side of a device may not really switch it off. That could provide a bit of excitement .
So what part of the world does require that even an isolated circuit must not be isolated?? Consider that"ground" is the widest non-isolated Common that there is.

And when I was in the UK, where they drive on the "other side" of the road, I chose to refrain from driving, because I knew that at some point of fatigue, 35 years of instinct would take over, and problems could develop quickly.
 
Last edited:

panic mode

Joined Oct 10, 2011
4,866
Ah... but now you are changing the language and mentioning ground. previous post was about switching negative side and that is what i was teasing about...
all automation in Asia is using switching of negative side (that is the "hot" side). in western world one hardly sees that in industrial equipment, except in plants run by Japanese companies (Honda, Toyota...). there DC supplies get positive rail tied to ground.
 

MisterBill2

Joined Jan 23, 2018
27,186
One additional consideration is that with the processor powered from the same source as the fan, a startup current surge is probably momentarily dropping the processor supply long enough to cause a reset to happen. Powering a motor off the same source as a processor will often cause a problem like this.
 
Top