Notifications
Clear all

[Help wanted] add LED to OctoPrint  

  RSS
SM26
 SM26
(@sm26)
Eminent Member
[Help wanted] add LED to OctoPrint

Hello folks,

 

I hope that I write my question in the appropriate section.

 

My setup:
Prusa mini

Pi 4, 4gb - OctoPi 0.17

For the LED I'm using, it's something generic, with 4 wires (RGB&Ground?)

In order to control the LED stip from the PI I'm using this module

I plugged my pi into the input ports

  

In octoprint i've added the Enclosure plugin

 

pinout

but from then on I'm stuck

 

no matter what pins I try, I can't get it to light up

the most I've got is, when the toggle is in the off state, only the red color lights up.

 

pin #2 & 14 are used for my fan.

from the module ground to #9
VCC - red wire - #11
DIN - green wire - #13
CIN - blue wire - #15

 

I've also tried other plugin but over there I can't get nothing to work.

I've also tried to follow this guide to no avail.

 

 

My end goal is:

When the printer isn't printing, LED are off.
When something is printing, LED are white.

When the printer is finished turns Green.

 

 

any help would be much appreciated.

Posted : 08/11/2020 5:34 pm
karl-herbert
(@karl-herbert)
Illustrious Member
RE: [Help wanted] add LED to OctoPrint
Posted by: @sm26

Hello folks,

 

I hope that I write my question in the appropriate section.

 

My setup:
Prusa mini

Pi 4, 4gb - OctoPi 0.17

 

For the LED I'm using, it's something generic, with 4 wires (RGB&Ground?)

 

In order to control the LED stip from the PI I'm using this module

I plugged my pi into the input ports

 

  

In octoprint i've added the Enclosure plugin

 

 

but from then on I'm stuck

 

no matter what pins I try, I can't get it to light up

the most I've got is, when the toggle is in the off state, only the red color lights up.

 

pin #2 & 14 are used for my fan.

from the module ground to #9
VCC - red wire - #11
DIN - green wire - #13
CIN - blue wire - #15

 

I've also tried other plugin but over there I can't get nothing to work.

I've also tried to follow this guide to no avail.

 

 

My end goal is:

When the printer isn't printing, LED are off.
When something is printing, LED are white.

When the printer is finished turns Green.

 

 

any help would be much appreciated.

To control the GPIO's there are some very practical tools:

wiringpi

pigpio

sysfs

I personally use wiringpi and some selfmade bashscripts to control the enclosure ventilation, light, temperature measurement...

Statt zu klagen, dass wir nicht alles haben, was wir wollen, sollten wir lieber dankbar sein, dass wir nicht alles bekommen, was wir verdienen....
Posted : 08/11/2020 7:00 pm
bobstro
(@bobstro)
Illustrious Member
RE: [Help wanted] add LED to OctoPrint

That control module looks like it's expecting 5v inputs based on this description:

Suitable for 5V MCU system, Suitable for Arduino UNO R3 and compatible motherboard

.The Raspberry Pi GPIO outputs are 3.3v. You might need a level converter.

My notes and disclaimers on 3D printing and miscellaneous other tech projects
He is intelligent, but not experienced. His pattern indicates two dimensional thinking. -- Spock in Star Trek: The Wrath of Khan...
Posted : 08/11/2020 7:18 pm
Gordon W
(@gordon-w)
Reputable Member
RE: [Help wanted] add LED to OctoPrint

 What voltage is your LED strip, are you sure it's 12v? How many LEDs are in the strip and what is the max current output of your 12v supply?

Posted : 08/11/2020 9:45 pm
Diem
 Diem
(@diem)
Noble Member
RE: [Help wanted] add LED to OctoPrint

Are you sure those are RGB LED's?  If you don't have the data sheets you need to check what you've actually got ... there are a lot of single-colour strips (usually white, for shop-fitting and cabinet lighting) that use the same four-pin connections.  Most of them are 12v,some are 5v but if they're specifically designed for another application they could be wired for almost anything.. 

If they are cuttable strips (scissors marked) they are probably 12V.

Cheerio,

Posted : 09/11/2020 12:13 am
SM26
 SM26
(@sm26)
Eminent Member
Topic starter answered:
RE: [Help wanted] add LED to OctoPrint
Posted by: @gordon-w

 What voltage is your LED strip, are you sure it's 12v? How many LEDs are in the strip and what is the max current output of your 12v supply?

12V, it say so on the LED strip.
How many? a lot, about 6 meters of streep.
and now that you mentioned it, my power supply is utterly inadequate.

 

Ok, Let's try this again.
I've cut the strip down, now it has 24 LEDs, about 25 cm.
I've changed my power supply to 12V 1.5amp. (QC3.0)

 

should I connect all the wires the same as before?

Posted by: @diem

Are you sure those are RGB LED's?  If you don't have the data sheets you need to check what you've actually got ... there are a lot of single-colour strips (usually white, for shop-fitting and cabinet lighting) that use the same four-pin connections.  Most of them are 12v,some are 5v but if they're specifically designed for another application they could be wired for almost anything.. 

If they are cuttable strips (scissors marked) they are probably 12V.

Cheerio,

I'm not sure about RGB, but I'm sure about the R. I definitely saw it lit up in red.
No idea about any other color.
And at the very beginning of the strip, it say 5050-60. so SMD5050?

Posted : 09/11/2020 10:54 am
SM26
 SM26
(@sm26)
Eminent Member
Topic starter answered:
RE: [Help wanted] add LED to OctoPrint

I can't edit my original post, so here is an update:

 

I've connected it as follow:

Ground - #9
VCC - #4
Din - #13
Cin - #15

in the plugin, I've changed the output type from Regular io to RGB LED Srip

 

Now I get consistent results!

I can set color, and it works fine

 

as long as I only pick red.

 

So, how can I troubleshoot it?
LED strip of module?

Posted : 09/11/2020 1:31 pm
Gordon W
(@gordon-w)
Reputable Member
RE: [Help wanted] add LED to OctoPrint

I don't think you want to connect VCC between the Pi and your board, if you are powering the board with 12v then "magic smoke" might result. You do need a common ground though.

Your next problem is that the board you have is expecting 5v signals and the Pi is outputting 3v signals, it MAY work, but it could be intermittent or not work at all.

I'm not familiar with the plugins you are using, but you need to connect the clock in and data in on your board to the Pi pins the plugin uses for Clock out and Data out.

You may find it easier to forget about the Arduino add on board and research ways of connecting your LEDs to the Pi.

 

 

Posted : 09/11/2020 5:17 pm
karl-herbert
(@karl-herbert)
Illustrious Member
RE: [Help wanted] add LED to OctoPrint

I switch the light (230V) with this relais 3.3V over the Pi GPIO's. The whole thing is controlled with wiringpi and a bashscript. So I do the same with the enclosure fans and MK3 power on/off.

 
Statt zu klagen, dass wir nicht alles haben, was wir wollen, sollten wir lieber dankbar sein, dass wir nicht alles bekommen, was wir verdienen....
Posted : 09/11/2020 6:43 pm
SM26
 SM26
(@sm26)
Eminent Member
Topic starter answered:
RE: [Help wanted] add LED to OctoPrint

Ok, this is turing to be harder than I thought.

 

I think I should start over,

Dordnung.de seems doable,

as for the Mosfet part, I wish to have a bit more clean solution

could I use a board like this?
https://www.aliexpress.com/item/32714752044.html

If I'll buy three of those, what should the wiring be?

Thanks in advance

Posted : 10/11/2020 4:58 pm
SM26
 SM26
(@sm26)
Eminent Member
Topic starter answered:
RE: [Help wanted] add LED to OctoPrint
Posted by: @karl-herbert

I switch the light (230V) with this relais 3.3V over the Pi GPIO's. The whole thing is controlled with wiringpi and a bashscript. So I do the same with the enclosure fans and MK3 power on/off.

 

Do you this this will do the same job?

Posted : 12/11/2020 11:40 am
karl-herbert
(@karl-herbert)
Illustrious Member
RE: [Help wanted] add LED to OctoPrint

@sm26

Is basically the same, only that you can theoretically perform 3 independent GPIO switching processes.

Statt zu klagen, dass wir nicht alles haben, was wir wollen, sollten wir lieber dankbar sein, dass wir nicht alles bekommen, was wir verdienen....
Posted : 12/11/2020 4:06 pm
örkelprint
(@orkelprint)
Eminent Member
RE: [Help wanted] add LED to OctoPrint

Hi @sm26

How do you control the module? Apparently if you buy it you will receive some arduino code which guides you how to actually control it. It has two control pins (cin, din). It doesn't work by just setting the pins high, it expects some pwm or similiar.

Apart from that it needs 5V on VCC, not 3.3V (no problem, PI has 5V out). The GPIOs only have 3.3V level, but the data inputs probably work with 3.3V as well, but not guaranteed.

Posted : 21/11/2020 2:21 pm
SM26
 SM26
(@sm26)
Eminent Member
Topic starter answered:
RE: [Help wanted] add LED to OctoPrint

Ok, I'm back!

I've got 3 of those:
https://www.aliexpress.com/item/32714752044.html

 

Each module gets power from DC into VIN & GND

Then V- goes between every module and the strip ground.
V+ goes from each module to one color on the strip.

GPIO17 for red SIG
GPIO22 for green SIG
GPIO24 for blue SIG

And also each module is wired to the Pi ground as well.

VCC is left out for all of them.

how wrong am I?

Posted : 23/12/2020 4:26 pm
örkelprint
(@orkelprint)
Eminent Member
RE: [Help wanted] add LED to OctoPrint

The LED strip has no permanent GND. It needs permanent +12V while GND is the switched connection. This means one V+ needs to go to the strip +12V and 3 different V- to the R,G,B pads.

 

I am also pretty sure that your first setup would have worked with the correct code, which would be more elegant than using 3 mosfet boards.

Posted : 23/12/2020 6:55 pm
SM26
 SM26
(@sm26)
Eminent Member
Topic starter answered:
RE: [Help wanted] add LED to OctoPrint

@orkelprint you are right!

now that I've swapped GND and +12V, it works!!

Now for optimization.
From my wall, I use a phone charger to get USB-C, then cable to this little thing. and from there I got power.
that sounds like a double conversion to me... 
I found a slimmer 12V 1amp power supply, for my low led count, it seems to work!

Next, we need to print a housing for this mess, a remix I like (of IRF520 mosfet triple holder by brotherchris)

More pictures to follow.

Posted : 15/02/2021 3:55 pm
Share: