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:
I have some questions about this circuit though:
(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:
- 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.
- 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?
- 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.
- 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?
- 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.