LEDs For Your 3D Printer - How To - Chris's Basement

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
today we install RGB LEDs you can control with your 3d printer we all know that adding LEDs to things makes it cooler but with your 3d printer it can be somewhat useful as well you can change the color of the LED based on your printer status and a lot of that is already baked into marlin there's a color scheme that all you have to do is plug in some pins from your mainboard where your RGB lines are plugged into and it'll take care of the rest but you can also control them with manual g-code commands if you wish and you're starting in g code for example now as with everything there's some things you need to watch out for when you're setting something up like this I'm using 12 volt LEDs but no matter what LED you're using you can't power them directly from your printers main board that will fry your mainboard there's not enough current so we need to add in something like a MOSFET to step that up now you can power them directly from your 12 volt supply if you have a 24 volt supply you can get a pretty cheap converter to reduce that down to 12 volt if you need to but today I'm gonna walk you through all the steps of setting up the pins for your RGB LEDs getting them powered hooking them up to the MOSFET and then controlling them with g-code and Marlin so let's not waste any more time let's get into it so for this tutorial we're going to be doing a couple things I am taking these RGB LEDs I got off Amazon they're pretty affordable and I will be able to control them with my printers main board I'm gonna be using these small MOSFET modules you can get these for less than 50 cents a piece on Aliexpress definitely buy a few extras just in case something happens we really only need three one for each color red green blue and I want to mock the whole thing up before we take it to the printer because in the printer right now I have a mini Rambo board and my pins are limited but I want to show you on a ramp setup because this is going to be closer to a lot of the boards that you're gonna want to use also for this setup I'm going to be using my bench top power supply to provide 12 volts you're gonna want to get 12 volts directly from your printers power supply or step-down the 24 volts if that's what you have you can probably just tag it here on the main terminal if you need to run this over to your MOSFETs the only problem with this setup is it's quite large you have to find a place to put all these MOSFETs and the wiring that you're going to so it might not be the best solution for an existing printer but you could definitely build this into a printer build if you'd like to or even enclosure lights would work well so this setup will show you how to get everything working but you might want to consider creating a smaller PCB to integrate your MOSFETs in your light control so let's start with the LED strip mine came with these DuPont connectors in fact there's pins just in the end of this you can take this off and use the female in if you like that's what we're going to do because I'm just going to connect it with jumpers for this mock setup but you can cut these strips and just sawed it directly to the tape if you'd like on those terminals so the colors will associate to the color of LED blue red green and then you have your common wire which is white so I'm just gonna extend these out with some jumpers we've got our jumpers on now we'll cable up to the MOSFETs let's go ahead and provide 12 volts let's just call these MOSFETs red green and blue it doesn't matter which one just to make it simple for this video on this side of the terminal the VI in and ground this is where your 12 volt is going to come in and you can just chain the 12 volt supply so we'll plug it in here for the power supply and we'll just run it over to these other two MOSFETs so there's the power and ground from the power supply there's my ground chain down to the other MOSFETs and I ran out of red jumpers so I had to use white to chain the power 12-volt in down to the other MOSFETs just like so so now we have our LED strip we have our 12 volt in here this white wire and then we have a ground wire to make the connection for red green and blue so we're gonna start by adding the 12 volt wire to one side of this MOSFET bar I'm gonna put it over here on this side it doesn't really matter which v+ that you put it in but it needs to go in this v+ terminal so I'm gonna set mine right here and again we're gonna call this MOSFET the red MOSFET so in the V negative terminal I'm gonna set the red wire for the LED strip right there that means this MOSFET will control the red portion of the LED and then on the second MOSFET and the V negative I'm going to put the green wire for the green portion of the LED and the third MOSFET in the v- spot i want to put the blue wire for the blue portion of the LED now just for a test let's cable a jumper up to the signal line on each one of our MOSFETs red green blue make sure your leads aren't touching anything currently we don't want to short anything out and let's turn on our 12 volt power supply so just to show you how this works when the main board turns this signal pin to high that will turn the MOSFET on and let the 12-volt current flow to your LED strip so to simulate that pin going high we'll take the signal wire for our red LED MOSFET and we'll make it go high 12 volt let's stick it right here you can see we're red same for the green we'll make it go high now we're green and final test we'll make this one go high and now we're blue so we know all three sections of our LED are working and our MOSFETs are set up correctly and this setup will work as long as your main board and your MOSFETs share the same ground this configuration should work just fine so now we need to cable up to the main board so we can control it with pins and ultimately control it with the software so we've got our typical ramp setup and we just need to pick a couple of pins to use for our red green and blue signal pins let's go with the augs two pins right here because those aren't used by your LCD screen those should be open on most boards so the signal wire for the red module let's go with pin 40 that's the center pin on the augs 2 on the top row right there and for the green signal wire let's go with pin 42 that's right next to it right here and for the blue signal wire let's go with the pin below that that's pin 44 and the power for the MOSFETs and my board for this test are going to be from the bench top power supply so I'm going to cable up some wires from that power supply to my main board here's a look at this mess just to give you an idea of how it's set up don't do this configuration this is just for testing I'm using a bench top power supply I will provide you with a diagram of how you want this set up you want the MOSFETs and your printers made more to be using the same power and ground and always use the correct gauge of wire to power your mainboard the small gauge wire for the LEDs should work just fine there's not a ton of current there now I'm cabled up to the Rams USB let's head into Marlin and see about getting these configured as always this Marlin has been configured to work on this 3d printer we're just altering this configuration to use the LEDs for this video so let's go into configuration dot H you can do a control F and search for RGB and here's the RGB controls section we're using just the red green blue LEDs not red green blue white so we're going to uncomment this line and down here is where you can set the pin assignments so for our red LEDs we used pin 40 for our green LED we use pin 42 and for our blue we use pin 44 and that's all the changes we should have to make in Marlin to get it configured so let's go ahead and go to tools we'll select our board this is a mega 2560 hi I'm on comm 3 and we'll hit upload and when the upload is complete let's go ahead and test it out now just for this test scenario I do have a thermistor hooked up to t 0 because if you don't get a reading on temp it's going to hit thermal runaway automatically so just for a test I've plugged in this thermistor I'm hooked up USB and I have the benchtop power supply currently off but I'm getting ready to turn it on so it powers the main board and all my MOSFETs so let's open up pronterface and get into a terminal let's connect up to our board com3 250000 we're connected and if we do m150 B that turns on the blue full-blast we can set B to 0 to turn blue off m150 our red full-blast our 0 to turn it off and 150 you for green fold last 0 to turn it off so we've got it up and working where we can turn the pins on and off like digital on or off but you can also set the intensity but you need a feed of um pin basically a pin that's a digital pin that's treated kinda like analog and there are some of those available on the RAM sport especially the servos there are a few others but we're going to go for the servo pins so let's switch over to pins 4 5 & 6 that will allow us to use the Marlin color scheme so when your bed or your hot end or heating up the color intensity will get brighter and that's something I definitely want to test so let's set that up now so let's move our red LED pin to pin 4 which is this first servo pin right here let's move blue to pin 5 the one right next to it and then green to pin 6 the one right next to blue so back into Marlin we changed our red pin to pin for our green pin to pin 6 and our blue pin to pin 5 and we can go ahead and re-upload now the upload is complete let's head back into the terminal we'll connect back up let's do an m1 50 be hit enter blue is on full blast now let's do an m1 50 B 90 blue is a lot less bright so we have 150 b 90 let's do 150 b 90 or 150 now we have pink let's turn red up to 255 bright pink so using the pwm pins it just gives you a little more creativity on how you can use the leds most of the times the digital pins will probably be just fine but I wanted to see how this was going to work so now we know we can control the intensity of the LED with a PWM pen my only problem now is the current configuration of log is using a mini Rambo board and it has no open PWM pins but what you can do is the minimum in stop pins are PWM pins so you can switch your minimum and stop plugs in the software to use the maximum pin and then the minimum pins will be open to control our LEDs so that's what we're going to do now so I'm going to take the minim and stop Meijer and move them to the maximum pins which are right above them and with my minimum in stop pins open I'm going to use the bottom pin or the third pin that's the single pin for all of my rgv so I'll just do red green blue this is X Y Z there's my RGB pins and for the power for the LEDs I'm just going to plug in the MOSFET board into the existing plug on the power supply I'm just gonna piggyback on for this configuration you probably want to splice it in if you're doing this permanent like so and then I'll plug it back in its hacky I know it our wiring is done now we need to do some Marlin configuration so let's head in or a pins file and reassign these pins this is pins mini Rambo we'll scroll down to the end stop section so our minimum in stop pin is now 30 because that was the max pin and our max and stop pin will become negative one because we're going to use it for our LEDs minimum in stop pin same thing 24 and our Y max will become negative one to disable it because we're going to use it for LEDs and same with the Z minimum and stop pin will go to the maximum 23 and maximum will get disabled now we can take these values and plug them in for our LEDs so our X minimum in stop pin was 12 that's where our red LEDs plugged in so let's jump over configuration H our red LED pin becomes 12 back to the pins file our green LED is plugged into 11 that's where our minimum in stop used to be and our z is plugged into 10 that's where blue is so back configuration dot H change green to 11 blue to 10 and that should be all we have to do so let's go ahead and verify verify looks good let's go ahead and hit upload tools now we're on a mini Rambo comm 15 upload and when that upload is complete now we can start a print the LEDs will come on and they'll be blue and it's cold when the bed starts to heat they'll go to violet and then when the hot ends they'll go to violet to red now the bed's up to 10th we're at violet the hottie is almost the temperature we're getting ready to go to red now we're red up to Tim and when the print starts we go to white now we should be white during the whole print when the print completes the LEDs go green and then the LCD waits for you to click to resume if you click LEDs go off now we can do the same kind of thing and start an ng code instead of using Marlins schema but it's probably a good idea to comment their schema out before you try to build yours you can just comment out this line and re-upload so when the print starts let's turn all the LEDs to blue m150 be 2 5 5 then we're gonna set the temp for the extruder and the heated bed and we'll wait for the bed to get up to temp then when the bed's up to temp let's change over to kind of a red violet color m150 are 255 you 153 be 51 you can look those colors up I'll leave a link to a calculator below then we'll leave it that color while we're waiting for the extruder to finish getting up to temp again we'll do an M 400 just to be safe we want to make sure everything's been ran and when the extruder is up to temp will switch over to red and 150 are 255 B 0 u 0 and then we'll start our homing and our leveling procedure and then M 400 again to make sure everything's been ran and then during the print we'll switch everything over to white so M 150 are 255 u 255 be 255 and then we'll do our priming and then we'll start the print and then when the prints complete we'll switch to green in 150 you 255 b 0 r 0 we'll throw a weight in there and then we'll turn that extruder temperature off and we'll move the printhead up with this line then we're going to use the M 190 command or 35 that sets a cooling for the bed temp so we're waiting for the bed to get down to that temperature again M 400 to make sure all those commands are completed and then when your beds down to the 10th and your parts ready to remove let's set the lights to blue and 150 255 R 0 u 0 then we'll go ahead and turn the bed off completely turn the fan off we can leave the fan on during that procedure to help cool the band that's the part fan then we'll move the y-axis out to 200 to help us remove the part we'll disable the motors then we'll do a g4s 600 to wait for 10 minutes 600 seconds then we'll leave the blue line on long enough so we know that it's time to remove the print and then we'll run an M 150 R 0 u 0 B 0 to turn all the LEDs off you can do this same kind of thing with m42 this just sets a penn state so you can set any pin you can set it from 0 to 255 if it's a pwm pen but you have to set each pin red green and blue so you'd have to enter 4 commands with the m150 command it's designed to control leds so you can do it all in one shot I just think M 150 is easier but you can still do the same thing with M 42 so let's say if we wanted to do M 42 we'd have to do M 42 P 6 P 5 and P 4 and set that intensity 0 through 255 to get the right mix of color so let's try it out with our new start and end g code I've loaded up the print let's print from SD print starts we're blue the bed is heating the hot end is heating the band's up to temp we're kind of at our pink violet color extruders up to 2 so we're at our red color we're gonna home and level the print has started so now we're going to the white color the print is complete so we're gonna raise the Z we went to our green color now we're waiting for our bed to cool down to 35 our beds cooled down so we've moved our Y position and now we're on blue and now we're just in our g4 command waiting for the LEDs to turn off and the LEDs are off and there you go custom LEDs for your 3d printer and you can do it a couple of different ways you can let Marlin control it or you can do it and you're starting in g code and get as creative as you want again you can use the m42 command to set pin status or I think the m150 command is a lot easier now this is a lot of work for LEDs but it might be something you want to look at when you're building your next printer or maybe integrating it into your enclosure it could be really handy to get a status at just a glance I hope you like this video or you found it helpful if you did please consider giving it a thumbs up or subscribing to my channel if not leave your thoughts in the comments below and as always thanks for watching
Info
Channel: Chris Riley
Views: 29,758
Rating: undefined out of 5
Keywords: 3D, printer, Printing, 3D Printing, 3D Printer, ChrisBasement, ChrissBasement, Chris'sBasement, Chris Basement, Chriss Basement, Chris's Basement, ChrisRiley, marlin, leds, m150, m42, led gcode, lights, 3d printer lights, 3d printer leds, led, LEDs For Your 3D Printer - How To - Chris's Basement
Id: ONyxRprg-Ag
Channel Id: undefined
Length: 17min 55sec (1075 seconds)
Published: Wed Apr 10 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.