How to make a pwm potentiometer control with pre-set values in buttons?

Thread Starter

Rimbaldo

Joined Jun 6, 2016
32
Hi!

I´ve got a power led (1W) circuit which I can control a led from 0% to 100% by a PWM control embebbed in the circuit, through a potentiometer.
I´d like to be able to choose some led intensities and have them pre-set by pressing a button (maybe one button to increase the intensity, and one to decrease) instead of a continuous variable potentiometer.
Is there any circuit for it? Any hints for where to look for it?

Thanks for reading!
 

mcgyvr

Joined Oct 15, 2009
5,394
So you want 2 momentary buttons and one will increase resistance by x amount and another will decrease resistance by x amount?

Or what about regular on/off switches with some resistors... one switch for each "pre-set" intensity?

Can you post your current schematic?

Its super simple with a microcontroller...Do you want to go that way? Do you already have a micro in your "circuit"?
 

Thread Starter

Rimbaldo

Joined Jun 6, 2016
32
So you want 2 momentary buttons and one will increase resistance by x amount and another will decrease resistance by x amount?

Or what about regular on/off switches with some resistors... one switch for each "pre-set" intensity?

Can you post your current schematic?

Its super simple with a microcontroller...Do you want to go that way? Do you already have a micro in your "circuit"?
Hi! Thanks for you answer!

Actually no schematics so far... I´m new to electronics beyond resistors, diodes, capacitors...

I have the led driver board where I soldered the 10k pot for PWM control.

But my idea was to have two momentary tactile switches, that do what you said, increase and decrease resistance by smaller amounts (Like 1% or 5%).

I´d like also to have another momentary switch to cycle between preset values that I choose. (For instance: 5%, 25%, 50%, 75%, 100%, back to zero)

But I´m a completely newbie on digital electronics... Don´t know even if it´s possible...
 

AnalogKid

Joined Aug 1, 2013
10,987
A traditional approach (using all discrete IC's, not a microcontroller) is an up/down counter that drives an analog multiplexer that switches different fixed or adjustable resistors into your circuit. If you can stand to go with only one button and up-only control (off, dim, less dim, medium, brighter, full bright, off, repeat), then things get more simple with just a CD4017 CMOS counter as both the counter and selector switch. Of course, we *cannot* know if this will work without a schematic of the dimmer circuit.

First rule of thumb about discussing electronic circuit design: no schematic, no real response.

ak
 

Thread Starter

Rimbaldo

Joined Jun 6, 2016
32
A traditional approach (using all discrete IC's, not a microcontroller) is an up/down counter that drives an analog multiplexer that switches different fixed or adjustable resistors into your circuit. If you can stand to go with only one button and up-only control (off, dim, less dim, medium, brighter, full bright, off, repeat), then things get more simple with just a CD4017 CMOS counter as both the counter and selector switch. Of course, we *cannot* know if this will work without a schematic of the dimmer circuit.

First rule of thumb about discussing electronic circuit design: no schematic, no real response.

ak
Thanks!
I´ve always been into electronics since a kid, but only today I can find little spare time to actually learn.. I´m reading all the PDFs at the education tab... I´m into the semiconductor book.. So.. I´ll get there eventually...

I can´t do schematics for it right now... as I don´t have more than a driver with PWM pot. that changes the 1w led. Actually I´m at 500ma fixed in the led) for now.

I would begin from how to change the resistances (that would change then the pwm duty) by pressing two buttons, and how to store some pre-defined resistance values cycling in another button .. that´s my first goal... It´s for learning purposes right now!

But thanks for all the info... It´s a start!
 

AnalogKid

Joined Aug 1, 2013
10,987
There are several different ways to switch resistors into and out of a circuit, and the exact circuit connections matter. You refer to a PWM circuit in post #1. Do you own a PWM device, or did you see one on ebay, or what? A photo of the device or of a sketch is fine.

ak
 

RichardO

Joined May 4, 2013
2,270
There used to be EE-pot's that had up and down inputs. Add some debouncig for the switches and you are done. :)

My connection is not working right now so I cant find a part number...
 

AnalogKid

Joined Aug 1, 2013
10,987
That works only if the voltage being varied is within the power rails of the EE-pot, one of several pieces of information contained in the schematic.

ak
 

Thread Starter

Rimbaldo

Joined Jun 6, 2016
32
There are several different ways to switch resistors into and out of a circuit, and the exact circuit connections matter. You refer to a PWM circuit in post #1. Do you own a PWM device, or did you see one on ebay, or what? A photo of the device or of a sketch is fine.

ak
Ok. Tomorrow I'll post the pics of the driver!
 

Thread Starter

Rimbaldo

Joined Jun 6, 2016
32
Hi!
The output of the PWM pins for the led driver is at 4.55 volts aprox.

This is the driver in the case I put it. The blue trimpot is not connected anymore. I tried to connect in in series with the PWM pot to change the min, max settings, but as I didn´t know nothing about PWM, it didn´t work....
 

Attachments

atferrari

Joined Jan 6, 2004
4,764
Oi Rimbaldo,

I do not intend to derail this in any way.

When I started to learn how to use micros, something very similar to your request was one of my first excercises. Conceptually simple.

There is a trick to get "preset values": instead of changing resitors, you add one (specific for each value), in parallel with one that is permanently connected. The rest stays floating (unconnected).

Pretty much what you can do (I expect to be criticized here) with different capacitors in parallel to change the response of a filter.

The micro would "preset" a value by commanding (driving) an NPN transistor. The same could be done with manual switches but sounds clunky to me.

BTW, reading a button (sensing if it is pressed down or not) is another basic function that you usually learn in the first steps with micros.

In the attached .pdf file I show how I used the idea twice, for caps. Replace the caps with resistors and there you have it.

If the focus of your interest is just on the result, the please forget all this.

At the last moment I recalled this old idea from the LM317's datasheet. Straight to the point.

Clipboard01.jpg
 

Attachments

Thread Starter

Rimbaldo

Joined Jun 6, 2016
32
Thanks a lot! My intention is to learn first. It's a hobby to me...So I can be able to picture better a way for starting doing it by learning how to!

Thanks!
 
Top