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

Discussion in 'General Electronics Chat' started by Rimbaldo, Jul 29, 2016.

  1. Rimbaldo

    Thread Starter New Member

    Jun 6, 2016
    11
    0
    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!
     
  2. mcgyvr

    AAC Fanatic!

    Oct 15, 2009
    4,769
    969
    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"?
     
  3. Rimbaldo

    Thread Starter New Member

    Jun 6, 2016
    11
    0
    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...
     
  4. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,529
    1,248
    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
     
  5. Rimbaldo

    Thread Starter New Member

    Jun 6, 2016
    11
    0
    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!
     
  6. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,529
    1,248
    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
     
  7. RichardO

    Well-Known Member

    May 4, 2013
    1,230
    382
    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...
     
  8. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,529
    1,248
    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
     
  9. Rimbaldo

    Thread Starter New Member

    Jun 6, 2016
    11
    0
    Ok. Tomorrow I'll post the pics of the driver!
     
  10. Rimbaldo

    Thread Starter New Member

    Jun 6, 2016
    11
    0
    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....
     
  11. atferrari

    AAC Fanatic!

    Jan 6, 2004
    2,648
    762
    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
     
  12. Rimbaldo

    Thread Starter New Member

    Jun 6, 2016
    11
    0
    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!
     
Loading...