Thoughts on this setup?

Hi guys!

I have this setup in mind and maybe some of you can share their opinion on it.

I have a infrared heating panel on the ceiling, which is currently controlled with a zigbee plug.
I want to add a white light led strip to the edges for some soft indirect lightning. I was thinking a lot about it, buy controller? Keep zigbee plug? 5v led? 12v led? ESP8622? But then I need a step down module again? Etc…
The final design is now made up with one cable coming from the plug. Inserting in a installation junction box, split to a relay which powers the IR panel, the other split out again to an 12v led driver. Next to it the other junction box, insert 12v line, split, one into an esp8266 board that can be driven by 12v. From esp out to other box ground and data signal for relay. The other 12v line into a mosfet module, receiving pwm signal from esp and finally out of the box to the led strip.
I use two junction boxes because one there’s simply not enough space for all parts, second I want it to be safe and sealed and third thus I can separate 230v and 12v parts and junctions.
The parts I use:
Relay: regular relay
Junction box: something similar to this

Thank you for your words!

Note: I’m not a professional circuit drawer

What is the relay for? Is the D1 using it to turn the IR heater on and off?

Exactly this

Technically there isn’t much to say to this, it checks the most important boxes. Also good physical separation between 12V and 230V. Couple of thoughts:

  • Make sure the relay part is well insulated. And don’t use some cheap Chinese relay from Ali. Use something from Mouser or similar. You don’t want to start a fire in there.

  • Did you check if the D1 can source the power draw of the relay coil? You might have to add another small mosfet or BJT to drive the relay.

  • How far are the two junction boxes separated ? If more than a meter or so, use shielded cable from the D1 to the relay. You might be surprised by the amount of voltage induced into non shielded low voltage lines by coupling when 230V lines are nearby.

  • For the LEDs, are you using an existing prewired MOSFET module or are you using a discrete MOSFET ? For the latter, there’s a lot of things you have to consider when choosing a MOSFET that works for a particular situation (gate voltage, source-drain resistance, etc).

1 Like

Thanks @HeyImAlex for the answer!
Regarding the relay: I want to use the “regular” relays for 220v and 10a max. The heater draws 1200 watts so I should be safe there. And yes, should be fine with the esp pin. Either from Amazon or from berrybase in Germany. First one has reviews, latter one reputation :smiley: so let’s see.
The junction boxes are right next to each other, probably a finger wide gap.
For the LED I will use an IRF520 module. Copied from other projects. I do not know toooo much about them, but should be fine. From the picture I saw SMD resistors. But concerning the mosfet itself, I would have just tried it I guess.


Are you sure ? The ESP can source max 12mA per GPIO. That’s an awful small amount to drive a coil for a relay, especially a larger one with 10A contacts. While it depends on the specs, a coil for a relay like that will typically draw something like 30mA to 50mA, sometimes even considerably more.

The IRF520 is not a good choice for your setup (spec). This is not a logic level gate drive MOSFET, but a regular mosfet with a VGS of 10V. That means that you need to supply 10V to the gate in order to ‘open’ the drain-source channel completely. You can’t do that with an ESP. So your mosfet will be partially open, heating up a lot and not providing the full voltage to the LEDs. You will then need another small logic level gate mosfet to provide the higher gate votage to your power mosfet.

For your use case, a MOSFET with logic level gate drive is much better, like for example the IRLZ34N (spec here). Its drain to source channel pretty much opens completely at 4V already (0.06 Ohms).

Ok, good you mentioned this. I looked it up, the relay I would have used needs 15-20mA. So 3mA to much…
I need to have a look again, same for the mosfet.
I want it to be solid and reliable.

Really thank you for your thoughts, I will reply when I have more information.


Btw: I did not thought relays are such an issue. I was thinking of the D1 mini relay shield which obviously could be driven by esp and is rated for 220v 10a. In this case the shield wouldn’t fit, but nevertheless it seems like there isn’t just “the” kind of relay.

These kind of shields will have a small transistor onboard to drive the coil. That makes them easy to use, but the relays you’ll find on them are often complete garbage. You could just use a small mosfet yourself to drive a good quality relay. No need to over engineer it either. You can use the same mosfet type for both the LEDs and the relay if you have one left over.

for the led, why not use ws2812 or similar, control brightness and color digitally

@jpenyc because I don’t need colors. Would never use them.
The circumference of the panel is 4.5 meters. So I need a 5m strip. Simply white is much much cheaper than ws2812.

1 Like

So you mean drive a mosfet (like the one you mentioned) with 12v and signal from esp, then the 12v switch the relay on?
I need to think about it… I wanted it to be as easy as possible. With the previous mentioned mosfet module I would have just plugged it in.
The other option would be to simply keep the zigbee plug I have and buy a led controller that works with home assistant plugged into a multi plug power strip.


And it wouldn’t work :slightly_smiling_face: The LED would be underpowered and the difference in voltage that the LEDs won’t receive would be burned as heat in the mosfet. Depending on how much amps you draw of it (and whether or not the mosfet is counterfeit with worse specs, which is almost guaranteed on the kind of modules you linked too), worst thing is that the mosfet either dies after some time or catches fire.

Actually in terms of a full DIY build, this project is pretty much as easy as it gets. If you want a quality build that actually works as intended. Of course you can cobble together various parts that don’t really fit together, but don’t expect the result to be reliable. You’ll end up being disappointed with the result.

Yes, that’s another option.