Author Topic: Square Wave Generator Based on 555 Question.  (Read 13536 times)

0 Members and 8 Guests are viewing this topic.

Offline JJ_023Topic starter

  • Frequent Contributor
  • **
  • Posts: 363
  • Country: us
Square Wave Generator Based on 555 Question.
« on: December 31, 2023, 10:38:14 pm »
So I built on a breadboard a square wave generator based on a 555 in astable mode.  The goal was to try to get 5 kHz with as close as possible to 50% duty cycle.

Vcc was 5V
The capacitor value selected was 47nF
1 of the resistors was 330 ohm.  The other resistor was a high quality 10 turn pot from bourns used to fine-tune the frequency.

There is also a 330 ohm resistor on pin 3 as a load.

There is also a 10nf capacitor on pin 5.

I am getting about 800 mV of overshoot at the top of the waveform.  Besides that the square wave looks well-formed.  What is causing this overshoot and what could be done to correct it.

This is nothing more than a learning experience not a circuit for anything in particular at this moment.

Scope screenshots are attached.
 

Offline CaptDon

  • Super Contributor
  • ***
  • Posts: 1989
  • Country: is
Re: Square Wave Generator Based on 555 Question.
« Reply #1 on: December 31, 2023, 11:09:28 pm »
Almost entirely the fault of breadboard inductance and lead lengths of scope and power supply leads. Not uncommon for bread boarding and often the reason why bread board projects act weird or fail entirely.
Collector and repairer of vintage and not so vintage electronic gadgets and test equipment. What's the difference between a pizza and a musician? A pizza can feed a family of four!! Classically trained guitarist. Sound engineer.
 
The following users thanked this post: JJ_023

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1828
  • Country: au
Re: Square Wave Generator Based on 555 Question.
« Reply #2 on: December 31, 2023, 11:12:57 pm »
I am getting about 800 mV of overshoot at the top of the waveform.  Besides that the square wave looks well-formed.  What is causing this overshoot and what could be done to correct it.
The 555 has known high supply current spikes, so needs good supply decoupling.
A series R can reduce the overshoot, at the expense of higher drive impedance.
You could experiment with ferrite beads.
 
The following users thanked this post: Dabbot, JJ_023

Offline CaptDon

  • Super Contributor
  • ***
  • Posts: 1989
  • Country: is
Re: Square Wave Generator Based on 555 Question.
« Reply #3 on: January 01, 2024, 02:40:32 pm »
If you need the squarewave to have as close to 50/50 duty cycle as possible you should double the operating frequency and use a TTL or CMOS divide by two follower. 555 devices don't do 50/50 very well without extra components. With the extra divider stage as a follower it is much easier to trim the operating frequency of the 555 and still get a good squarewave from the divider. That is hard to do with only a 555 and no divider.
Collector and repairer of vintage and not so vintage electronic gadgets and test equipment. What's the difference between a pizza and a musician? A pizza can feed a family of four!! Classically trained guitarist. Sound engineer.
 
The following users thanked this post: JJ_023

Offline Andy Chee

  • Super Contributor
  • ***
  • Posts: 1058
  • Country: au
Re: Square Wave Generator Based on 555 Question.
« Reply #4 on: January 01, 2024, 03:10:38 pm »
If you're after 50/50 square wave, you might have better luck with this alternative 555 astable configuration, rather than the standard astable configuration.

 
The following users thanked this post: JJ_023

Online mawyatt

  • Super Contributor
  • ***
  • Posts: 3807
  • Country: us
Re: Square Wave Generator Based on 555 Question.
« Reply #5 on: January 01, 2024, 03:31:56 pm »
Agree with CaptDon, following the 555 with a divide by 2 flip-flop (74HC74) gives a very precise 50% duty cycle at lower frequencies regardless of the 555 duty cycle.

Here's a post employing a CMOS divide by 2 concept to produce a precise 50% duty cycle and amplitude waveform for an accurate squarewave reference.

https://www.eevblog.com/forum/testgear/ac-rms-dmm-tests/

Best,
« Last Edit: January 01, 2024, 03:34:07 pm by mawyatt »
Curiosity killed the cat, also depleted my wallet!
~Wyatt Labs by Mike~
 
The following users thanked this post: JJ_023

Offline Alex Eisenhut

  • Super Contributor
  • ***
  • Posts: 3426
  • Country: ca
  • Place text here.
Re: Square Wave Generator Based on 555 Question.
« Reply #6 on: January 01, 2024, 04:23:23 pm »
I think you need the 7555, the CMOS version, for the alternative 50-50 output to work well, since the CMOS output can source and sink equally.
Hoarder of 8-bit Commodore relics and 1960s Tektronix 500-series stuff. Unconventional interior decorator.
 
