Help Me Design A Thing

I want to experiment with PWM.
I’d like to make a simple circuit that I can use to set the square wave frequency and the duty cycle.
Say in the 5Hz to 20kHz range.

I want to find out just where my limits are as far as acceptable PWM settings.
I’ve come to the conclusion, after looking at a bunch of lights, that It’s not the PWM frequency, but the time duration of the off cycle that makes the difference.
In reviews and comments, it’s clear that what is painful to some is tolerated/unnoticed by others.

I’d also like it to be cheap/simple enough that others could reproduce it (or I’d make a few and send them around), so other BLFs could participate.
Perhaps working toward a set of minimum standards to make available (to whomever cares to listen?).

There are some cheap square wave generators (like under $15) that possibly could be used for signal generation.
https://www.amazon.com/dp/B07DFXFRN3/ref=sspa_dk_detail_0?psc=1&spLa=ZW5jcnlwdGVkUXVhbGlmaWVyPUFJQTBINFVXVFdMQVQmZW5jcnlwdGVkSWQ9QTAwMzcxOTE3MUZPWDZDUkIyTEcmZW5jcnlwdGVkQWRJZD1BMDk3MzA1NTNHQU05VTUyNERJQUgmd2lkZ2V0TmFtZT1zcF9kZXRhaWwyJmFjdGlvbj1jbGlja1JlZGlyZWN0JmRvTm90TG9nQ2xpY2s9dHJ1ZQ==

Or ???

These sorts of things get mixed reviews, especially as far as noise and poor response.
I picked the DROK brand because I’ve had good luck with their stuff before.
And they are fulfilled by Amazon, so DOAs should not be a problem.

Fairly nice looking real live function generators in the $100 range.
https://www.amazon.com/dp/B07211YWMK/ref=twister_B086W1HB4K?\_encoding=UTF8&th=1

I clearly don’t need anything fast or fancy for this. And clearly not many are going to be wiling to spend that kind of money.

I don’t want to go the Arduino route. I have no experience and I’d like to be able to quickly set the parameters without messing about (too old to code, too young to die). Also not as easy for non-code DYI-ers to assemble.

I’ve got some fairly hefty MOSFETs I plucked from an old UPS, that should be be able to switch just about anything flashlight sized. Vgate is the typical 2v-4v. New ones are cheap too.

So my question is, starting with an LED on a board, what’s the easiest/cheapest/best solution to build something that I can quickly set the Frequency and Duty Cycle?

Without frying the LED with too much voltage.
And not frying the function generator with my own ignorance.
(Which is fairly vast as far as solid state goes).

I’d like to use 18650s as the LED voltage source (in 2S perhaps to be sure to get enough V to play with). And if I go the Cheap Square wave generator route, as the power for that also.
Or perhaps run the whole thing off a USB power supply?
But I’d like to keep it portable.

I’m thinking that a cheap buck circuit could drop the load voltage to something the LED would be happy with and I can adjust the pixies to control the brightness.
I like that this one has a V display:
https://www.amazon.com/Valefod-Voltage-Regulator-1-5-35V-Converter/dp/B07WQJ2GD6/ref=pd_sbs_23_4/131-1254495-5322224?\_encoding=UTF8&pd_rd_i=B07WQJ2GD6&pd_rd_r=8e1d4003-8816-4fcc-9d55-c78133af7fbe&pd_rd_w=CnasW&pd_rd_wg=d3aJU&pf_rd_p=bdc67ba8-ab69-42ee-b8d8-8f5336b36a83&pf_rd_r=D85AQBD4E5Q78FHKHHC4&psc=1&refRID=D85AQBD4E5Q78FHKHHC4

Or ???

I’d use the Buck outputs so…
The positive goes through the LED to the MOSFET Drain side. S side of the MOSFET to negative on the Buck driver.

The Gate gets a resistor running to S to make sure the Gate can drop to 0 when there is no signal.

The gate also gets the positive output from the signal generator. Possibly through another resistor to drop voltage.
If the power supply is 8v (2x18650), in theory I would not need to drop the voltage to the gate, because the Vgate max is 10v?

Any problems using the negative of the buck and the negative of the power source as a common ground with the function generator?

Any reason to believe quickly switching the output side of the Buck on and off would cause problems?

Resistor Values? Open to suggestions (as in I don’t really have a clue).

Am I thinking along the correct lines, or as they say:
If you don’t think to good, don’t think too much!

And so I turn to the wizards of the BLF community.
And don’t assume I actually know what I’m talking about.
Falling back to the Hand-Puppet Explanation level is good for me.

Thanks for your help.
All the Best,
Jeff

Do you have access to any Op Amps and do you have any prototyping circuit boards or some sort of board to mount the parts?

With 2 op amps you can make an oscillator and the pulse width modulator using a potentiometer voltage divider for the control input.

Then a small transistor such as a 2N2222A could be used to drive the Mosfet.

i could sketch up a schematic later tonight if it is something you are interested to build.

Thanks for the reply.
I don’t have any Op Amps. Well not without pulling something apart. I’m sure I’ve got some breadboards someplace. Haven’t seen them in years…
Also with an oscillator, I believe, I’d need to monitor the waveform with my O-Scope to see what was going on as far as Freq. and Duty cycle. (That’s both a question and a statement BTY)

