555 astable multivibrator-vary duty cycle/maintain freq

crutschow

Joined Mar 14, 2008
34,286
If you truly need a constant-frequency PWM then here's an LM339/393 circuit below with LTspice simulation.
The U1 oscillator is completely independent of PWM generation so the frequency is not affected by the PWM setting.
It can go from 0% to 100% duty-cycle (full off to full on).

upload_2019-2-8_8-29-24.png
 

iONic

Joined Nov 16, 2007
1,662
If you are controlling LED brightness using PWM then the frequency is pretty irrelevant so the simplest '555 circuit will do the job.
I agree/disagree. If the frequency is set high enough to start with, then it is irrelevant. High enough does not mean just beyond what we can visible detect. It must go well beyond that for safe, healthy lighting. But my efforts to find the "very stable" version will be helpful for future applications and testing, so a design that "floats" around may not be suitable.
 
Last edited:

Danko

Joined Nov 22, 2017
1,829
R_load generates a large current load, near the limit of what the 555 can drive.
R_load value does not affect on frequency stability and 100Ω used only for example.
Of course TS may use any required load with bigger resistance, instead 100Ω.
 

iONic

Joined Nov 16, 2007
1,662
Easier to rip the plate off that chip and flash the memory 527202.png than to reprogram some old-time analog junkies!:p
 

danadak

Joined Mar 10, 2018
4,057
Compilers, Bascom, Arduino, free, programmer could be Arduino Uno or AVR USBavr programmer.

Yes, to program a chip you do need to learn. Bascom Basic for AVR one of the
easiest, C / Arduino next.

All this is predicated by design goals. 555 timer really crappy on frequency accuracy
and stability, but then many jobs don't care if it oscillates at 1 Hz or 1 Ghz :)

Now you have MIT scratch programming in its infancy. Making a lot of progress, and a
lot of kids working with it in school.

Not only that we have routable programmable with analog micros, where your breadboard is the
micro. You control wiring, and interconnect. I was never a fan of point to point wiring on bread-
boards that were / are tedious, and contact challenged.

Change, its all mostly good.


Regards, Dana.
 

Thread Starter

spuddo

Joined May 2, 2013
76
Hi , thanks again for all your replies
will build all ccts offered up and see how we go
Danadak----its on my bucket list to learn to program.
There is no target goal for frequency , tolerance , accuracy , this is just learning for me.
eetech00 your cct looks interesting , hopefully changing freq without changing duty cycle and visa versa , it's not what i started out looking for , but two for the price of one
best regards
 

eetech00

Joined Jun 8, 2013
3,859
Hello,

I breadboarded the following circuit based on post #21 and modified it for a frequency of 1Khz.
Circuit worked nicely. I was able to adjust duty cycle from 0% to 100% with no LED flicker.
Oscillator frequency was fixed at 1KHz and did not vary with duty cycle.

One suggestion would be to use a stable voltage reference (or a regulator for the whole circuit) so it doesn't vary with the supply if that's important.

LM393PWM.png
 

crutschow

Joined Mar 14, 2008
34,286
The PWM setting is also independent of the supply voltage.
Also, why did you use two supply voltages? One should be sufficient.
 

iONic

Joined Nov 16, 2007
1,662
Hello,

I breadboarded the following circuit based on post #21 and modified it for a frequency of 1Khz.
Circuit worked nicely. I was able to adjust duty cycle from 0% to 100% with no LED flicker.
Oscillator frequency was fixed at 1KHz and did not vary with duty cycle.

One suggestion would be to use a stable voltage reference (or a regulator for the whole circuit) so it doesn't vary with the supply if that's important.

View attachment 169871
I'm planning to download LTSpice very soon. Are there files you can upload so that I can import your circuit into the program. I have a few low power opamps that I might substitute in the design to see if they work. Don't know the part#s off hand.
 

iONic

Joined Nov 16, 2007
1,662
Attached is my LTspice file, plus the LM339 model and symbol files which do not come with LTspice.
Those must be put in the appropriate LTspice sub and sym directories.
Not sure I placed the .lib and .asy files in the correct sub folders but I get an error that states LTSpice can not find pot symbol. The schematic that appears is missing the potentiometer.
 

crutschow

Joined Mar 14, 2008
34,286
Okay forgot that you also need the pot files, below.

Put the .asy file in the sym directory, and the .lib file in the sub directory.

You may need to close and reopen LTspice to get the new models to appear.
 

Attachments

Last edited:

iONic

Joined Nov 16, 2007
1,662
Okay forgot that you also need the pot files, below.

Put the .asy file in the sym directory, and the .lib file in the sub directory.

You may need to close and reopen LTspice to get the new models to appear.
Very much appreciated!
Should have also asked for your last LTSpice sim for the Sequential Float Charger. This will offer some great learning. When you get a chance...Thank You.

My apologies to the TS. I am hijacking your thread...sorry.
 

danadak

Joined Mar 10, 2018
4,057
Another way of doing this with a UP but programming visually. Using
Arduino and install Ardublock. Left screen is where Arduino code
appears, basically C. Thats "normaly" how one programs Arduino.

But then right screen is a visual drag and drop functional blocks
onto canvas and config them. Then when upload button is clicked
it generate Arduino code that updates in left window, compiles,
and programs the Arduino chip/board being used.

Not too shabby. Takes a while finding appropriate block in menu until
you get used to tool. MIT Scratch, similiar tool, has lots of videos to
get a feel of how stuff is done. Ardublock has some video, but limited.

upload_2019-2-10_17-21-22.png


If interested I can post version of Ardublock to use and how to install.

Kids doing basic robot stuff with this. Time for the adults to catch up :)

The blocks in the rightmost window was all it took to control a PWM
duty cycle with the V user inputs to a pin, either a pot or a sensor.

Note as you work with this, and see the C code in left window, its not so petrifying
to think about tackling C for the newcomer.


Regards, Dana.
 
Top