The following users thanked this post: JJ_023

Offline JJ_023Topic starter

  • Frequent Contributor
  • **
  • Posts: 363
  • Country: us
Re: Square Wave Generator Based on 555 Question.
« Reply #7 on: January 04, 2024, 01:08:52 am »
I am getting about 800 mV of overshoot at the top of the waveform.  Besides that the square wave looks well-formed.  What is causing this overshoot and what could be done to correct it.
The 555 has known high supply current spikes, so needs good supply decoupling.
A series R can reduce the overshoot, at the expense of higher drive impedance.
You could experiment with ferrite beads.

So I tried a decoupling Capacitor to pin 8 (Vcc).  It didn't really make a difference.

I also tried a series resistor on pin 3 (Out).  I actually played with that in the beginning it also did not really make too much of a difference.

I am not sure how to experiment with ferrite beads.  Could you possibly elaborate on that.

Thank you for your suggestion.
 

Offline JJ_023Topic starter

  • Frequent Contributor
  • **
  • Posts: 363
  • Country: us
Re: Square Wave Generator Based on 555 Question.
« Reply #8 on: January 04, 2024, 01:15:11 am »
If you need the squarewave to have as close to 50/50 duty cycle as possible you should double the operating frequency and use a TTL or CMOS divide by two follower. 555 devices don't do 50/50 very well without extra components. With the extra divider stage as a follower it is much easier to trim the operating frequency of the 555 and still get a good squarewave from the divider. That is hard to do with only a 555 and no divider.

Thank you for the suggestion.  I am familiar with some of the difficulties of trying to achieve a 50-50 duty cycle with the 555.  I'll have to try your suggestion as a learning exercise.  At the current moment I don't think I have access to a CMOS divide by two follower.


 

Offline JJ_023Topic starter

  • Frequent Contributor
  • **
  • Posts: 363
  • Country: us
Re: Square Wave Generator Based on 555 Question.
« Reply #9 on: January 04, 2024, 01:18:15 am »
If you're after 50/50 square wave, you might have better luck with this alternative 555 astable configuration, rather than the standard astable configuration.

(Attachment Link)

I'll give this a shot.  Thank you for the suggestion.  What is the thought process behind this circuit.  Why is it better?

When I posted this I was more concerned about the overshoot that can be seen in the attached pictures than I was about getting a 50-50 square wave. 
 

Offline JJ_023Topic starter

  • Frequent Contributor
  • **
  • Posts: 363
  • Country: us
Re: Square Wave Generator Based on 555 Question.
« Reply #10 on: January 04, 2024, 01:27:29 am »
Agree with CaptDon, following the 555 with a divide by 2 flip-flop (74HC74) gives a very precise 50% duty cycle at lower frequencies regardless of the 555 duty cycle.

Here's a post employing a CMOS divide by 2 concept to produce a precise 50% duty cycle and amplitude waveform for an accurate squarewave reference.

https://www.eevblog.com/forum/testgear/ac-rms-dmm-tests/

Best,

I read your post.  That's pretty neat that you came up with that.  Have there been any changes to the design if I ever decided to make the PCB and build it?   

Like I mentioned before I wasn't striving for 50-50, that's not what this post was about. I was more interested in what's causing that overshoot and if there is a way to correct it.

But I am also glad that people gave me suggestions on the 50-50 duty cycle as it gives me additional information and knowledge.

Thank you.
 

Offline JJ_023Topic starter

  • Frequent Contributor
  • **
  • Posts: 363
  • Country: us
Re: Square Wave Generator Based on 555 Question.
« Reply #11 on: January 04, 2024, 01:36:49 am »
I think you need the 7555, the CMOS version, for the alternative 50-50 output to work well, since the CMOS output can source and sink equally.

Thank you for the suggestion.

Are not all 7555 the CMOS version?
 

Offline Andy Chee

  • Super Contributor
  • ***
  • Posts: 1058
  • Country: au
Re: Square Wave Generator Based on 555 Question.
« Reply #12 on: January 04, 2024, 01:52:21 am »
I was more interested in what's causing that overshoot and if there is a way to correct it.
In which case the first reply pretty much nails it, stray inductance.

Apart from constructing on an etched PCB, you can prototype 'dead bug' style to keep leads short:



 
The following users thanked this post: JJ_023

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1828
  • Country: au
