I want to power a 12 V RGB LED strip (just the red and green LEDs) from a WeMos D1.
My plan was to use any of my relays I have laying around at home but it seems they are all 5 volt or more.
The D1 has a 5 volt pin, but is it safe to put that 5 volt to a digital input pin and have that act as ground?
What are my other options? 3 volt relays seems hard to find here.
Just a thought.
Wouldn’t it be possible to remove the relay and just use the transistor?
I would then have to use a NPN instead since LEDs have a common anode, and the grounding is what lights up the LEDs. But I assume I need to just “invert” the schematic?
Ok. Sorry about this.
But when I asked the question the LED strip was kind of irrelevant. But now that we (I) are talking about doing it without the relay the actual LEDs is important.
I’m using scrap LEDs from a roll of 5050 that I have laying around and I’m not going to use more than 9 LEDs, at most 12 LEDs.
Looking at specs it seems they use about 20 mAh per LED, so that means at most 240 mAh.
I created a ugly sketch in tinkercad to see if it works (a simplified version), and with a blink code the LED blinks.
I see your point!
That is a good suggestion and I would probably use it some other time.
But even though I’m only using red and green LEDs, that also gives me yellow (kind off).
And that is my plan, to be able to go from green -> yellow -> red with minimal wires and have it all in a tube.
(I know I can use neopixels but I don’t have any. And my plan is to use as much of the stuff I have laying around).
Do I need any diods in a setup like this to make it safe? Will the transistor need a heatsink?
Just make sure you drive the transistor on hard so it saturates the C-E junction. That means using a lower value base resistor like the 390 Ohm end of the 390R to 1K range I said earlier.
The collector emitter saturation voltage is 1V max so 0.24W dissipation at 240mA. Should be fine for a TO-92 transistor case. No heatsink required.