Once you've got your driver wired up, connect the MOSFET gate inputs to the Arduino digital output pins: D9 for the green channel, D10 for the red channel, and D11 for the blue channel. It would certainly be faster than soldering up everything on a proto board, but less permanent. But for better or worse, it works, and it's a quick and dirty way to get a solid prototype or one-off done. Honestly, I hate it, and I'm not good at it. I won't go into the details of how to solder up proto boards. Make sure you keep track of which transistor connects to which LED color channel. The pin on the right (pin 3) is the source, and is connected to ground. The pin in the center (pin 2) is the drain, and connects to LED strip color channel. The pin on the left (pin 1) is the gate, and will connect to an Arduino digital output pin and the resistor (the other end of the resistor should connect to ground). If you're confused about what to connect where on the IRLB8721 MOSFETs, hold one in your hand with the front facing you as shown in the photo above. The Arduino offers pulse-width modulation on some of its digital outputs, so we'll use those outputs (specifically D9, D10, D11) so that the intensity of each color channel can be controlled. The gates will be connected to Arduino digital outputs, and the resistors provide a pull-down that ensures each MOSFET switches fully on or off as needed. ![]() So, we'll be connecting the drain of the MOSFETs to the LED color channels, and source to ground. The LED strip is common anode, meaning +12V is sent to the LED strip, and the red, green, and blue LED channels are controlled by providing ground on the respective connection to the strip. It uses an IRBLxxx N-channel MOSFET for each channel on the LED strip. If you've got vendors you like better, by all means support them! Requisite disclaimer: the links above are provided for your convenience and are not an endorsement of any product or vendor nor do I profit from any purchases made at these links. 12V power supply - choose a wattage appropriate for the number of LEDs you plan to drive.A 12V RGB LED strip (SMD 5050) ( Adafruit, Amazon).One small proto board (my first was 1/4 size-choose any size you can work with comfortably) ( Adafruit, Amazon).Three 220 ohm resistors ( Amazon, Mouser).Three IRLB8721 N-channel MOSFETs ( Adafruit, Amazon, Mouser).One Adafruit Trellis board and silicone button pad ( Adafruit).One Arduino Uno or Nano (these instructions are for Uno with female headers installed, but Nano on a breadboard works fine) ( Adafruit, Amazon, Mouser).So, to recap, here are the basic hardware needs for this project: ![]() These are simple LEDs, like SMD 5050s, not fancy individually-addressable ones (no NeoPixels, etc.)-that's another project! You also need a 12V power supply large enough to drive the number of LEDs you intend to use. And of course, you'll need an LED strip to drive pretty much any plain 12V RGB LED strip will do. The driver uses three IRLB8721 MOSFETs and three resistors. ![]() Instructions and files for building the shield are included in the last step. I quickly realized that I needed something neater and more contained on their desks (a bare Arduino and proto board banging around would be too fragile), so I made my own shield to drive the LED strips. You can do the hardware part of this project on a small proto board, which is how I did my prototype. The Trellis uses I2C to communicate, so it requires only two I/O pins (data and clock) to control 16 buttons and 16 LEDs. I used 2 red, 2 green, 2 blue, 4 yellow, and 6 white. To build this project like mine, you'll need a handful of 3mm LEDs. It doesn't come with any LEDs mounted, you need to supply them, but that gives you the flexibility to choose the colors you want (and keeps cost and complexity down vs building in addressable LEDs). That's a great deal for a 16-button 4x4 matrix with LED capability. First of all, it's a mere $9.95 for the board, and another $4.95 for the silicone elastomer button pad (prices as of this writing). The Adafruit Trellis is one of my favorite new toys from Lady Ada and crew. I'm going to show you how to build this simple, programmable RGB LED strip controller using an Arduino Uno (or Nano), an Adafruit Trellis, and a handful of other parts. I also thought it would be a great opportunity to create a teaching tool for them that they could use to sharpen the programming and electronics skills I've been teaching them. My sons wanted color LED strips to light up their desks, and I didn't want to use a canned RGB strip controller, because I knew they'd get bored with the fixed patterns these controllers have.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |