RGB LED colour control circuit designed around an Arduino Nano with one knob per colour
1h 44m
1× print file
0.20 mm
0.40 mm
33.00 g
3
8
0
87
updated December 8, 2024

Description

PDF

This is a simple case to mount three potentiometers and enclose an Arduino Nano and a couple of JST XH 2-pin and 4-pin connectors. If you'd like to build and program the circuit I've displayed in the photos read on!

I was looking for a way to control the individual brightness of each channel of a single RGB LED, so I designed this control box around an Arduino Nano along with the code the Nano runs. It's quite a simple circuit using minimal components and could easily be expanded using three MOSFETS, one per channel (R/G/B), and a stronger power supply to control one or more RGB LED strips.

We'll only be using three inputs and three outputs for this project of the available 21 programmable pins on the Nano. In my code I've chosen to use A0-A2 for the inputs, and D9-D11 for the outputs. I've included two versions of the schematic to pick from depending on your requirements:

The first, as I built, where the LED is powered directly from the Arduino; this is only suitable for low-current use-cases, such as driving a single RGB LED:

The second which uses the Arduino to control MOSFETs to allow far more power-hungry LED strips or other loads such as a fan or motor (add flyback diodes for inductive loads!):

I have not included values for the resistors on either version of the schematic as you should calculate these based on your LEDs current requirements and supply voltage (5V for the first circuit, 12V or your DC source voltage in the second). There are some very handy LED resistor calculators online.

The connectors used in this project are JST XH 2-pin and 4-pin from a DFRobot kit. As this was designed to use parts I had in my salvage bins I don't have direct links to suggest for suitable potentiometers. The main dimensions you'd need to search for would be a shaft width of 9mm or less, at least 6mm of threads on the shaft, and less than 22mm wide.

EDIT (2024/12/07): I have tried out a few new potentiometers and while they aren't perfect, this kit fits well enough for all but the roughest uses. They also include the coloured knobs I've changed the cover photo to!

If you've made it this far, thank you for checking out my project! You can find my code on its GitHub Repo and the 3D design files for the lid and bottom of the part are freely available in OnShape (Lid, Bottom). Feel free to make a copy and remix if you need to make any changes to the models to suit your circuitry or potentiometers.

Caution: One should take care when powering any Arduino board via the Vin pin and ensure they're supplying it with a voltage it can handle (7-12V for the Nano). See Arduino's Documentation for the particulars of your board if you're not using a Nano. Be careful of cheap 12V wall adapters, as they may put out more than 12V when lightly loaded, which could damage the Arduino. To be extra safe one could use an LM7805 linear voltage regulator or similar which can produce a stable 5V line from as much as 30V or so.

Tags



Model origin

The author marked this model as their own original creation.

License