I've done minimal mods with circuit boards in microphones. Can a pwm circuit like you say be made on the cheap?
Absolutely. There are lots of ways to build it. The last one I built used:
- 74221 'dual monostable multivibrator' ($0.62)
- Three capacitors ($0.15 each, TOPS)
- Six or so resistors ($0.02 each)
- Potentiometer (About $0.70)
- Transistor (Anywhere from $0.05 to $1.50 depending how beefy)
- Wire (Free, if you already have some.)
- PCB (About $2.00)
- Potentiometer Knob (Maybe $2.00. Or make one out of wood.)
- (Assuming you already have enclosure, flask, fan, magnet, stir bar etc.)
The trick will be building it with stuff that you can find locally, because shipping $6 worth of parts probably costs another $6.
It's highly likely there are modules you can buy that do it for you, or easier / better ways than using the 74221. (In fact I'm almost certain there's an easier part, I just already knew how to use the 74221.)
The 74221 essentially plays 'ping-pong' with itself. When you turn on the power, side A triggers as soon as the reset signal turns off, and stays on for a duration specified by pins 1 and 2 of the potentiometer. When it turns off, that triggers side B to turn on for a duration specified by pins 2 and 3 of the potentiometer. When side B turns off, it triggers side A, repeat until you power it off. So turning the potentiometer clockwise makes side A stay on longer, and side B stay on shorter. When you listen to the output on side A, you get a PWM signal, so you send that signal to your transistor.
Here's the one I built. Describing it makes it sound more complicated than it is in real life.
I used
3-pin fan headers to connect the board to the motor it was driving, for portability. (It was driving a high-powered screwdriver motor for hours at a time, hence the heatsink, which actually turned out to be unnecessary.) The connector on the top left is where the potentiometer plugged in. The one on the right is where the power plugged in. There's another behind the heatsink where you can't see it, where the motor plugged in.
Interesting side note: 4-pin fans have a built-in transistor for use with a PWM signal. That's how the computer controls the fan speed. It has some specific requirements though, like a 25mhz frequency on the PWM signal, which could make things tricky with off-the-shelf stuff.