I am trying to create an inexpensive PWM Motor controlling circuit. I want it to have a frequency of 25Khz and then there will be a potentiometer to control the duty cycle from 0 to 100%. The motor operates at 5V and max current is under 1A. I'm going to be building a lot of these so I wanted to keep the price as low as possible.
Initially I was going to use a 555 timer, but realized it was kind of difficult to set the 0-100% duty cycle at a constant frequency. Then I started thinking some thinking and realized perhaps I could do what I want with a simple RC circuit (potentiometer controls duty cycle), a resonator, and comparator (lm393).
There are so many different strategies and I listed just two. I'm wondering what high level strategy you experts would use to keep the price as low as possible?
I'm a software guy and all this is getting a bit out of my comfort zone. In the past I'd just use a cheap 50 cent micro so I could go back to my friendly code, but in this case I want to avoid the cost of programming the micro. If someone would be willing to help design this circuit, create a BOM, and explain its operation to me that would save me a lot of time. I'd be happy to pay someone $100 for that. Let me know if you're interested.
Actually an MCU works out more expensive for this, especially in large quantities. The only time it will be cheaper is if you want to dispense with the potentiometer and use push-buttons and or a capacitive touch sensor but most people find potentiometers more user friendly.
A 555 timer can get very close to 0% to 100%. The frequency will remain fairly constant, irrespective of the pot setting. I haven't worked out the frequency of any of the circuits below (by the way you'll need to be logged on to the forum to see them) but it doesn't change much, as the pot is adjusted.
This circuit does it quite well and if you use Schottky diodes, it'll be even better.
Another option is CMOS gates which are often cheaper than the 555 timer, use less power and will be able to get closer to 100% duty cycle. Again, use Schottkly diodes, rather than silicon. The unused gates can be connected in parallel used as a buffer to help drive a MOSFET.
Then there's the LM393 comparator which will go from 0% to 100% duty. It has an open collector output which means it needs a pull-up resistor and it might struggle to drive a MOSFET directly at 25KHz, especially at very low/high duty cycles, so an external driver may be necessary.
It's been discussed in the following thread:
https://www.eevblog.com/forum/projects/pwm-signal-from-555-timer