DIY Arduino LED Strip Dimmer


This report outlines the complete process of developing an electronic device, from the initial concept to the final product. It focuses on the design and fabrication of a printed circuit board (PCB) used for dimming direct current (DC) LED lights.
The first section presents the theoretical foundation of the project. It details how to approach a technical problem, formulate a project idea, and plan its execution. This is followed by the schematic design phase, where appropriate components are selected, and the circuit is drawn using a CAD tool. During this stage, challenges such as component availability are addressed, and the Altium design environment is introduced.
The final stages involve assembling the PCB and performing functional testing. The report also includes the source code for the microcontroller used in the system.
Overall, the development process is straightforward, making the project accessible to anyone with a basic interest in electronics. It offers a broad learning experience, is engaging to build, and has practical applications.
Supplies
Soldering iron
Soldering wire
Flux
tweezers
Solder wick
Working Principle


The described electronic system has a single key function: dimming direct current (DC) LED lights. This is achieved by varying the output voltage. A potentiometer is used to adjust the brightness level. It sends an analog signal to the microcontroller, which then uses an ADC (Analog-to-Digital Converter) to convert the signal into a digital value. The microcontroller processes this data and sends the appropriate output to both the LEDs and the display.
The display is configured to show visual feedback—segments light up depending on the selected brightness level. The first segment represents the system’s power status and is always illuminated when the circuit is active. The brightness can be adjusted in 8 levels.
Additionally, the display itself is dimmed using PWM (Pulse Width Modulation). This means the processor controls the brightness by switching the output signal on and off at a fixed frequency, varying the duty cycle (the ratio of on-time to off-time). This allows for efficient and precise control of the LED brightness.
The power supply circuit uses a step-down (buck) converter, which efficiently reduces the input voltage to the required level for the system.
Planing

The concept was further developed into a block diagram. This diagram provides a high-level overview of the circuit's operation without referencing specific components or wiring. It serves as a minimal schematic that greatly aids both in drawing the circuit in a CAD program and in understanding how the system functions. It is also extremely useful during troubleshooting, particularly when the circuit does not behave as expected and adjustments are needed.
The block diagram includes the inputs, the main signal processing stages, control circuits, and outputs. It is important to clearly indicate the direction of signal flow.
From the diagram, we can see that the circuit is controlled using a potentiometer. The potentiometer is connected to a microcontroller, which acts as the core processing and control unit of the system. From the microcontroller, the signals are distributed to various parts of the circuit.
One part of the system utilizes PWM (Pulse Width Modulation) signals, which are generated by the microcontroller's output pins. In this case, there are two PWM outputs. One is connected to a power transistor (MOSFET), which handles the output load. This is necessary because the microcontroller alone cannot provide the required current and voltage to directly drive the LED lights.
The second PWM output is used to dim the entire display. This allows the brightness to be adjusted, reducing power consumption and making the device less visually intrusive in its environment. However, the display cannot function using a PWM signal alone. This is where the microcontroller plays an essential role, sending specific instructions to control what is shown on the display.
Since the chosen microcontroller lacks a sufficient number of I/O pins, a SIPO (Serial-In Parallel-Out) shift register is used for interfacing. The SIPO chip converts a serial signal into an 8-bit parallel output, enabling the microcontroller to control multiple outputs using just a few pins.
Shematics

After creating the block diagram and selecting the components, the next step was designing the circuit schematic. For this stage, I used Altium Designer. The first task was to create or locate component libraries. When working with standard components that are frequently used in various projects, it's practical to either build a custom library or download one online and adapt it for better usability in future designs. All other components were selected based on specific needs. In this project, I primarily used existing libraries and modified them to suit my requirements. This approach significantly reduced the time needed to complete the electronics design. A major advantage of online libraries is that they often include 3D models of components, which are otherwise time-consuming and complex to create manually.
Once all the libraries were imported, the next step was to place and connect the components. For the power supply section, a standard reference schematic from the chip’s datasheet proved extremely helpful. It showed which components were required for the chip to function properly and how they should be connected. Some component values also required calculation, with guidelines provided in the datasheet. The most important calculated values were the resistances for the feedback loop. The required inductance value for the coil was directly available in a table within the datasheet.
Subsequent calculations were done for other components as well. When using an LED display, current-limiting resistors need to be connected in series. For this project, I selected a forward current of 5 mA per LED. I used 470 Ω resistors, as this standard value was the closest match to the calculated result.
For the base resistors of the transistors, high precision was not necessary. The only requirement was to ensure the transistors would fully switch on, as it functions as digital switch in this context. Additionally, I placed a capacitor at the output of the MOSFET to suppress voltage spikes and smooth out the signal.
PCB Design




Next, the components were imported into the PCB editor. The layout needed to be arranged logically, and the appropriate size of the printed circuit board (PCB) had to be chosen. It was also necessary to decide on the number of layers. In this case, a two-layer board was sufficient, as the circuit is not overly complex and does not require signal shielding from external interference.
Once the layout was determined, the components were routed. The trace widths varied based on the current requirements of each connection. Signal traces were set to a width of 10 mils, while power traces were assigned a width of 15 mils to reduce voltage drops along those paths.
The voltage regulator had additional layout and routing requirements, as specified in its datasheet. These guidelines ensured optimal performance and stability of the power supply section.
Vias were used throughout the project to connect traces between the two PCB layers. After all components were connected, the next step was polygon pour (copper pour). Although optional, this step is highly recommended. Polygon pour is typically used to connect all ground references across the PCB, providing a well-distributed ground plane and reducing crosstalk between signal lines. In multi-layer boards, ground planes are usually placed on internal layers for better isolation.
The final step involved component labeling. The "Top Overlay" layer was used for printing text on the board, including component names, orientations, and designators. This layer is crucial for assembly and debugging, as it makes it easy to locate components by name, both on the physical board and within the schematic.
BOM

A Bill of Materials (BOM) also had to be created. This list includes all components used in the circuit. From the BOM, one can identify the part reference, the designator as marked on the PCB, the footprint, quantity, supplier, and the supplier-specific part number.
To generate the BOM correctly, it is necessary to assign all required parameters to each component during the schematic design phase.
Programming

A crucial element required for the system to function was the microcontroller programming. For this circuit, I used a microcontroller from Atmel’s ATmega family, specifically the ATtiny85 (ATtiny13 can be used as well). This chip contains all the necessary features for my project. In particular, the PWM timers and ADC (Analog-to-Digital Converter) are key functional blocks that played a major role in the choice of this microcontroller.
Other factors that influenced the decision included memory size, compact package design, an optimal number of I/O pins, and prior familiarity with its architecture and operation.
Before programming the final chip, I first wrote and tested the code using an Arduino Uno and a breadboard prototype. Once the program was validated and working as expected, I proceeded to program the microcontroller directly on the PCB.
This was done using the Arduino Uno as an ISP (In-System Programmer). A special bootloader program was first uploaded to the Arduino Uno, enabling it to convert the compiled code on the computer into the ISP protocol used for programming the target chip.
Once the programming was complete, the circuit was fully assembled and ready for testing.
(Code is not well written so it is recomended to make changes).
Additional Material
Here you can download whole project with altium files and libraries:
https://www.mediafire.com/file/n7qy99vc3x8f4yf/Tim_Kosec_LED_dimmer.zip/file