Showing posts with label Power supply. Show all posts
Showing posts with label Power supply. Show all posts

Sunday, July 6, 2025

Another dimmable LED controller - hacking a switch mode mains power supply

In this blog post, I modified a cheap buck converter module to add a brightness control, and used it to drive a relatively low power strip of cool white LEDs.

I was never a big fan of the cool white LEDs I had ordered the first time round, and Chinese LED strip tech had also come some way since I did that first installation, so I thought it would be a good opportunity to upgrade to some 24V Chip-on-Board (COB) LED tape in a warmer colour temperature.

The new COB tape is a lot denser than the old surface mount LED tape and has a much higher maximum brightness, but the power requirements have also gone up dramatically if you want to use the full brightness. About 100 watts in fact, from a fixed 24 volt supply, for 20 metres of LED tape.

For this one, I decided that due to those requirements, it would be more efficient to adjust the switch mode power supply directly instead of adding an extra output stage like last time. The candidate for the mod was this chunky 120W power supply:

Large power supply brick with cover removed

Sadly, this power supply didn’t have an internal trimmer pot, so it wasn’t a simple case of replacing that with an off-board pot. On the upside, the low voltage and mains sections were well separated, but of course extreme caution should always be used when working on a device like this and you should avoid carrying out any work on it while it is plugged in.

Like with the buck module from part 1, the objective was to add some control over the feedback circuit. I examined the PCB and determined that the core of the feedback circuit in this power supply is the 8-pin IC in the photo below, which is a TSM103WAIDT dual op-amp with built in 2.5V reference. Just like with the buck modules, there is a resistive potential divider and the circuit tries to make the output of the potential divider equal the reference voltage of 2.5V in this case.

This area of the circuit looks quite complex; I believe it also implements overcurrent protection and overvoltage protection, but I didn't take the trouble to trace it all out.

Low voltage section of the power supply PCB viewed from the solder side

Original feedback circuit resistors:
24.9k high side
2.87k low side
2.50V output from 24V input

I played around with the values in the same spreadsheet from before…

Resistor calculation spreadsheet

…and eventually arrived at the following configuration: I changed the high side to 10K + 7.5k in series, and retained the original 2.87k on low side, but added a 6.8k fixed resistor and 22k pot series combination in parallel with the 2.87k. New output range 19.26V to 24.17V.

Here’s a short video of the modified power supply in operation:

I somehow damaged the op-amp during my experimentation and had to replace it. Fortunately it was still made after all this time, but the op-amp is end of life now.

With a hole drilled in the case for the pot and a knob fitted, it looks very professional!

Photo of assembled power supply with brightness control knob

The dimming control works well with the LED light strips. This power supply doesn't seem to give a stable output voltage at very low loads, as it seems to have a discontinuous switching mode to save power when the original load (computer monitor) was in standby; this causes the LED strips to blink a few times a second when the brightness is turned all the way down. In the final installation, the large dot matrix clock is also powered from the power supply output (it has its own buck converter to generate its 5V power supply so adjusting the supply voltage doesn't affect it) and this additional load prevents the blinking from happening.

Demonstration of final installation

Tuesday, April 22, 2025

A very simple no-PWM LED lighting controller

In this blog post, I created an LED lighting controller for common 12V LED tape which was installed outdoors. I wanted to install some more LED tape but indoors, and this also needed its own controller but with different requirements to the first installation: there was no longer any need for the daylight sensor or the timer, but the ability to continuously adjust the brightness was required.

The lighting was installed as shown in the photo below.

As before, a PWM-free implementation was desired, and the idea of adding components to the feedback circuit of an LM2576 switching regulator module was chosen as the solution again.

The potentiometer was wired into the feedback circuit of the switching regulator circuit. However, it cannot simply be used as a direct replacement for the feedback potential divider, because only a limited portion of the potentiometer wiper will correspond to a useful range of voltages, and it will be possible to turn the voltage up above 12V and damage the LEDs. A combination of series and parallel resistors are added to achieve the desired voltage range.