Re: Square Wave Generator Based on 555 Question.
« Reply #13 on: January 04, 2024, 01:58:03 am »
I'll give this a shot.  Thank you for the suggestion.  What is the thought process behind this circuit.  Why is it better?
On an ideal part with rail to rail swings, and symmetric trigger points (1/3 and 2/3), R2 alone will give 50% duty cycle.
A real (non CMOS) part does not quite manage rail to rail, so the added R1, skews the default 'almost 50%' to be closer to 50%.   


When I posted this I was more concerned about the overshoot that can be seen in the attached pictures than I was about getting a 50-50 square wave.

You could also try pullups and pull down loads.
The original 555 has a multiple transistor output drive, which unlike CMOS does not pull cleanly to VCC. This will not give a 'clean' rail to rail square wave.

If you have any CMOS logic, you could try adding a non inverting buffer, and scope that.
 
The following users thanked this post: JJ_023

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1828
  • Country: au
Re: Square Wave Generator Based on 555 Question.
« Reply #14 on: January 04, 2024, 02:13:36 am »
I think you need the 7555, the CMOS version, for the alternative 50-50 output to work well, since the CMOS output can source and sink equally.

Not quite.
The CMOS parts have MOSFETS that can drive rail to rail, but the P & N FETS do not have equal resistance, so they cannot source and sink equally.
 

Offline JJ_023Topic starter

  • Frequent Contributor
  • **
  • Posts: 363
  • Country: us
Re: Square Wave Generator Based on 555 Question.
« Reply #15 on: January 04, 2024, 02:28:22 am »
I was more interested in what's causing that overshoot and if there is a way to correct it.
In which case the first reply pretty much nails it, stray inductance.

Apart from constructing on an etched PCB, you can prototype 'dead bug' style to keep leads short:

(Attachment Link)

Thanks for that.  What about a perf board?
 

Offline JJ_023Topic starter

  • Frequent Contributor
  • **
  • Posts: 363
  • Country: us
Re: Square Wave Generator Based on 555 Question.
« Reply #16 on: January 04, 2024, 02:30:50 am »
I'll give this a shot.  Thank you for the suggestion.  What is the thought process behind this circuit.  Why is it better?
On an ideal part with rail to rail swings, and symmetric trigger points (1/3 and 2/3), R2 alone will give 50% duty cycle.
A real (non CMOS) part does not quite manage rail to rail, so the added R1, skews the default 'almost 50%' to be closer to 50%.   


When I posted this I was more concerned about the overshoot that can be seen in the attached pictures than I was about getting a 50-50 square wave.

You could also try pullups and pull down loads.
The original 555 has a multiple transistor output drive, which unlike CMOS does not pull cleanly to VCC. This will not give a 'clean' rail to rail square wave.

If you have any CMOS logic, you could try adding a non inverting buffer, and scope that.

Thank you for the suggestions and the explanation.  I don't have any CMOS logic.  I'm going to play with pull-up and pulldown loads, see what that does.
 

Offline JJ_023Topic starter

  • Frequent Contributor
  • **
  • Posts: 363
  • Country: us
Re: Square Wave Generator Based on 555 Question.
« Reply #17 on: January 04, 2024, 02:34:57 am »
I think you need the 7555, the CMOS version, for the alternative 50-50 output to work well, since the CMOS output can source and sink equally.

Not quite.
The CMOS parts have MOSFETS that can drive rail to rail, but the P & N FETS do not have equal resistance, so they cannot source and sink equally.

Thank you for the clarification.  I primarily stick to Texas Instruments for parts for stuff like this.  In this particular case I used SE555 from a leftover project I had.  I will have to get some LMC555 and try that. 
 

Offline Andy Chee

  • Super Contributor
  • ***
  • Posts: 1058
  • Country: au
Re: Square Wave Generator Based on 555 Question.
« Reply #18 on: January 04, 2024, 02:41:16 am »
I was more interested in what's causing that overshoot and if there is a way to correct it.
In which case the first reply pretty much nails it, stray inductance.

Apart from constructing on an etched PCB, you can prototype 'dead bug' style to keep leads short:
Thanks for that.  What about a perf board?
Yep perfboard is ok, but just like PCB track routing, be mindful of how you route the wires on your perfbord.

Incidentally, some people use the terms perfboard, stripboard, and veroboard, interchangeably. However the way I distinguish between the two is that, perfboard only has solder pads, whereas stripboard/veroboard has parallel copper tracks.

In the context of low parasitic inductances, go for the perfboard.
 
The following users thanked this post: JJ_023

Offline JJ_023Topic starter

  • Frequent Contributor
  • **
  • Posts: 363
  • Country: us