I do intend to look at the output with an O-Scope, but I’d like to have a stand alone unit that I can dial in the output I want.

Also I’d like to keep it dead bang simple so the less skilled of us (like me) could cobble it together. Hopefully if it’s simple enough others will give it a try.
Thanks again for the reply,
All the Best,
Jeff

Back in the days of Radio Shack you could just run down and get all the basic goodies such as op amps and transistors and passives. i’ve got a bucket full of old op amps, the dual power supply chip style that you can actually see and read and solder without a microscope. They work great for breadboarding circuits and easy to attach probes and clips to watch on a scope.

So here is a bare bones basic PWM for getting started. The frequency of the oscillator (RED trace) is determined by the R・C time constant in the lower opamp circuit. There is a way to make it a variable frequency using a potentiometer, and we can examine how to do that after you get the basics working and can look at this on your scope. For example we can change the RC and add a pot to get a frequency range from 500 Hz to 5 kHz.

The duty cycle of the pulse is set using the pot signal voltage (ORANGE trace) to the upper opamp. The PWM output (GREEN trace) goes HI or ON when the control voltage exceeds the oscillator voltage, and goes LO/ OFF for the opposite condition when pot voltage is lower than the osc voltage.

That DROK doodad beat the Hell out of my idea. I was gonna suggest “throwing together” an XR2206 circuit.

kennybobby,
Thanks for the design. I may use that as a fall-Back in case I cant get the other stuff to function as I expect.
I miss Radio Shack, where I go go get one or two of something for way too much $, instead of having to order 10 or 100 from a real supply house.
As much as I like tinkering with components, I’d be hard pressed to get something as functional as the cheapie generator.
Since the only stuff I have sitting around would be the resistors, and maybe the Caps.
I used to have lots more of that sort of stuff hanging around, but I gave most of it away years ago to younger folks who were active in HAM or audio.
Thought I was done experimenting, until I started hanging around the BLF.
It’s a gateway drug.
I hadn’t turned on my oscilloscope for years until I wanted to look at some PWM in lights.

Lightbringer,
Yeah, for $7.50 each, I’d be hard pressed into turning on a soldering iron.

I’m really looking to make a box with controls for Freq. and duty Cycle, and (perhaps) V out.
Couple of 18650 holders and an output for an LED. So the LED can easily swapped and be a distance away from the box.
That anyone, without additional equipment, can use to play with PWM.
To find out what is acceptable to them as far as minimum standards.

If It’s simple/cheap enough to make, hopefully some of the regular crew would put some together to play with.
Or I might build a few and send them out to make the rounds in a pay-it-forward type of experiment.

Ether of you have any comments on the design I put forward in the OP?

Thanks Again,
All the Best,
Jeff

The old reliable 555 timer for a pwm signal.

They’re is also the dual 555 Timer circuit that can adjust frequency as well as pwm.

For through hole, I have purchased alot of stuff from here. https://www.taydaelectronics.com/ne555-ic-555-timer-dip-8.html
They have a warehouse somewhere in the states, sometimes I have got orders within days but as high as two weeks.
Their cheap and so am I :money_mouth_face: . They should have about everthing there you need to build the circuit.
I use Digikey or Arrow electroncs for about everything else.
.
You might find something that work pre built on ebay.
https://www.ebay.com/sch/i.html?\_from=R40&\_trksid=m570.l1313&\_nkw=pwm+adjustable+frequency&\_sacat=0

Thanks for the links.
Nice and simple to make.

But unfortunately, without external monitoring, you won’t know what the output is doing.
Unless you maybe pre-calibrate the POT settings.
Dialing in 250Hz and changing between 75% and 80% duty cycle isn’t going to happen repeatably without some some sort of internal display.

So I’m back to spending a little less than $20 for a square wave generator, a buck circuit, and the other goodies.
The key thing is the display, so users can record the PWM characteristics that they find satisfactory.

Thanks Again,
Jeff

I posted a few from ebay in my last post. I added that probably while you were typing your last post.
.
:slight_smile: I’m slow sometimes.

And it’s not the cost, $20 is acceptable.
I just want to make sure I’m on the right track as far as making something simple.
That anyone can use without any external monitoring equipment.
And, perhaps, anyone could make themselves if so inclined.
Without needing anything besides a soldering iron and some parts.

All the best,
Jeff

Not slower that I.
I swear, when typing in an open reply, I make 5X the keyboard mistakes than I normally do when inside a word processor app.
All the BEst,
Jeff

Yeh, maybe you don’t want to use an arduoni or whatever, but if you want digital precision, you gotta go digital. Analog is too… analog. Use 1% components and you can get repeatable (say goodbye with any caps being better’n 10% or so), but you’ll still need some timebase to compare it to, or constant tweaking to make the labels on the pots accurate.

Way back when, I got multi-turn precision pots with a 3-digit display built right into the knob, like you’d see on an o’scope. You gotta built the circuit around the pot, not shoehorn the pot into the circuit. Even the slightest offset at the top/bottom of the range and the numbers will be “off”. So even trying for a really linear VCO to get a direct frequency readout doesn’t work because of that offset. You’d need trimmers at the top and bottom to tweak it.

Digitally, even a cheap ceramic resonator would give you better precision, etc., than purely-analog could muster.