The LEDs were powered from a bench power supply and the voltage range from nearly off to full brightness was determined to be 7V to 12V. The surrounding resistors would therefore need to be calculated so that the output voltage of the regulator is 7V when the potentiometer is turned to the left or 12V when turned to the right. It was also assumed that the potentiometer would be part of the low side of the resistor divider; this ensures that the voltage cannot jump up above the designed maximum in case the potentiometer gets dirty and goes high impedance.

The final circuit with calculated resistor values is shown below.

The procedure for working out the correct resistors to add to the circuit is very much experimental but I made a spreadsheet to make this task much easier. The numbers for R2, R1-Par and R1-Ser were changed repeatedly until the desired output voltage range was achieved. Once the ideal value of 73k for the upper resistor was found, this number was simply stuck into one of the many E12/E24 resistor finders available online to get the 4.7k + 68k series combination which would be used on the real hardware.

A small project box was chosen to house the circuit. Holes were drilled for the potentiometer, DC jacks, switch and cable. It was swiftly discovered that the two large capacitors on the power supply module were too tall to fit in the case, so these were desoldered and new low profile capacitors were soldered to the back side of the module, where they fit well in the case either side of the potentiometer.

The whole assembly was mounted to a bookcase and a potentiometer knob added to finish it off.

Monday, May 2, 2022

Outdoor LED lighting controller

Introduction

This is a simple project which is a lighting controller for the inexpensive LED tape which is widely available from marketplace sites and is designed to be powered from 12V.

LED tape lights

The requirements for this project were:

  • Automatically turn the LEDs on at dusk and turn them off at dawn
  • Run the LEDs at a dim brightness during normal operation, or at high brightness when high brightness mode is enabled
  • Have a button for selecting high brightness mode. High brightness mode shall automatically be turned off after a time period
  • Have good efficiency

Preliminary testing

Prior to building the controller, the waterproof LED tape was installed as desired around the outside of my house. Around 8 metres of LED tape was installed in three separate lengths and mains flex was wired between each of the three runs and a central location where the controller will be installed along with its light sensor.

The LED tapes were all connected to a bench power supply in parallel for testing.

At the design voltage of 12V, the LEDs are at full brightness and consume around 2A of current for a total of 24W of power. The LEDs are quite bright at this power and the brightness is far too excessive to be used all night, not to mention the high operating costs over the long term.

The voltage was turned down until a sensible brightness for all-night operation was found. This was found to be in the range of 7.90V to 8.10V, with the current varying from 0.05A to 0.10A, and the power from 0.395W to 0.810W. With this in mind, a target voltage of 8.00V was chosen, which should result in a power consumption of only 0.6W (plus overheads from the mains power supply), resulting in low running costs.

Design

The power section of the design was be based around one of the inexpensive and widely available LM2576 buck converter boards. The board was modified to replace the trimmer potentiometer with fixed resistors to avoid future unreliability, and the Enable pin was carefully desoldered from the PCB so that it could be externally driven. A connection was also added to the feedback junction so that an extra resistor could be wired in parallel with the main resistor; this would form the basis of the brightness selection, where this resistor can be left floating or shorted to GND via a transistor to modify the lower resistance value in the feedback network and hence change the output voltage of the buck converter.

Originally I planned to use a comparator wired as a schmitt trigger to control the Enable pin and a 555 timer in monostable mode to control the high brightness mode, but I decided to change to a microcontroller to allow more flexibility and make it easy to implement multiple time-out periods for the high brightness mode which can be stepped through by pressing the button repeatedly. I used a PICAXE-08M (educational microcontroller) since I already had a few, but a bare PIC or ATtiny would also work well.

Schematic

Hardware

I built most of the circuit on stripboard and placed all the components to allow it to fit inside a plastic case.

Some extra resistors have been used in the feedback network compared to the schematic to trim the output voltage more accurately. Polyfuses were also added to each of the three outputs to provide independent short-circuit protection for each channel, which I thought would be a good idea given that the lights are outside.

Assembled project
Interior of the project

The case was screwed to the wall and the LDR was positioned where it could be illuminated by light from outside without being illuminated by very much from the lighting it controls, and it works very well.

Large dot matrix clock, timer and scrolling message display

First completed: August 2014. Additional work carried out late 2025/early 2026. Introduction Previously, the author had made a very small ...