Schmitt trigger oscillator questions

Thread Starter

Dut Chen

Joined May 19, 2017
27
I'm trying to create a simple square wave generator as clock input, after alot (and i mean a LOT) of fiddling i managed to get this circuit running:

(i'm terrible at drawing circuits)

I'll explain what everything is:
  • The circuit within the red border is a schmitt trigger circuit i took from wikipedia.
  • The circuit within the blue border is a not gate design i came up with myself
  • The circuit within the purple border is an RC circuit with a potentiometer to control the frequency (also commonly seen with ne555 circuits)
  • The 1M pulldown resistor on the output of the schmitt trigger is to prevent any transistors that might be hooked up to it from accedentally turning on
  • The 100k resistor between the RC circuit and the schmitt trigger is to prevent the capacitor from discharging too quickly, i've found 100k is good because it doesn't affect the high and low threshold of the schmitt trigger to much.

I have some questions about this circuit though:
  1. according to some equations i found online the resistor values i chose for the schmitt trigger should make it so it has a low threshold of roughly 1.66 volts and a high threshold of 3.33 volts, but what i'm actually seeing is a low threshold of 1.75 volts and i high threshold of 3.14 volts. This is not a very big problem as it just slightly changes the frequency which i can compensate for by turning the potentiometer, but it still annoys me and i would like to know why this happens and how to fix it.
  2. currently the capacitor charges through 2k+p and discharges through 1k+p, where p is the current resistance of the potentiometer. Because of this the duty cycle will be 2:1 at the highest frequency and will approach 1:1 when the frequency is lowered by the potentiometer. I can lower this amount, but i would much rather get rid of it completely and i can't figure out how. So my second question is: how do i make the duty cycle 1:1 even at high frequencies?
  3. currently the circuit uses about 5.2ma when discharging the capacitor and about 900ua when chargin the capacitor. This is not too much but lower is always better, so are there any ways other than increasing the values of the resistors to decrease power usage without sacrificing functonality/frequency.
  4. this one is very similar to question 3 and the answer might even be the same, but i still think it deserves a different question. As a beginner and total noob in electronic engeneering i always think my circuits are way too complicated for what they accomplish, that they use way too many components and that somebody with more knowledge in electronics could build a circuit that accomplishes the same thing but a million times better and simpler. I'm mostly worried about the not gate and the pnp type transistor at the end of the schmitt trigger, i feel like they don't do anything but i can't get the circuit to work without them, am i missing something or is this really the best way to do it?
  5. My fifth and last question is just about the general quality of the circuit, i always feel the best way to learn is by failing. But i can't learn from failing untill i know i've failed, so is the circuit shown above actually a decent circuit or should i throw it in the bin and hope i never see it again? Please also explain why so i know what i've done right and what i've done wrong.
Thanks for taking the time to read this quite large post.
 

Thread Starter

Dut Chen

Joined May 19, 2017
27
While that circuit does use way less components and has a high threshold of very close to 3,33 volts, it uses more than twice the current and still has the problem of the low threshold being nowhere near 1.66 volts (more than 2!). And it also still has the problem of the capacitor charging faster than it discharges, that causes an assymetric duty cycle and that's not what i'm looking for.

Use a single Cd4093 gate.
I'd like to build the whole circuit using just basic components.
 

Sensacell

Joined Jun 19, 2012
3,447
I love the CD4093 oscillator trick, it also works with 74HC14 hex inverters, a schmitt trigger input and invert function is what you need.

That would be my go-to solution for a really quick and dirty clock.

1) An 'HC14 can create 6 independent oscillators in one package!
2) Outputs are rail-to-rail.
3) Cheap as dirt.
4) Always works.
5) 50% duty cycle.
6) Low power.

Downsides:

1) Very poor frequency predictability.
2) Not very stable.
3) Bad choice for long delays
 

Dodgydave

Joined Jun 22, 2012
11,302
While that circuit does use way less components and has a high threshold of very close to 3,33 volts, it uses more than twice the current and still has the problem of the low threshold being nowhere near 1.66 volts (more than 2!). And it also still has the problem of the capacitor charging faster than it discharges, that causes an assymetric duty cycle and that's not what i'm looking for.


I'd like to build the whole circuit using just basic components.
It has a 50/50 mark space ratio, you can alter it using steering diodes.
 

Thread Starter