Re: Square Wave Generator Based on 555 Question.
« Reply #19 on: January 04, 2024, 02:46:03 am »
I was more interested in what's causing that overshoot and if there is a way to correct it.
In which case the first reply pretty much nails it, stray inductance.

Apart from constructing on an etched PCB, you can prototype 'dead bug' style to keep leads short:
Thanks for that.  What about a perf board?
Yep perfboard is ok, but just like PCB track routing, be mindful of how you route the wires on your perfbord.

Incidentally, some people use the terms perfboard, stripboard, and veroboard, interchangeably. However the way I distinguish between the two is that, perfboard only has solder pads, whereas stripboard/veroboard has parallel copper tracks.

In the context of low parasitic inductances, go for the perfboard.

Thank you for the concise explanation.

Do you ever reuse your perfboards?  I do.
 

Offline Andy Chee

  • Super Contributor
  • ***
  • Posts: 1058
  • Country: au
Re: Square Wave Generator Based on 555 Question.
« Reply #20 on: January 04, 2024, 03:08:22 am »
I was more interested in what's causing that overshoot and if there is a way to correct it.
In which case the first reply pretty much nails it, stray inductance.

Apart from constructing on an etched PCB, you can prototype 'dead bug' style to keep leads short:
Thanks for that.  What about a perf board?
Yep perfboard is ok, but just like PCB track routing, be mindful of how you route the wires on your perfbord.

Incidentally, some people use the terms perfboard, stripboard, and veroboard, interchangeably. However the way I distinguish between the two is that, perfboard only has solder pads, whereas stripboard/veroboard has parallel copper tracks.

In the context of low parasitic inductances, go for the perfboard.

Thank you for the concise explanation.

Do you ever reuse your perfboards?  I do.
I do, but often I’m impatient desoldering, delaminate a solder pad, and end up throwing the board out anyway!
 
The following users thanked this post: JJ_023

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1828
  • Country: au
Re: Square Wave Generator Based on 555 Question.
« Reply #21 on: January 04, 2024, 04:14:34 am »
Another part to consider for 50% & 5V, is a 74HC4060, which guarantees 50% and can use smaller more stable capacitors to generate your 5kHz.
HEF4060 can also work at 5V, with lower Icc, but has lower drive on the Qn outputs.
 
The following users thanked this post: JJ_023

Offline JJ_023Topic starter

  • Frequent Contributor
  • **
  • Posts: 363
  • Country: us
Re: Square Wave Generator Based on 555 Question.
« Reply #22 on: January 04, 2024, 03:48:45 pm »
Another part to consider for 50% & 5V, is a 74HC4060, which guarantees 50% and can use smaller more stable capacitors to generate your 5kHz.
HEF4060 can also work at 5V, with lower Icc, but has lower drive on the Qn outputs.

Thank you for the recommendation.  I read the datasheet.

https://assets.nexperia.com/documents/data-sheet/HEF4060B.pdf

Unfortunately the datasheet was not Texas Instruments.  The reason I say that and the reason I like to use Texas Instruments parts is they give a very detailed description of how it operates along with a whole bunch of circuits that I learn from, they also have links to white papers that educate on the subject matter.  Never understood why all companies don't do that.  I will have to do a little bit more research and figure out how to use this chip properly.

Seems like a great chip.  Fairly cheap, like $0.50.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 13052
Re: Square Wave Generator Based on 555 Question.
« Reply #23 on: January 04, 2024, 04:03:43 pm »
T.I do a 74HC4060 as well. https://www.ti.com/lit/ds/symlink/sn74hc4060.pdf
Different manufacturer's 74HC parts are generally drop-in replacements for each other so if you find T.I. datasheets easier to understand, use them for everything except *exact* electrical min. and max. parameters, for which if you are pushing the limits, you should refer to the actual manufacturer's datasheet.
 
The following users thanked this post: JJ_023

Offline JJ_023Topic starter

  • Frequent Contributor
  • **
  • Posts: 363
  • Country: us
Re: Square Wave Generator Based on 555 Question.
« Reply #24 on: January 04, 2024, 06:56:12 pm »
T.I do a 74HC4060 as well. https://www.ti.com/lit/ds/symlink/sn74hc4060.pdf
Different manufacturer's 74HC parts are generally drop-in replacements for each other so if you find T.I. datasheets easier to understand, use them for everything except *exact* electrical min. and max. parameters, for which if you are pushing the limits, you should refer to the actual manufacturer's datasheet.

Thank you for pointing out those details. When I searched for that particular chip I didn't see one available under Digi.  Unfortunately this particular TI datasheet is not the usual kind and doesn't have application notes.  Would you happen to know of a schematic that would work in this particular case that I can analyze and learn from?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf