Shop OBEX P1 Docs P2 Docs Learn Events
Problems with bistable multivibrator latch — Parallax Forums

Problems with bistable multivibrator latch

MicrocontrolledMicrocontrolled Posts: 2,461
edited 2013-01-10 17:43 in General Discussion
I'm building a latch using this circuit httpstudyvilla.comImagesmultivb3.jpg
I'm using all 100 ohm resistors except the pulldowns on the base pins which are 10k. I'm using 2N3904 transistors, .1uf ceramic capacitors, and 1N4004 diodes. The circuit will only latch/unlatch when I touch the clock line to power. If I connect it to a pushbutton or pulse generator it does not work, and I cannot figure out why. The pulse generator is buffered by a transistor and the pushbutton is connected straight though to power, so it should be basically the same electronically. I have built this circuit before and it has worked with both methods, so this is a real mystery. If anyone could help me out, I would greatly appreciate it.

Thanks,
Microcontrolled
«1

Comments

  • ercoerco Posts: 20,259
    edited 2013-01-08 14:37
    Hey, couldn't you drive 2 servos using that circuit and just one I/O pin? :)
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2013-01-08 14:51
    Probably, but why would you want to?
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2013-01-08 15:12
    Are you sure the polarity of the trigger is correct? How about if the pushbutton goes to ground, and a 10k resistor to Vcc, and the junction to the trigger input?

    The way I see it, the commutation pulse should pull both bases down through the diodes, but the difference in charge stored on the capacitors makes the circuit flip, or flop.
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2013-01-08 15:32
    @Tracy: I've tried switching the polarity of the pushbutton, but it still doesn't work.
    BTW, The finished product of this circuit needs to use a clock pulse to flip the latch, not a pushbutton.
  • Heater.Heater. Posts: 21,230
    edited 2013-01-08 16:03
    Does your push button connect alternately to ground and Vcc or is it left open in one state?
    Similary does your transistor buffer have a stiff pull up.

    That circuit is giving me headache just now but I can't help thinking you need to be sure the center point of the two capacitors is discharged as well as charged. Or vice versa.

    I have seen this kind of flip flop done with tubes. Two triodes and no diodes. Isn't it possible to make the transistor version without diodes?
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2013-01-08 16:40
    I'm pretty confident that the steering network with the diodes and capacitors is meant to be triggered by a solid high-to-low pulse, not vice versa. Where did you find the circuit?

    The resistors, 100Ω all around, seem pretty low. What's the supply voltage, Vcc? Resistors R1 and R4 are the load, but the resistors R2 and R3 supply the only base current to the cross-coupled transistor and could be higher values. 10x higher is reasonable, still enough base current to drive the transistor to saturation, and more voltage swing at the collector of the transistors. The resistors R5 and R8 for the steering network could also be larger values, say 10k. They determine the time constant between trigger events.
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2013-01-08 18:40
    @Tracy Allen: Honestly, I drew up the circuit I'm using from scratch, then googled and found this one so I wouldn't have to scan it in. (I know, I'm lazy) The only difference between the one I'm using and the one here is that rather than pulling each base to ground, I pulled the input trigger to ground with a 10k resistor, and I reversed the direction of the diodes. I built this circuit and got the same results, though.

    Based on the circuit of my own design, I built 3 working copies and had them setup in a working data array, but now that I rebuilt it using newer components, I can't get it working. The resistors I used in the initial (working) prototype had no markings, so I don't know the value (they came with a bulk purchase of eBay LED's, and they were all I had at the time I made the first prototype) but I assumed them to be about 100 ohms as they were intended to use with LEDs and a 9V source. The problem is, even if I build the circuit now using the exact same items that I did when I had it working, it still won't work. For some reason tapping the wire on the power rail will flip the latch, but directly connecting it with a pushbutton or a pulse will not.

    @Heater: I haven't managed to make it without using diodes. It took me 5 revisions before I got a working transistor latch circuit, so I wasn't up for trying to design one that didn't use diodes after I got it finally working. I first tried an all-transistor and resistor circuit that was basically the transistor logic equivalent of a logic gate latch, but it failed to work. I then tried a combo double-latch transistor and diode circuit that was rejected due to the high part count (the circuit I'm working on requires 44 of these, so every component counts). I finally started working with the transistor bistable multivibrator circuit and attempted to convert the SR latch to a T flip flop using transistor logic, but once again failed. This is the last attempt at it, using the capacitors to hold the charge at each of the transistor bases so that the latch can be triggered with one pin. It worked, up until now, so I thought I had found what I was looking for.
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2013-01-08 18:54
    What is the application? If you just want a push on / off type of circuit, there are better solutions ... IMHO ... that still use the same number of components.
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2013-01-08 19:03
    @Beau: I would rather not name the application, as I'm building it purely as a challenge and if I fail, I would rather it not be known. I've worked on it for a long time, and I've just now gotten to the point where I construct the first complete prototype. However, I will say that it requires multiple data arrays constructed entirely out of passive components and transistors.
  • ctwardellctwardell Posts: 1,716
    edited 2013-01-08 19:17
    @Beau: I would rather not name the application, as I'm building it purely as a challenge and if I fail, I would rather it not be known. I've worked on it for a long time, and I've just now gotten to the point where I construct the first complete prototype. However, I will say that it requires multiple data arrays constructed entirely out of passive components and transistors.

    A propeller 2 using discretes? ;-)
  • jmgjmg Posts: 15,183
    edited 2013-01-08 19:19
    I'm building a latch using this circuit

    Why use a 60 year old design approach, when you can use that stuff invented ~ 30 years ago called Logic ICs ?

    Modern Logic comes in small packages, and has Schmitt action on the clocks.
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2013-01-08 19:23
    @jmg: I could do this entire project using a single microcontroller with very little external circuitry. I could also do it in just a few logic chips. Using a microcontroller, I could conceive and build the entire circuit in 2 hours, for less than $30. Instead, I spend $100, and 2 weeks drawing schematics and testing designs. Why? Because I want it to be a challenge. I've learned more about analog circuitry in this project than hours of classes could give me. That is why I'm doing it the old fashioned way. :)
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2013-01-08 19:32
    Ok, somehow I just breadboarded 2 more of these latches and this time they work, but they don't latch off like they should (for my intended purposes, this is unneeded, as they are held in their state by external circuitry anyway) but I would like to know why. This also doesn't explain why they suddenly work, or why the soldered ones still display the same behavior.
  • ctwardellctwardell Posts: 1,716
    edited 2013-01-08 19:53
    Ok, somehow I just breadboarded 2 more of these latches and this time they work, but they don't latch off like they should (for my intended purposes, this is unneeded, as they are held in their state by external circuitry anyway) but I would like to know why. This also doesn't explain why they suddenly work, or why the soldered ones still display the same behavior.

    This isn't making sense to me.

    They work, but they don't latch...then they don't work.

    They are held in their state by external circuitry anyway...then why do you need a latch?

    Are you sure you can't describe a little more of the surrounding detail?

    C.W.
  • frank freedmanfrank freedman Posts: 1,983
    edited 2013-01-08 20:02
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2013-01-08 20:05
    @ctwardell: They latch, but you can't "unlatch" them. Sending another pulse doesn't reset the latch. What I was saying was, once they are latched, the external circuitry shuts off the clock line so that they cannot be unlatched until the data bus is reset.

    You know what, here's the schematic. It's worth a thousand words. TransistorClockSchematic.pdf Just don't hold me to it if it doesn't work in the end, it's purely experimental. The goal of the final project is to have a functional digital clock using nothing but discrete components, which is why it is crucial that I don't use logic gates.
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2013-01-08 20:06
    This seems like a random walk through the parts bin! Yes you can learn a lot by doing this, but please don't be lazy, please give us the real deal schematic of what you're building and not a poor surrogate. Here is a URL to the circuit you posted, with some parts values filled in. Note that it shows the high-to-low pulse trigger.

    Some half-baked circuits are sensitive to small changes in component values. Even a small difference in capacitance that exists between a plugboard and a soldered board can have a serious effect, so that it works one way here, and another way or not at all there.

    PS--I see you just did link to your schematic, thanks. And Frank linked to another source with the #1 circuit.

    PPS--Just took a look. No wonder you hadn't posted it before!
  • ctwardellctwardell Posts: 1,716
    edited 2013-01-08 20:11
    @ctwardell: They latch, but you can't "unlatch" them. Sending another pulse doesn't reset the latch. What I was saying was, once they are latched, the external circuitry shuts off the clock line so that they cannot be unlatched until the data bus is reset.

    You know what, here's the schematic. It's worth a thousand words. TransistorClockSchematic.pdf Just don't hold me to it if it doesn't work in the end, it's purely experimental. The goal of the final project is to have a functional digital clock using nothing but discrete components, which is why it is crucial that I don't use logic gates.

    Ahhhh, one of those "a hill I just have to climb" projects!

    I would get each "sub-circuit" worked out and fully understood before moving ahead.

    C.W.
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2013-01-09 10:48
    Well, I see the battery and an astable multivibrator as main clock source in the lower left-hand corner, and working toward the right, it appears that the individual toggle flip flops are arranged as a synchronous counter rather than a ripple counter.

    +1 on what C.W. said. It would be a good learning experience to understand the basic transistor multivibrator circuits. The very word multivibrator evokes a lost age. But the clock project as a whole looks like torture! Where did you find that schematic?

    Definitely find a pile of 4.7k resistors to try instead of questionable 100Ω.
  • Heater.Heater. Posts: 21,230
    edited 2013-01-09 11:16
    Microcontrolled,

    Don't give up, torture or not.

    A decade or so ago I found easy access to an effectivly infinite supply of BC108 transistors at my work place.

    So my lunch time project for many weeks was building logic gates, then flip-flops of varying complexity and ending up with a four bit binary conter. Complete with LEDs on the collectors to display the count. (Tip: all circuits shouls include LEDs)

    Of course I was not being tricky and using diodes and capacitors so each of my divide by two stages used 2 transistors for the master flip-flop, another two for the slave flip-flop and a bunch more for the feedback/steering gates.

    Sadly, my contract work at that company ended before my transistor clock project was complete.

    What I do remeber though is that I was working with a bunch of guys involved in designing ASICs. When I asked them how to put my flip flops together with discrete transistors they were no use what so ever.:)
  • Heater.Heater. Posts: 21,230
    edited 2013-01-09 11:20
    Tracy is a bit of a wimp:)

    Here is a digital clock built entirely with vacuum tubes:

    http://www.engadget.com/2006/06/26/all-tube-digital-clock-seven-years-in-the-making/

    Same idea just bigger and hotter...
  • Heater.Heater. Posts: 21,230
    edited 2013-01-09 11:39
    Oh, forgot to mention. Of course you can make flip flops and therefore counters and therefore digital clocks, even computers with good old fashioned relays never mind transistors. Back in technical school I made a divide by four stage with one meter long pneumatic actuators and spool valves. You should have heard that thing as it was counting !
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2013-01-09 11:52
    @Tracy: I'm not sure what a "ripple counter" is, but my data array stores bits in a series and then separates them when they are sent out to the display (to avoid displaying multiple digits overtop of each other), which I'm guessing is the same thing.
    As for the schematic, I didn't "get it" anywhere, I drew it up. This was my challenge: to build a working transistor clock using no logic IC's, and to draw all original schematics. The rules were that though I could ask this forum for help if I needed it, I could not use the internet for any other resources. Paper sources of information are fair game, but googling "transistor latch" before I had a working model was off limits, so I had to come up with it myself. It took me 2 weeks just to get the schematics done, and I'm guessing it will take many more before construction is complete.

    @Heater: That sounds really neat. I used the "master-slave" setup for the second prototype of my flip flops, and it was a mess. It must have taken you forever to get a working counter.
    That tube clock looks like it was a pain to design, but totally worth it in the end. :)
    BTW, I don't even know what a "spool valve" is, but why would you use mechanical equipment to make a counter when you have good ol' transistors?
  • Heater.Heater. Posts: 21,230
    edited 2013-01-09 12:34
    Microcontrolled.

    Thing is, you have probably realised by now, it is quite easy to make logic gates with transistors. AND, OR, NOT etc.
    The next step is to understand how to make flip-lops, latches, counters, adders etc etc out of logic gates.
    Putting those bits of knowledge together you might build a toggle flip-flop out of gates, which is in turn built out of transistors and end up with a solution using eleven transistors or whatever.

    Meanwhile, that toggle flip-flop you have presented exploits some tricks of capacitance and such that it can be a toggle flip-flop in only two transistors. Amazing.

    There are similar "tricks" using the properties of relays and the physics of their magnetic parts that enables one to create a toggle flip-flop from only two relays. Which, looking at the simple logic of the switching mechanisms is impossible.

    My transistor counter used no capacitor tricks and hence a lot more transistors, still only took a few lunch times to build it.

    The "spool valve", if they even call it like that these days was easy. In my mind air pressure went in one hole and came out of one or other of two holes. Meanwhile air pressure into one or other different holes could move a piston in the valve steering which hole the input air came out of, if you see what I mean. Kind of like a logic gate.
  • ercoerco Posts: 20,259
    edited 2013-01-09 14:20
    Heater. wrote: »
    The "spool valve", if they even call it like that these days was easy. In my mind air pressure went in one hole and came out of one or other of two holes. Meanwhile air pressure into one or other different holes could move a piston in the valve steering which hole the input air came out of, if you see what I mean. Kind of like a logic gate.

    I've rebuilt a few automatic transmissions in my day, Ford C-4s and TorqueFlite 727s. All-mechanical marvels using planetary gearsets. The valve body is an amazing hydraulic computer chock full of spool valves, check valves, accumulators, springs, labyrinthine passages, seperator plates, calibrated orifices, etc which did all of the "computing logic". Piping hot ATF fluid is pumped through as lube/coolant/hydraulic fluid/hydraulic coupler (within the torque converter) and the system monitors shaft RPM and engine vacuum to engage two outer bands and engage/release different internal clutch packs. These things are nearly bulletproof and operated under all temperature/road conditions. Back before slapping on a microcontroller to do everything was an option, those mechanical engineers really earned their paychecks.

    http://www.transmissiontester.com/china-09g_09d_valve_body_remanufacture_rebuilt_transmission_valve_body-145630.html
  • ercoerco Posts: 20,259
    edited 2013-01-09 15:36
    I found an online TTL quiz at http://www.ibiblio.org/kuphaldt/socratic/output/ttl.pdf which might be helpful to anyone who wants a refresher course on the fundamentals. Answers are at the end.

    It has that delightful college textbook feel to it. Nummy.

    Edit: Mostly same material at http://www.allaboutcircuits.com/worksheets/ttl.html with "reveal answer" links plus help pages at end.
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2013-01-09 20:19
    I attempted the circuit again using higher values of resistors (10k ohm, because it's all I had on hand) and it worked. I ordered 500 4.7k (10k created too low of an output current) and another PCB. Looks like the projects on hold again until those get here, but at least it should work properly this time. Thanks for the help!
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2013-01-09 22:49
    That great that it worked with 10k. Probably 4.7k will be good, too.

    That's quite a remarkable circuit, particularly for someone who doesn't know what a ripple counter is. (It's another relic of an earlier age). I'm interested to hear your explanation of how it works, or is supposed to work when finished, or even how some bits and pieces work.
    Screen shot 2013-01-09 at 10.16.28 PM.jpg


    Here is the tiny lower left-hand corner of your circuit. There is the astable on the left, and that is feeding a long chain of diodes in series that go one after another to the "clock" line of the individual flip-flops. The clock signal has to pass through a pair of transistors that involve a logical combination of the Q output of the previous stage and the Q\ output of the current state. That is what leads me to think that you are trying to make a synchronous counter (but I haven't groked how or what). If it were a ripple counter, the Q\ output of each stage would be connected to the trigger input of the next stage. That arrangement ripples, because the trigger pulse at the input takes time to propagate through the sequence of flip-flops (and it could display incorrect digits briefly in the process). But you do not have a ripple counter here. I'm not sure exactly what it is, but a synchronous counter is built from J-K type flip-flops that all share a common clock, and when the common clock pulse comes along, they all change state at (pretty much) the same instant.

    I was puzzled by why the "NOT Q" label is on the same node as "Vdd" power. NOT Q belongs on the junction between the transistor collector and the 4.7k resistor. Well, that's a minor puzzle. Keep at it a bit at a time!
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2013-01-09 23:02
    Heater, the wimp resembles that comment! :lol: That kind of circuit pursuit is for the young!

    I did in younger days wire up large arrays of 1) neon bulb subcritical oscillators and 2) same with coupled programmable unijunction transistors. It was supposed to be kind of a neural net, to respond to external periodic or random inputs, and synchronize or not. Inspired by fireflys, or heart cells. That was college. The profs were working on the forced van der Pol oscillator (a kind of multivibrator circuit), and other such things that have internal clocks, to see how they can exhibit deterministic chaos, noise. I didn't learn much from the big arrays, but it was rewarding to dig into the individual circuit cells.
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2013-01-10 06:38
    Ideal Circuit Behavior
    For each full clock cycle generated by the astable multivibrator, the next sequential latch in the chain changes it's state. When the end of the chain is reached, all the latches are reset to their default. As each latch is activated, the 7 segment increments by 1. These individual "digits" are linked together to form, essentially, a clock.

    Theory of Operation
    An astable multivibrator generates a clock pulse that controls the rest of the circuit and keeps it on time. This has to be the most precise part of the clock. The clock keeps data stored in an array, which is then outputted to the 7 segment displays. The array is a series of linked bistable multivibrators modified to be T flip flops. The goal was to get only the next sequential one to latch with an incoming clock pulse, which is done using a 2 transistor AND gate. The clock pulse can only activate a latch when the NOT Q from itself is high (meaning that it cannot be changed once it has latched, as NOT Q will be low), and when the previous gates Q is high. This means that (1. The gate can only be triggered when the previous one has been triggered (2. The gate can only be flipped if it is not in the "latched" state. The diodes are added to feed into the base of the transistors to prevent the base current (I'm not sure what that's called) from feeding back into the mulitvibrator and causing trouble. The diodes across the clock lines are to prevent any unwanted signals from the clock line of the multivibrator from activating any of the other latches, so it's really just a precaution rather than a necessity. When the last latch is activated, it resets the series of latches by clicking the power off using a relay. This is quite a crude and unconventional method, but it was be economical than using multiple transistor mechanisms to individually reset each latch. When the relay flips over, the action of it flipping to the opposite pole serves as the clock pulse for the next string of latches.
    The translation to the LED digits is simple. A PNP transistor on each signal line prevents current from flowing if the next sequential latch is active, preventing multiple digits from being displayed on top of each other. It is also fed into the base of an NPN transistor so that the current from the latch isn't needed to power the LED's. The LED digits are selected using an array of diodes, operation is pretty self-explanatory.

    I'll post pictures of my paper schematics (much easier to read) when I get the time.
Sign In or Register to comment.