I am trying to power 3 led strips (in parallel) and use pwm to make the leds change colors.


My idea for this is to use 4 (possibly 5) I/O ports to be connected to the input of the power relay

( https://www.mouser.com/ProductDetail/Adafruit/3191?qs=A50fv7uxK7UJSQBi%252B9%252BHlA%3D%3D&gclid=CjwKCAiAg9rxBRADEiwAxKDTuqilwitS4hRS94J63TydHgmhdZo8sEMSf6e-uV1QMoTsdh08cvleGhoCJD0QAvD_BwE )

to provide it with 3.3V. The relay also states that when switched off, it draws up to 100mA. That would be the reason for using multiple ports to feed into the input of the relay as each pin can only handle a maximum of 25mA. The board to be used is: http://www.ti.com/tool/EK-TM4C123GXL (I know it's a little overkill but it's what my friend had and he didn't seem to mind to use it). I am also planning on putting some reverse-current limiting diodes on each connection from the pins to the relay.

I was then going to have the output of the relay, which is either 10A,240VAC or 5A,240VAC to this on-board power supply of 12VDC,3.8A https://www.trcelectronics.com/View/Mean-Well/IRM-45-12.shtml in order to provide 12VDC to the led strips in parallel. At maximum use case a single led strip will consume 1.2A, so that's why the 3.8A.

Does anyone see anything I'm overlooking or that doesn't seem right? I've never tried creating a portable higher voltage power supply setup like this before and was wondering if I was approaching a reasonable solution. The only thing that is really concerning me is the current output from the relay to the on-board power supply, because the power supply says the ac current input for itself should be around 1A and 5A output from the relay is far too much. Would there be a way to sink a desired amount of current output from the relay before it gets to the power supply?

  • \$\begingroup\$ relay also states that when switched off, it draws up to 100mA .... draws 100 mA from where? ... how much current is drawn by the relay solenoid when the relay is energized? \$\endgroup\$
    – jsotola
    Commented Feb 2, 2020 at 22:39
  • \$\begingroup\$ You DO NOT want to use that (or any other) relay to do PWM - that would kill the relay in no time, if it would switch at all. You require a transistor of some sort to do the PWM switching of power to the LED strips. You do the PWM switching on the DC feed to the LED strips, not on the AC input to the power supply. \$\endgroup\$ Commented Feb 2, 2020 at 22:47
  • \$\begingroup\$ @jsotola From the datasheet verbage it seems to me that the relay will draw less than 100mA while power on, but I don't have a vast background with relays. But I know that if it will draw 100mA when turned off I should probably be ready for that by using multiple ports to help take the strain off of any one I/O. \$\endgroup\$ Commented Feb 2, 2020 at 22:51
  • \$\begingroup\$ @Peter Bennett I'm not using the relay to utilize PWM; I'm just using the relay to help energize the on-board 12VDC power supply that will provide energy for the leds. The PWM will come from independent pins on the launchpad. \$\endgroup\$ Commented Feb 2, 2020 at 22:52
  • 1
    \$\begingroup\$ i think that you may be misunderstanding how the relay module is connected ... the relay solenoid (coil) is powered by an external power supply ... the microcontroller only controls the relay through the use of a transistor ... you only require one data pin to control the relay \$\endgroup\$
    – jsotola
    Commented Feb 2, 2020 at 23:01

3 Answers 3


the relay module you have chosen contains an inbuilt amplifier, a small current (less than 3mA) into the signal terminal is all that is required to turn the relay on. the module will the draw 100mA from the 3V terminal to operate the relay.

So your power supply will need to provide 100mA, but your Micro-controller only needs to source 3mA from its output pin

Datasheet page 9 shows the amplifier circuit comprised of a MMBT2222 transitor and a few resistors.

Whether it's 100mA when on or when off is entirely your choice, the relay has 3 output terminals and which you connect to your circuit will determine if the relasy needs the signal and consumes power to act like a conductor to act like a insulator.

your controller board can supply 300mA at 3.3V so some of that can be used to power the relay module (3.3V is close enough to 3V to not cause any problems for the relay)

the relay is not a power supply it's an electrically operated switch. you'll need to provdee an AC supply between 80V and 264V to run the meanwell power supply module and the have the relay output in series with one of the AC wires.

You haven't said where your 5V is coming from... but if it's produced from an AC supply the same Ac supply can be wired to the relay output and the meanwell module.


Don't reinvent the wheel

What you're looking for has already been invented and is already part of the bog-standard COTS kit for LED strips. It's called an amplifier. Like this, but there are a million of them.

The thing to keep in mind when working in LED strips is that they are positive GND or to be more precise, positive common. They did that for very good reason, though that won't be apparent at first. So you'll need to use a dollar's worth of transistors and resistors to invert your digital outputs to suit this module. The module pulls very little current from the inputs.

The relay won't work. At all.

The adafruit module has This relay at its core. That will never work because it's a mechanical relay. It has a 10ms close time and a 5ms open time, which means even if you cycle it continuously, it's impossible to PWM faster than 66 Hz, which is already highly visible and seizure inducing. For any amount of meaningful controllability, you'll have to be at more like 20Hz, and that'll make your space look like a Wang Chung video. Also you'll reach its cycle lifetime in 83 minutes. This type of relay is good for throwing a 24V/240V contactor to turn on a heater or pump.


Just follow the guide on the product page for the LED strip.

This guide on analog RGB LED strip control will show you how it works - you'll want a microcontroller with 3 PWM outputs, and 3 N-MOSFETs to control the power to each R/G/B element.

you hve to click next a bunch of times before they show any circuits.

Plugging MOSFETs into solderless breadboard seems kind of dodgy, but other than that the guide seems sound.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.