Dut Chen

Joined May 19, 2017
27
update:

i have constructed this circuit, it is a mix of the circuit suggest by AlbertHall and my original circuit:

(Resistor values are not standard because i also built in real life and i do not have all resistor values so i used multiple resistors parallel to get as close as possible)

this is the real life version:

(i like making things as compact as possible, so sorry if it's a bit hard to see)
The transistors on the left are npn and the transistors on the right are pnp, the capacitor is 1uf and i will eventually put a potentiometer in series with the 1k resistor at the positive side of the capacitor.

Problem is: it doesn't work, i have tried looking for the problem with a multi meter for close to two hours now and i don't know why it's happening. All i know is that the capacitor never gets above 0.54 volts and at the emitter of the bottom-right transistor on the breadboard is not 5 volts even though it should be on. Any help?
 

Thread Starter

Dut Chen

Joined May 19, 2017
27
If it doesn't work you can spin your wheels looking for the problem or drop back to a simpler and known working circuit. Don't worry about precise values, just make something work. You can always tweak it later.

http://www.johnhearfield.com/Eng/Schmitt.htm
I do use that circuit in my design (overlay taken from your link):

The full circuit works fine on the simulator, just not in real life and i don't know why.
Simulator i'm using: http://www.falstad.com/circuit/circuitjs.html
 

crutschow

Joined Mar 14, 2008
34,431
Below is the LTspice simulation of your breadboard circuit, which oscillates.
I did change the output transistor resistor value since 100M (100Meg?) is too high.

I would look for an error in your circuit wiring.
It's very easy to make a mistake when wiring a plug-in breadboard.
Trace out each connection with an ohmmeter, marking every connection you check with a highlighter on the schematic.
Also double check all component values, and transistor orientation.

upload_2017-5-22_14-6-40.png
 

Thread Starter

Dut Chen

Joined May 19, 2017
27
Thanks, that verifies the circuit itself is correct. For now i still haven't found an error in the circuit on my breadboard, but it's getting late so i'll do some more debugging tommorow.

Also, i used 100Meg because i was testing some stuff by changing resistor values and forgot to change that one back, 100Meg is indeed way too high
 

Thread Starter

Dut Chen

Joined May 19, 2017
27
I allowed for the fact that the circuits were similar. By my count your circuit has a few extra components. That is where the likely problem is.
Sorry i misunderstood, i'll cut off the schmitt trigger from the rest of the circuit and see if the schmitt trigger works.
 

Thread Starter

Dut Chen

Joined May 19, 2017
27
The schmitt trigger seems to work fine, i see a change in voltage whenever i cross one of the thresholds. I think the problem is that the pnp transistor at the end of the schmitt trigger is not active even though it should be, but i have no idea why.
 

Thread Starter

Dut Chen

Joined May 19, 2017
27
I did not know that the collector and emitter on BC557 are different from BC547 untill looking up the datasheet. So i rotated them 180 degrees and now it works! The schmitt trigger also seems to be behaving better in real life than in the simulation with a difference of ~1.6 volts rather than ~1.3 in the simulator, computers are weird.

Now i'm just waiting for some resistors from china so i don't need so many in parallel, that should clean up the board a bit.

Thanks everybody!
 

crutschow

Joined Mar 14, 2008
34,431
.....The schmitt trigger also seems to be behaving better in real life than in the simulation with a difference of ~1.6 volts rather than ~1.3 in the simulator, computers are weird.
That large a difference in the voltage indicates there's a significant difference in one of the part values between the simulation and the actual circuit, not from a weird computer.
Check the values of R3 and R4 (my schematic) on your breadboard.
 

Thread Starter

Dut Chen

Joined May 19, 2017
27
That large a difference in the voltage indicates there's a significant difference in one of the part values between the simulation and the actual circuit, not from a weird computer.
Check the values of R3 and R4 (my schematic) on your breadboard.
They are both the same, but i just hooked up the oscilloscope again and now it shows a difference of ~1.3 volts just like in the simulator. So i guess i'm not done yet because according to my maths it should be 1.66 volts. And even with the slight change in resistor values it should not be as low as 1.3 volts.
 

AlbertHall

Joined Jun 4, 2014
12,346
That calculation does not allow for the base emitter voltage of the transistors.
For instance: RE = VHT / IE should be RE = (VHT - Vbe) / IE
 
Top