Pot controlled PWM generator - Page 1
Forum section: electronics / beginners

author: Back2Volts
author_rank: Unknown
timestamp: March 02, 2017, 12:04:16 am
content: I am want to drive two 150mA 8xLED strings with dimming control. Using 12V wall adapter. I am leaning towards using one TPS61165-Q1 LED switching booster per string, with dimming controlled with a common PWM signal.http://www.ti.com/lit/ds/symlink/tps61165-q1.pdfThe question is what to use to generate the PWM signal (other than an MCU). I want to use a potentiometer to vary the duty cycle. I have seen 555 based circuits, but I wonder if there are any specialized ICs that would be a better choice.Another question is what frequency to use for the PWM. The TPS61165 specs a range of 5KHz to 100KHz. Is there an advantage in choosing a given value in that range ? Could it be a factor that the pot will be wired 2"-3" away from the circuit board.As always, I will appreciate any comments.

author: neko efecktz
author_rank: Regular Contributor
timestamp: March 02, 2017, 02:12:38 am
content: Gidday.There are lots of suggestions on line and the most popular would have to be using a 555 timer ic.Google Search for PWM WITH 555attached is a small section of the found pages.good luck with your projectBILL.

author: Back2Volts
author_rank: Unknown
timestamp: March 02, 2017, 05:27:43 am
content: Quote from: neko efecktz on March 02, 2017, 02:12:38 amBill, thank you for the answer. I have done quite a bit of googling, but most of the answers point to the 555 or multi-opamp (oscillator/saw tooth/comparator). For simplicity, if I had to choose between those options, I would take the 555. But my question is about any existing ICs designed to play in PWM generation. Something like the LTC6992 that I have just found, (a bit pricey)http://www.linear.com/product/LTC6992-1There have to be other ICs like that one from other brands. (I tend to buy from Mouser, but for some odd reason they don't seem to carry LT products.)Tony

author: danadak
author_rank: Super Contributor
timestamp: March 02, 2017, 11:09:08 am
content: If you wanted to do some simple coding a PSOC 4 can be hadfor < $ 2, the real low end of family < $ 1, gives you onboardreference, A/D, DAC, PWM, Serial, Logic Fabric, OpAmps, Com-oparator......Software free, tons of exampleshttp://www.cypress.com/products/32-bit-arm-cortex-m0-psoc-4Check Design Support tab above link, code examples.For me what stands out is -1) Routability2) Fast 12 bit SAR A/D and slow 20 bit DelSig3) DFB (Digital Filter Block) that is dual channel, handle FIR or IIR filters, or DFBcan be used as a GP fast processor block, similar to RISC block4) MSI logic elements GUI based and/or the UDB Verilog capability. Eg. the FPGAlike capability5) Onboard Vref6) IDAC, VDAC, OpAmps (up to 4), comparator, mixer, switch cap, analog mux....7) LCD, COM, UART, I2C, I2S, One Wire, SPI, Parallel, LIN, CAN, BLE, USB9) Custom components capability, create with schematic capture or Verilog10) DMA to offload processes like filters, COM, Display11) ARM M0 (PSOC 4) or M3 (PSOC 5LP) or 8051 core(PSOC 3)12) Extensive clock generation capabilities13) All components supported by extensive prewritten APIshttps://www.element14.com/community/thread/23736/l/100-projects-in-100-days?displayFullThread=truehttp://www.cypress.com/documentation/code-examples/psoc-345-code-examplesGreat video libraryAttached component list. A component is an on chip HW resource.Free GUI design tool with schematic capture, "Creator". Components have rich API library attachedto each component. Compilers free as well.PSOC 4 is low end of family, consider 5LP parts as well. PSOC 4 also has arduino footprint boards (pioneer) as wellhttps://www.elektormagazine.com/labs/robot-build-with-cypress-psochttp://www.cypress.com/products/32-bit-arm-cortex-m-psocRegards, Dana.

author: Back2Volts
author_rank: Unknown
timestamp: March 02, 2017, 03:41:58 pm
content: Dana, I do have the PSoC 4/5 prototyping kits on hand, but I want to keep this as an analog only project. I was just hoping that one of you guys which (seems) have been at this forever might have been familiar with an obscure specialized part. Since this is a one of project, I may end using the LTC6992 or I may use a 555 with the least possible parts around.Thanks for the suggestion,Tony

author: Back2Volts
author_rank: Unknown
timestamp: March 03, 2017, 06:54:06 pm
content: After digging further into the TPS61165 driver, it seems that there is an alternate way to drive it directly with a plain DC setting from the potentiometer. I'll give it a try when I get the parts.

author: james_s
author_rank: Super Contributor
timestamp: March 03, 2017, 07:13:54 pm
content: I've used the TL434 (I think that's the right number) SMPS controller as a simple PWM generator before. It has other features but you don't have to use them.A dual op-amp and a handful of passive components can give you a ramp oscillator and comparator, I recall building one of those to play with on a breadboard once.

author: Back2Volts
author_rank: Unknown
timestamp: March 03, 2017, 11:05:52 pm
content: Quote from: james_s on March 03, 2017, 07:13:54 pmI wonder if you are taking about the TL494 (Could not find 434).http://www.ti.com/lit/ds/symlink/tl494.pdf

author: james_s
author_rank: Super Contributor
timestamp: March 03, 2017, 11:08:46 pm
content: Oops, yeah that's the one, TL494, it was used in loads of computer power supplies back in the day.

author: Back2Volts
author_rank: Unknown
timestamp: March 08, 2017, 11:53:49 pm
content: Quote from: Back2Volts on March 02, 2017, 03:41:58 pmDana, I have changed my mind. Sooner or later I planned to play with the forgotten PSoC 4/5LP prototypes and doing some reading I have just realized that the 5LP KitProg can be used as programmer/debugger for all PSoCs. So I am going to order some low end 4000 parts and build that pot PWM.Thanks, Tony

author: james_s
author_rank: Super Contributor
timestamp: March 09, 2017, 01:32:08 am
content: While it's hard to argue with that cost, it always bugs me a little to use such a powerful part for something that could so easily be handled by a dual op-amp and a handful of passives with no firmware to worry about.

author: alsetalokin4017
author_rank: Super Contributor
timestamp: March 09, 2017, 04:34:19 am
content: You really can't get much simpler than the 555 for this application.

author: Back2Volts
author_rank: Unknown
timestamp: March 09, 2017, 06:36:08 am
content: Quote from: alsetalokin4017 on March 09, 2017, 04:34:19 amAgreed when you look at it as the 555 circuit by itself. It becomes harder when you want to share the duty cycle pot for two identical circuits. Most 555 solutions use the pot inserted in the circuit, not as a voltage setting which could be sent two ways. The LTC6992 is simpler and could do it, but at $4 a piece.I could go for a single circuit board with the 555 and the two boosters.

author: danadak
author_rank: Super Contributor
timestamp: March 10, 2017, 01:18:57 pm
content: QuoteThink of it this way, nowadays low end mixed signal micros are like an OpAmp interms of simplicity, capability (more), usability, reliability. There are gobs of simpletransistors that cost more than some of these low end micros. Yes firmware does haveto be written, but there are some tools, like sketch, forth, basic, C......where this is sotrivial to get a basic task done its like brushing ones teeth. Virtually effortless.In fact many jellybean parts these days have embedded sequencers, micros in effect,that augment and control analog without any user generated firmware, you just donot know its there.Regards, Dana.

author: james_s
author_rank: Super Contributor
timestamp: March 10, 2017, 03:24:03 pm
content: Until you try to reverse engineer or repair somebody else's design years later, or even your own project if you have lost the code you wrote. I've been bitten by both of those scenarios more than once.

author: Zero999
author_rank: Super Contributor
timestamp: March 10, 2017, 08:29:24 pm
content: Quote from: Back2Volts on March 09, 2017, 06:36:08 amThen don't. Use the same circuit to drive multiple LEDs.

author: danadak
author_rank: Super Contributor
timestamp: March 10, 2017, 10:00:37 pm
content: QuoteIn this design maybe 10 - 20 lines of code needed.But independent of that, analog designs, capacitor / passive types and choices, design considerationscan also bite one in the arse. Reverse engineering often a bit of a minefield no matter what its made of.I have seen mechanical design where wrong bolt material substitution wrapped up folks in a failure.Can't get much simpler than that.Guess I am too much of a mixed signal processor addict.Regards, Dana.

author: james_s
author_rank: Super Contributor
timestamp: March 10, 2017, 10:14:40 pm
content: Well it's a general thing, not necessarily this circuit. It's very frustrating to try to repair an old piece of equipment and then find that the bad part is a microcontroller or PLD and I have no access to the source that created it. Yes if it's something very simple I can maybe reverse engineer the purpose and come up with an approximation, but if it's a simple jellybean part like a 555 or op-amp I can simply drop in a replacement.

author: Zero999
author_rank: Super Contributor
timestamp: March 10, 2017, 10:50:59 pm
content: Quote from: james_s on March 09, 2017, 01:32:08 amActually a programmable IC isn't cheaper in this case. I don't know why people think an MCU is always cheaper than any alternative, when it isn't necessarily the case. A 555 timer plus a dual diode and a few passive components is much cheaper than any programmable device.If cost is a factor, then I'd recommend dropping the 555 timer and using logic gates or a Schmitt inverter, which is cheaper than the 555.

author: james_s
author_rank: Super Contributor
timestamp: March 10, 2017, 11:11:42 pm
content: I dunno, you can buy microcontrollers for under $1 in single quantities, that may work out cheaper than a 555 and the required passives.I consider both to be useful tools, the trick is to decide when it makes sense to use one over another. The uC does have the advantage that with different code you can completely alter the function of the device.

author: Zero999
author_rank: Super Contributor
timestamp: March 10, 2017, 11:26:59 pm
content: Quote from: james_s on March 10, 2017, 11:11:42 pmBut it doesn't work out cheaper. $1 is very expensive for a 555 timer and the passives are cents. If you go for a logic gate IC it's cheaper still.I had a look at my local supplier's site.MCUs: Cheapest: £0.264http://uk.rs-online.com/web/c/semiconductors/processors-microcontrollers/microcontrollers/#sort-by=P_breakPrice1&sort-order=ascTimers: Cheapest 555 £0.059http://uk.rs-online.com/web/c/semiconductors/clocks-timing-frequency-control-circuits/timer-circuits/#sort-by=P_breakPrice1&sort-order=ascSchmitt trigger: Cheapest £0.022http://uk.rs-online.com/web/c/semiconductors/standard-logic/schmitt-trigger-inverters/#sort-by=P_breakPrice1&sort-order=ascOne thing I have noticed is the significantly larger minimum order quantities on the cheaper parts (I suppose it's not profitable to sell small numbers of low cost items) which may offset any savings if you're only making a one off. In that case, I agree go for the MCU but if you're producing 100s then go for the 555 or logic gate solution.

author: james_s
author_rank: Super Contributor
timestamp: March 11, 2017, 12:53:03 am
content: It's pretty much universal that if you buy a large quantity the price is lower. Often a company like Digikey will list the same part under multiple stock numbers, one will be individual cut tape with a min order of 1, and one will be a full reel or tray with a minimum order of however many is in the package. To be fair you need to compare the same part in the same quantity.

author: danadak
author_rank: Super Contributor
timestamp: March 11, 2017, 02:41:30 am
content: 27 cents, Digikey, low end micro, distributor price. Their franchised lines.OEM price I know for low end high volume designs (not Microchip)approached 11.xx cents in designs, time period 2008.555 timer 9.5 cents, Digikey, same comments for OEM would apply.Die size, package, process yield, test time, inventory/supply set price.US prices.Regards, Dana.

author: Back2Volts
author_rank: Unknown
timestamp: March 11, 2017, 06:11:23 am
content: Quote from: Hero999 on March 10, 2017, 08:29:24 pmAs always I do appreciate the advice. The project is a hack of a lamp which had an original design for 8 strings of two LEDs, running with 4xAA batteries. Converted to 2 8-LED strings with eBay 12V to 28V booster and 20mA CCR (diode like) for each string. It is hard to find small, low cost, 60V boosters for single 16-LED string. Now planning a second round with current regulation up to 150mA.As an aside, I am retired, doing this just for fun. I have already played with 555s but not touched PSoC. It may be time for it. I may end up stuffing the PSoC 4200 prototyping kit inside the lampIf I don't get bored with the project, I could even use CapSense for the intensity control

author: Zero999
author_rank: Super Contributor
timestamp: March 12, 2017, 12:16:08 am
content: Quote from: james_s on March 11, 2017, 12:53:03 amI agree, you need to compare the same part in the same quantity. The trouble is this can be difficult to do for small volumes, because cheaper parts such as 555 timers and logic gates, tend to be difficult to buy in small quantities, where as more expensive ICs, such as MCUs, are easier to get hold of in single units.Cheapest MCU in quantities of 100: £0.23http://uk.rs-online.com/web/p/microcontrollers/8149184/Cheapest 555 in quantities of 50: £0.078 eachhttp://uk.rs-online.com/web/p/timer-circuits/1219248/Cheapest Schmitt trigger in quantities of 100:: £0.034http://uk.rs-online.com/web/p/schmitt-trigger-inverters/8054349/So if you're making 100 off, the discrete Schmitt trigger IC is lowest cost option.If all you want is to make one, there's less of a price difference:MCU: £0.31http://uk.rs-online.com/web/p/microcontrollers/7153921/555: £0.45http://uk.rs-online.com/web/p/timer-circuits/0638942/Schmitt trigger: £0.13http://uk.rs-online.com/web/p/schmitt-trigger-inverters/1840629/If you're making the one off, the Schmitt trigger is still the lowest cost option but the MCU is no longer the most expensive, replaced by the 555.

author: Back2Volts
author_rank: Unknown
timestamp: March 12, 2017, 03:59:50 pm
content: Changing the rules... The above price considerations go away... I could save the cost of the pot by using CapSense. Small potentiometers are not cheap.

author: Zero999
author_rank: Super Contributor
timestamp: March 12, 2017, 05:36:07 pm
content: Quote from: Back2Volts on March 12, 2017, 03:59:50 pmYes, capacitive sensing would be cheaper, at the expense of usability. Not everyone likes capacitive controls. A potentiometer gives a visual indication of the setting, in my opinion, is easier to use.

author: Back2Volts
author_rank: Unknown
timestamp: March 12, 2017, 05:58:43 pm
content: Quote from: Hero999 on March 12, 2017, 05:36:07 pmThat is a valid point.

author: james_s
author_rank: Super Contributor
timestamp: March 13, 2017, 12:16:24 am
content: Pots are cheap if you only need a few, under a buck for something passable.I *hate* capacitive touch controls, uhg! They never work well for me, one of the products I worked on used them and I always find myself mashing the panel repeatedly trying to get it to sense my touch.

author: Back2Volts
author_rank: Unknown
timestamp: March 13, 2017, 06:01:56 am
content: Quote from: james_s on March 13, 2017, 12:16:24 amUnfortunately more like $5 between pot and know in the size I need ithttp://www.digikey.com/scripts/DkSearch/dksus.dll?Detail&itemSeq=220496725http://www.digikey.com/scripts/DkSearch/dksus.dll?Detail&itemSeq=220496325But still may be worth it for usability