Main > Main Forum

12 volt coin counter with I-Pac/4

Pages: << < (4/7) > >>

MonMotha:

You would need a separate resistor going from 5V to each input.  Try 3.3k (or even as high as 4.7k) and decrease until you find something that works.  I wouldn't go below 500 ohms if you can't get it working that way.  Basically, you're trying to increase the current through the (effective parallel combination of the two) pull-up resistor, which flows into the base and results in collector current which triggers the counter.  Just as a reference, the ratio of collector current to base current is found in the datasheet for the transistor as h_fe (which is the DC current gain, and is what we have here).  If you get into engineering literature, you may also see it referred to as beta.

As for making your own darlington pair (you can buy them already built in a standard TO-92 package that you're used to using), a couple of 2N3904s will work fine.  If you can get that many diodes in there before it stops working, you should have no trouble with a 2xVbe drop associated with a darlington.

clhug:

Sounds good.  I'll probably give the darlington pair a try first though since that should work.

However, I've come across a whole new idea that I wanted to run by you.  I found a rough version of this in another search of the forum.  I've attached a picture (the first attachment) of a new wiring diagram for the basic 5 volt counter.  Here, instead of wiring the counter in the common side (after the normally open switches), they're feeding a separate 5 volts in directly from the PC power supply to the counter, then attaching the other side of the counter BEFORE the normally open switches.  Idea being that when the switch closes it draws the current both from the I-Pac and from the separate 5 volts through the counter to ground, thus firing the counter.  Since the counter is pulling its 5 V directly from the PC power supply it should have enough current to trigger it.  With this diagram, we definitely DO need the diodes, but hooked up a bit differently.

First, take a look at the first attached picture to this message (the one withOUT the transistor) and tell me if you think that diagram would work in general for a native 5 volt counter.  What I don't know is, is supplying that separate 5 volts directly from the power supply going to cause any issues being connected to the 5 V coming out of the I-Pac inputs, or potentially damage the I-Pac?

Second, now, if that diagram should work using a native 5 volt counter, then I've tried to adapt it to using the transistor to drive the 12 volt counter.  See the 2nd diagram attached to this message (the one with the transistor) and tell me if this should work, and if I've got the transistor hooked up properly for this method.  Here, since we're pulling the 5 V directly from the PC power supply to the base of the transistor instead of relying on the current out of the I-Pac, I would think it should be enough to trigger the transistor and let the 12 V pass.

What I might see as a catch here though is, this method doesn't completely isolate the 12 volts from the 5 volts.    With the old method we were trying to make work, the 12 V just went in the collector and out the emitter, and I assume wasn't able to get back past the base to the I-Pac.  With the new method the 12 V essentially still ends up making contact with the I-Pac once the switch is closed, or doesn't that matter because it's still grounded at that point?  Or could I set up something with dual transistors where the first transistor activates the 2nd transistor and the 2nd transistor is the one that actually carries the 12 V directly to ground.  I guess I envision something like the darlington pair again only not being used to amplify, but to isolate.

Of course, if the basic idea of the first diagram in this message won't work, then never mind the 2nd.

MonMotha:

The first of your two proposals will work fine.  The latter will blow up your transistor :)

Basically, think of the base-emitter junction of the transistor as a diode (physically, it actually is).  Imagine what would happen if you were to place 4.3V across a diode with nothing else limiting current.  Basically, you'd end up with a cooked diode and possibly a dead power supply (most PC supplies should kick in a thermal limit pretty quickly if they don't have straight current limiters).

You could do it that way if you put a resistor on the base of the transistor.  If your counter needs 100mA, divide by beta, account for any junction drops you have (2, in this case, for a total drop of ~1.4V), subtract from 5V, and solve for R.

As far as isolation, you can think of the collector and base as another diode (physically, they are again), but it'll be reverse biased and completely off in normal applications.  What happens in a transistor (at least a BJT, MOSFETs operate differently) is that as current flows into the base, it sucks a bunch more current from the collector with it, and everything flows out of the emitter.  The base to emitter looks like a diode as it's the PN part of NPN (a diode is just a PN junction).  The explaination actually makes a little more sense if you track electrons, but then all the signs flip since conventional current tracks positve carriers.

clhug:

Ah, good point.  I should have realized that and just overlooked it.  The tranistor isn't really a load so it essentially creates a dead short between the 5 V source and ground.  That probably would blow the PC power supply if the transistor doesn't burn up first.

But in choosing a resistor size to put on the base, I don't need to worry about the current required by the counter do I?  I only need to be concerned with the current required to trigger the transistor base to let the 12 V flow from the collector don't I?  Or are they tied together?  Could you give a bit more detail on how to figure what size resistor I need?  What's beta?

For isolation, yep, I understood exactly that's how the transistor worked (acting as diodes between collector and base and between the base and emitter.  That's exactly why I'm concerned about the new basic diagram.  With the old diagram, the 5 V from the I-Pac was hitting the base, and the 12 V was coming in the collector and the emitter went straight to ground, so because of the diode situation between the collector and base the 12 V never made it back in the direction of the I-Pac, it just went directly to ground.  With the new config, the emitter is making direct contact with the I-Pac inputs so I'd be sending the 12 V in direct contact with the I-Pac inputs on it's way to ground.  Will that damage the I-Pac since it's only designed for 5 V?  That's why I want to isolate the 12 V entirely and trying to think of another transistor in the mix.

I've figured out that the darlington pair definitely won't work for isolation because they still share a common collector and emitter which is exactly what I don't want here.  Attached is a new drawing I thought of that chains two transistors to isolate the 12 V on the 2nd transistor, but I have no idea whether this will work with the current flow.  Will the current flow "Y" off to still fire the base on the 2nd transistor and still go to ground through the diodes and the normally-open switches to pull the I-Pac inputs to ground?  Or will the current from the first transistor always flow up through the 2nd transistor to ground essentially giving me an "always-on" for the 12 V on the 2nd transistor regardless of the state of any of the switches?

Or maybe with this method if I want true isolation of the 12 V from the I-Pac inputs, maybe I need to go back to the relay.

MonMotha:

That won't do what you want either.  The collector is always fairly isolated from the base/emitter due to the physics of the device (unless the base is at a higher voltage than the collector), so that's not an issue.  You don't need to worry about where the current goes particularly: as long as the potential at the input pin of the IPAC doesn't exceed its ratings, you're fine.  In this case, switch down, it's directly grounded out, so that isn't a problem.  Your previous layout will work fine if you put a resistor on the base of the transistor to limit the current.

Beta is the current gain of the device.  You can look it up on the datasheet as h_FE or figure it will be somewhere between 50-350 (yes, they vary that much).  Basically, assume a worst case current gain (so 50), divide the current required to run your counter by that, and that's how much base current you need (at a minimum) to get the counter to fire.  Then, pick a resistor to make the base current slightly above that when everything else is "on".  Figure the voltage across a diode or base-emitter of a transistor will be about 0.7-0.8V when it's "on".

Pages: << < (4/7) > >>

Go to full version