Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: 12 volt coin counter with I-Pac/4  (Read 10520 times)

0 Members and 1 Guest are viewing this topic.

clhug

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 179
  • Last login:April 04, 2024, 10:49:58 pm
12 volt coin counter with I-Pac/4
« on: April 14, 2006, 12:41:16 am »
EDIT: If you're just looking for the solution, save yourself a lot of reading and skip to the last 2 posts in the thread for the final circuit that worked.


I'm converting a cabinet into MAME.  The cabinet I bought has a fully functioning coin door which I intend to use, and it also has a coin counter.  I know there's no real reason to, but as long as I have it, I'd like to wire up the coin counter.  I have already searched the forums and found some info on hooking up coin counters with the I-Pac.  I've found TheNasty's diagram and that will give me the basis for what I need.

However, everything I find assumes a 5 volt counter that the I-Pac is able to directly feed.  The counter that came with the cabinet is 12 volt.  I found a few messages asking about hooking this type of setup up, but no definitive answers.

The only thing I can think of is to use a relay.  Basically replace the counter in TheNasty's diagram with the trigger side of the relay, and feed 12 V the other way through the relay for the counter.  I've found two 5 volt relays at Radio Shack and I'm wondering if somebody can tell me if this should work.

Catalog # 275-240
http://www.radioshack.com/product/index.jsp?productId=2062480&cp=2032058.2032230.2032277&pg=2&parentPage=search&origkw=relay&kw=relay&parentPage=family

Catalog # 275-232
http://www.radioshack.com/product/index.jsp?productId=2062478&cp=2032058.2032230.2032277&pg=2&parentPage=search&origkw=relay&kw=relay&parentPage=family

My main concern is, I want to make sure neither of these will draw too high a current and potentially eventually fry either the I-Pac or the USB port it's plugged into.  I know USB has a maximum rating.  The first relay (cat #275-240) says it has a coil rating of 90 mA and 55 ohms.  The 2nd, smaller, relay doesn't list it's coil current rating, but says it's 150 ohms.   Based on that, would somebody be able to tell me if I should be okay driving either of those relays from the I-Pac plugged into a USB port?

Thank you!
« Last Edit: December 12, 2023, 10:05:05 pm by clhug »

MonMotha

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2378
  • Last login:February 19, 2018, 05:45:54 pm
Re: 12 volt coin counter with I-Pac/4
« Reply #1 on: April 14, 2006, 01:39:53 am »
Just use a transistor.  If you have an output high from your device, use an NPN with the output from your device hooked up to the base via a small (say 100 ohm or so) current limiting resistor, ground the emitter, and hook the collector up to your counter.  Hook the other end of the counter up to 12V.  A small signal transistor such as a 2N2222 or a 2N3904 should be fine.

If you'd like to use a relay, you can also drive the relay (either 5V or 12V) using the same method: just replace the coin counter with a relay coil.

That said, the coil on the second resistor will suck 33mA.  That's a bit more than I'd like to pull from even a CMOS device (and don't bother with TTL).  You can calculate that using Ohm's law: V=IR.  Solve for I=V/R=5/150=33mA.

If your device you want to drive the counter with is active low, you can use a PNP hooked up to your 12V rail with the collector pushing current into the counter - ground the other end of the counter.

clhug

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 179
  • Last login:April 04, 2024, 10:49:58 pm
Re: 12 volt coin counter with I-Pac/4
« Reply #2 on: April 14, 2006, 09:12:11 am »
Thanks for the info.  Somebody in one of the threads I found in my search mentioned transistors but didn't give enough detail and I don't know enough about transistors to know what specific ones to use myself.

Now, my question is, I want to drive this off my I-Pac per TheNasty's diagram.
http://free.hostdepartment.com/T/Thenasty/byo.htm

Can anybody tell me, per MonMothma's info about which transistor to use (NPN or PNP), whether the I-Pac is an active high, or active low?

MonMothma, if I do need a PNP due to active low, can you give me specific transistor to use for that. and how would I hook that up? 

Also, one thing I'm not sure of is, with a relay, the 12 V signal side to drive the counter is completely isolated from the 5 V that drives the relay.  With the transistor there are only 3 pins, so I assume the 5 V and 12 V will share a ground?  This isn't going to cause problems?  It won't feed 12 Volts back through the I-Pac's ground, which is of course tied to ground on the USB port, which I'm not sure it could handle the 12 V since it is a 5 V device?  One thing I should mention, the 5 V and 12 volt sources come from different power supplies so they don't share a common ground normally.  The 5 V comes strictly through the I-Pac which of course gets its power from the PC.  The 12 V is coming from a completely separate power supply I have in the cabinet to drive the lights on the coin door (behind the coin reject buttons).  Since that PS came with the cabinet I bought and it was already wired up for the coin lights I decided to just use it rather than pull a separate 12 V source off my PC and have to rewire the lights.

One last question.  The more I thought about this, with TheNasty's original diagram we're driving the counter directly from the I-Pac which still a coil in an electromagent.  Essentially no different from the relay on the coil side.  So should I be okay with the relay (not burning out the USB or I-Pac) or does the coil in the coin counter probably have a higher resistance than these relays so they don't draw too much current?

I don't necessarily "want" to use a relay, it was just the only thing I knew how to wire up on my own.  I'm definitely open to the transistor thing.  I just want to make sure I'm not doing something that will fry my I-Pac or my PC's USB port no matter which way I go.

Thanks again!

MonMotha

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2378
  • Last login:February 19, 2018, 05:45:54 pm
Re: 12 volt coin counter with I-Pac/4
« Reply #3 on: April 14, 2006, 02:23:52 pm »
It's MonMotha (no stray extra m) - no relation to the star wars character :)

From that diagram, your device would appear to have an active high output, so any small signal NPN transistor should do (doesn't have to be one of the ones I mentioned).  You'd have to common your grounds for that to work though, as otherwise the current from one place or the other (depending on which ground you pick) won't have any place to go.  Current must be able to flow from both the base and the collector to the emitter.

If you'd like to drive a relay, you can.  I'm not sure what the relative current draws are of a coin counter vs. a relay as I don't know what your average coin counter pulls.  You can safely pull about 50-75mA from most CMOS devices if you don't mind the power (aka heat) dissipation (TTL tends to not be able to source as much as CMOS), but I like to keep things below 10mA if possible.  Of course, for low duty cycle situations (such as driving a relay coil), that may not matter.  Just watch out for inductive switching transients across the coil.  A reverse biased diode across the coil terminals will clamp these to something safe.  Using a transistor as a switch will isolate the chip from such nasties.

In this case, you could use the NPN transistor to switch a 5V relay, and then you would not need to common your grounds, but that seems like an awful lot of work (and parts).  Just watch the current draw from USB: it must remain below 500mA no matter what.  Is there a reason you're not wanting to common your grounds?  If you do decide to tie them together, make sure you do it at the frames or actual ground output from the PC PSU, not just off the USB ground.

clhug

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 179
  • Last login:April 04, 2024, 10:49:58 pm
Re: 12 volt coin counter with I-Pac/4
« Reply #4 on: April 15, 2006, 01:35:00 am »
I apologize for getting the name wrong.  You're right, I just had it my head.  :)

Thanks again for all the info.  I think I've just about got it.  I wanted to make sure though.  Hopefully TheNasty will forgive me for reusing his diagram, but I've taken it and modified it to what I think you're indicating with the transistor.  I've tried to attach it to this message.  Can you take a look and make sure I've got it right?  I've tried to attach the picture to this message so hopefully it worked.  This is the first time I've tried to include a picture in a post.

This is assuming that I will use the 12 volts from PC's own power supply rather than the separate power supply so the ground should be common between the 5 V and the 12 V.

Couple more quick questions.

What's the purpose of also tieing the ground back directly to the PC power supply ground rather than through the ground built in to the I-Pac?  Is that just because we'll still have 12 volts coming through there and we don't want 12 V going through the ground on the I-Pac, and thus through the USB port, so by grounding directly to the power supply in addition to the I-Pac we divert the 12 V that way?

Also, what's the purpose of the 100 ohm resistor?  The I-Pac shouldn't need it.  Normally the ground is connected directly to the input on the I-Pac through a NO switch (so when the switch is closed that specific input on the I-Pac is connected directly to ground).  Or is it to keep from frying the transistor?

On a side note, I stopped at Radio Shack on the way home tonight to pick up the parts.  I looked at that mini relay.  It's actually 250 ohm coil with a 20 mA current draw.  I'd think that should be low enough to not cause any damage if I decide to go that route.  It is only a very brief momentary contact every time a coin is inserted.  I suppose for people using coin buttons (which may be most) somebody could hold down the coin button but I don't think that would happen very often.

And last question (for now), what do you mean about inductive switching transients across the coil if I use the relay?  Does that cause it to trip when I don't want to, or not trip when it should?  What does the diode do to stop this, and can you suggest a specific diode (hopefully something I can get at Radio Shack).

I apologize if I'm being a bother.  I understand the basics of what a resistor, diode, and transistor all do, but I don't know enough to know details of what specific items fit for what purposes.

MonMotha

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2378
  • Last login:February 19, 2018, 05:45:54 pm
Re: 12 volt coin counter with I-Pac/4
« Reply #5 on: April 15, 2006, 01:48:58 am »
No problem.  The purpose of the resistor is to limit the currect coming from the device. You might want to bump that up to about 420-470 ohms, actually.  That'll keep the current down to about 10mA.  You can probably go as high as 1-3.3k (you just need enough base current to switch the coil in the counter - this current will be 50-250 times the base current at maximum, the transistor will saturate and whatever current is needed will flow through the counter).  At 100 ohms, you'll actually get about 40mA out of the chip, which is a little more than I like to source without looking at spec sheets.  If your relay is only going to draw 20mA, then yes, you could probably just drive it directly, but again watch out for inductive switching transients.

The purpose of returning ground directly to the PSU is so that you aren't pushing excessive current down the USB cable's ground wire.  It's only designed for 500mA (figure it's overspec'd quite a bit, but bear with me), and if you've got it available, it's best to avoid it if possible when you're switching larger loads.  And yes, you can just use the 12V from the PC supply (heck, my entire arcade-on-a-bench is powered by an ATX PC power supply).

Your circuit diagram looks fine.  See note above about increasing resistor size.  In theory, you can also remove the diodes from the switches (the transistor acts like one), but leaving them there won't do any harm (other than lowering the current due to the voltage drop across them), and provides some extra protection against nasties.

The inductive switching transients I speak of are where, due to the inductance of the relay coil, rather large votages can appear across it when you switch it on and off.  These can be large enough, especially when of the opposite polarity than you're normally considering to damage semiconductors, especially ICs.  The transistor will isolate the IC from these transients (and can probably withstand them just fine).  If you were to drive a relay directly, placing a diode backwards across the terminals of the relay (so it is normally reverse biased - make sure the reverse bias breakdown voltage is significantly greater than what you plan on using, most will be much larger than 5V) will clip these transients to about 0.7V, which isn't big enough to cause damage.  If you drive the load with a discrete transistor, you don't really need to worry about this (and if it broke, it wouldn't matter too much anyway).


clhug

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 179
  • Last login:April 04, 2024, 10:49:58 pm
Re: 12 volt coin counter with I-Pac/4
« Reply #6 on: April 15, 2006, 02:50:38 am »
Wow, you're fast!  I just thought of something to add and see you replied again already.  But I do want to add this comment to see if this changes anything.

I just realized this.  Under normal use of the I-Pac (or any keyboard encoder as I understand it), none of this circuitry is involved.  Usually a normally-open switch is connected with each input on the I-Pac then to the common ground.  So when a switch is closed, it's a dead short from the I-Pac to its own ground.  So why should I be concerned about placing any kind of a load on it?  If it can handle a dead short under normal circumstances, I can't possibly have "too high" of a current draw by either a relay coil or the transistor can I?  That will certainly be less current than the dead short no matter what won't it?  At the very least, would that mean that using the transistor method instead of the relay, I shouldn't need that resistor at all before the transistor?

I don't know how it handles it but it must be built in to the I-Pac device itself that we aren't really "drawing" current in the traditional sense from the USB port this way.

On a side note, the purpose of the diodes is to keep all 4 inputs on the I-Pac from firing at once.  These are coin inputs.  In a 4 player game, each coin for each player must register individually.  Without the diodes, any time one coin switch was activated, all 4 coin inputs would activate.  That's the theory, although I have to say now that I look at TheNasty's diagram again, I don't quite follow that logic with this particular diagram.  Again, normal operation of the I-Pac would still have all the grounds tied together, just not going through the counter and no diodes.  What difference does it make to have the counter on the ground side or not?  The switches themselves (being normally open) block the other inputs from firing.  The only thing I can think of where the diodes might be needed is if we tried to wire the counter between the I-Pac and the normally-open switches instead of after the normally open switches, but that would seem to make it more complicated than it needs to be.  So the more I think about it, I'm not sure the diodes are really needed in this case.

On the transients again, I get the gist of what you're saying they are and certainly how they can cause damage.  I still need a bit more on specifically what kind of a diode to hook up here though, and how to hook it up.  Would a 1N4004 type work?  That's just what was recommended to use for the diodes before the switches.  And just to clarify on how to wire it in, you mean put it backwards directly across the terminals of the coil of the relay?  Something like this?

                                 
+5 from I-Pac -----------|Relay Coil|-----------Ground
                                    |               |
                                    |----|<-----|
                                        Diode

« Last Edit: April 15, 2006, 03:05:15 am by clhug »

MonMotha

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2378
  • Last login:February 19, 2018, 05:45:54 pm
Re: 12 volt coin counter with I-Pac/4
« Reply #7 on: April 15, 2006, 03:16:17 am »
Oh, ok.  I didn't see that.  Yes, that's what those diodes are for, and you'd still need them.  I didn't realize those were INPUTs you were hooking up to (I wondered what the switches were for on the outputs...now I know).  That's a bit different.  You don't have to worry about sourcing too much current from an input as you're actually sourcing current from the pull-up resistor on the input, not the chip itself (well, at least that's where most of the current comes from).

*EDIT*: I'm still not entirely sure why the diodes in front of the switches are needed to prevent them all from triggering - only the ones that are active should still trigger.  But they won't hurt anything (see below still).

That's actually a kinda nifty design.  And yes, you can just get rid of the resistor on the base of the transistor in that case.  The pull-up will do everything for you.

That does mean that any transients could cause even more problems since they'd be appearing on an input.  CMOS inputs especially don't like to be driven beyond their rails.  Of course, using a transistor that doesn't matter.

What will happen in this case is that the pull up resistor (which is probably internal to the microcontroller on your IPAC) will normally float the input gate high since there will be no current flowing through it (so the drop across the resistor is 0, and the resultant node voltage is 5V).  When you push the switch, current will flow through the resistor, through the diode, and through the transistor.  This will pull the input to the IPAC low (caveat: see blow), and the resultant current from doing so will turn on the transistor as it goes to ground, which will activate your coin cointer.

There may be a problem here that the input "low" voltage which was before at ~0.7V (one diode drop) will now be 1.4V due to the base-emitter voltage of the transistor in addition to the diodes.  This may be too high for reliable detection of a low.  If that's the case, you can use the old design, and wire the switches additionally to a NAND gate (such as a 7420 - F, S, LS, or HCT will do, standard C or HC may not be reliable) and use the output of that to drive your transistor.  Only bother with that if you aren't getting reliable detection of coin insertion.  If you only want one coin switch, you can omit the diode in front of the switch and just have the transistor there - then there should be no problems.  It's OK to wire-or (i.e. connect together with simple wires) coin switches if you have multiple identical switches that don't need separate software counts or credit/coin settings.

There's also a way to use 4 transistors and no diodes instead (basically, replace each diode with the transistor base-emitter, and wire the collectors together) if you'd like.

Your diode drawing is correct.  You want to have the diode seemingly "pointing" the wrong way.  This will clip nasties to a safe level should they occur.  A 1N4001/2/3/4 or 1N4148 should be fine for that.
« Last Edit: April 15, 2006, 03:33:38 am by MonMotha »

clhug

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 179
  • Last login:April 04, 2024, 10:49:58 pm
Re: 12 volt coin counter with I-Pac/4
« Reply #8 on: April 15, 2006, 05:35:11 pm »
Awesome, thanks!!  Yes, these are inputs.  The I-Pac simulates a keyboard.  When a given input is grounded it sends a particular keystroke to the computer.

Yes, on the software side I do need to keep the coin inputs separate for some games.  However, I agree with your edit.  I don't understand what function the diodes are serving here since they're already on the separated side of the normally-open switches.  The switches themselves would block any back triggering so the diodes should be completely unnecessary with this diagram.

Now, I just tried a simple version of the transistor setup using only one of the coin inputs and no diodes (since only a single input).  Thought I'd make sure it worked using just a single input before trying to tie them together.  No problems with the I-Pac still detecting the input and creating the keystroke, but the counter won't fire.  I verified that the counter fires fine when I just directly touch it to the 12 volts.  It just won't when it's going through the transistor.  What should I look at.  Oh, based on your very first reply I'm using a 2N3904 transistor since I could get one of those for 69 cents.  The 2N2222 came in a package of 15 of them for $2.59.  Since I just need one I opted for the 2N3904 in a single package for lower price.  What should I look at?

MonMotha

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2378
  • Last login:February 19, 2018, 05:45:54 pm
Re: 12 volt coin counter with I-Pac/4
« Reply #9 on: April 16, 2006, 04:14:41 am »
With the switch depressed (closed), check:

V_BE (voltage from base to emitter) of the transistor: should be about 0.6-0.75V.
V_CE (collector to emitter) should be about 0.2-0.5V.

If you can measure the currents directly (using a multimeter), what is the current going into the base?

I don't remeber how you have it wired up as there are multiple "correct" ways.  If you have the emitter tied to one end of the counter, collector at 12V, and the other end of the counter grounded, V_E (emitter voltage) should be about 11.5-11.8V (V_12 - V_CE).  If this is how you have it, try the below method.

If you have the emitter grounded, counter hooked up to collector and other end of counter at 12V, V_C (collector voltage) should be about 0.2-0.5V (=V_CE).

If you are using the first method, all that base current has to flow through the resistance of the counter, which may cause it to not be big enough to turn the transistor "on".  In the latter case, with the emitter grounded, the base current can flow more freely and should easily turn the transistor on if the pull-up resistors are small enough valued: if they're 4.7k, I = 915uA which is usually big enough to switch most loads on a 2N3904 if the current gain is large enough.  You can try a darlington pair type transistor (which is basically two transistors set up such that the current gain essentially multiplies).  The first method also means that with 12V, you'll actually reverse bias the base-emitter junction and turn it off.  That method really only works when the supply is the same voltage as the supply voltage to the load.

Do you know the coil resistance of specified current of your counter?
« Last Edit: April 16, 2006, 04:16:57 am by MonMotha »

clhug

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 179
  • Last login:April 04, 2024, 10:49:58 pm
Re: 12 volt coin counter with I-Pac/4
« Reply #10 on: April 16, 2006, 12:57:41 pm »
V_BE was 0.715 V.  V_CE was 6.7 V (not a misread).  I don't have a meter that can measure current.  I don't know the official spec of the coil resistance of the counter but I measured it at 129.1 ohms.  That with nothing else attached to it.

It's wired essentially exactly as the drawing I attached earlier, except only using a single input off the I-Pac, no diodes, and without that 100 ohm resistor.  It's as you described where the output from the I-Pac goes through the normally-open switch to the base.  12V goes directly into one side of the counter and the other side of the counter goes to the collector.  The emitter is grounded both to the I-Pac ground and directly to the power supply ground.

Regarding the pull-up resistor, I don't think I have any way to know what that is since it's internal to the I-Pac.  I only see 3 resistors on the I-Pac's board, but it has 56 inputs.  There are 2 big IC's on it though (I think each one drives half the inputs).


MonMotha

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2378
  • Last login:February 19, 2018, 05:45:54 pm
Re: 12 volt coin counter with I-Pac/4
« Reply #11 on: April 16, 2006, 06:23:19 pm »
Sounds like you're not getting enough current to drop all 12V across the counter (which would saturate the transistor).  Two options:

*Place a 1-3.3k resistor from 5V to the IPAC inputs in question.  This will parallel with the internal pull-up and increase the base current, consequentially increasing the collector current.

*Use a darlington pair type transistor (or build a pair yourself) for increased current gain.  While your average 2N3904 has current gain of about 100, a darlington pair tends to have much, much higher gain: on the order of 1000-10000.

The former is probably easier, especially since you may have the required parts laying around (or a 5-pack is available at shadio rack for a buck).

clhug

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 179
  • Last login:April 04, 2024, 10:49:58 pm
Re: 12 volt coin counter with I-Pac/4
« Reply #12 on: April 16, 2006, 07:04:24 pm »
I did a google search for a darlington pair and when I see what that is, I actually think I'd prefer to do that.  I can do that all in one spot for all 4 inputs rather than having to run 4 resistors, one to each input.  Also, I don't have either laying around so I'll have to go purchase either another transistor or the resistors either way.  So the question is, what do I need for transistors to build that pair?  Can I just use 2 of the 2N3904 types?  If not, can you give a couple of specific types to use (something I can hopefully buy at Radio Shack)?  (I searched Radio Shack's web site and couldn't find anything that talked about darlington pair so it doesn't look like they sell any of these prepackaged.)

On a side note, I went ahead and tried the relay too.  Since it was only $2.59 (and I can return it) I just bought it when I bought the 2N3904 transistor.  The I-Pac won't drive the relay coil either.  The relay works fine when I hook the relay coil directly to 5 V from the PC power supply but it won't trip at all when trying to drive it from the I-Pac.  The input on the I-Pac still registers (I see the keystroke appear in Windows Notepad), but the relay won't trip.

MonMotha

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2378
  • Last login:February 19, 2018, 05:45:54 pm
Re: 12 volt coin counter with I-Pac/4
« Reply #13 on: April 16, 2006, 07:08:10 pm »
You can hook two transistors up to form a darlington pair (that's all the ones in a single package are).    Just hook the two collectors together, the emitter from one to the base of the other.  The commoned collectors are now known as "the collector" the unused base is the base, and the unused emitter is the emitter.  It acts like a super-high gain transistor, with the downside discussed below.


However, I'd recommend using the resistor method first.  A darlington pair will have a double BE drop (~1.4V) which may cause problems with the IPAC seeing the input as being low.   You can test that before you try the darlington if you like by just putting a diode between the switch and the base (pointing towards the base as that is the direction of the current) and seeing if it still works.

clhug

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 179
  • Last login:April 04, 2024, 10:49:58 pm
Re: 12 volt coin counter with I-Pac/4
« Reply #14 on: April 16, 2006, 08:26:01 pm »
I did your test using diodes.  I was able to hook up 3 diodes plus the single existing transistor and still got a signal.  Adding a 4th diode caused it not to detect the input any more.  (I had the diodes on hand because I bought them with the transistor based on that original drawing where I needed them before the switches.)  But I think that gives me plenty of room to put the 2nd transistor in for the darlington pair.

I found the diagram of how to hook up the transistors from a google search and I think I understand that hookup.  I just need to know what specific transistors to use.  Can I just use two of the 2N3904 types?

Oh, if I do the resistor thing, can you clarify what you meant by a 1-3.3k resistor?  Did you mean use anything from 1k ohms to 3.3 k ohms?  Does it matter exctly what I use within that range, or are you just saying try different ones in that range until something works?  Or does 1-3.3k mean something else?  Also, do I need to run a separate resistor for each of the 4 inputs, or can I just use a single resistor to feed all 4 inputs?

MonMotha

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2378
  • Last login:February 19, 2018, 05:45:54 pm
Re: 12 volt coin counter with I-Pac/4
« Reply #15 on: April 16, 2006, 08:48:10 pm »
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

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 179
  • Last login:April 04, 2024, 10:49:58 pm
Re: 12 volt coin counter with I-Pac/4
« Reply #16 on: April 17, 2006, 12:43:03 am »
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

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2378
  • Last login:February 19, 2018, 05:45:54 pm
Re: 12 volt coin counter with I-Pac/4
« Reply #17 on: April 17, 2006, 10:21:41 am »
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

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 179
  • Last login:April 04, 2024, 10:49:58 pm
Re: 12 volt coin counter with I-Pac/4
« Reply #18 on: April 17, 2006, 04:26:20 pm »
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

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2378
  • Last login:February 19, 2018, 05:45:54 pm
Re: 12 volt coin counter with I-Pac/4
« Reply #19 on: April 17, 2006, 11:13:39 pm »
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".

clhug

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 179
  • Last login:April 04, 2024, 10:49:58 pm
Re: 12 volt coin counter with I-Pac/4
« Reply #20 on: April 17, 2006, 11:49:34 pm »
Okay, thanks for the info.  Let me make sure I get this right on figuring the resistor I need.

According the package the resistor came in, H_FE is listed as 100 (min.).

I'm going through 1 transistor and 1 diode, so voltage drop would be about 1.4 V, leaving me with about 3.6 V.

So I take the required counter current and divide by 100, right?  Let's call that result X.  (I have no idea if there's a technical representation for this.)

Then I take the 3.6 V and divide that by X to get the resistor size?

The only question I have then is, how do I know how much current is required to fire the counter?  Or is that the 12 volts divided by the 129 ohms of the counter coil?  That would give me 93 mA.

So then I divide the 93 mA by 100 to give me .93 mA (maybe round off to 1 mA)?

And 3.6 V divided by 1 mA is 3.6 KOhms?  So maybe I want to use a 3.0 KOhm resistor to have a bit of headroom to ensure the base of the transistor triggers?

So, and I correct that the current required to fire the counter is the 12V / 129 ohm coil resistance, and then do I have the rest of the math correct?

Also, would it hurt anything to use an even smaller resistor allowing higher current?  What if I just use a 100 ohm resistor which would allow about 36 mA?  Will that cause any harm?

One last thing.  Again, to prevent the 12 V from hitting the I-Pac inputs, what about putting a 2nd set of diodes directly on the inputs to prevent back current into the inputs?  Sounds like it may not be necessary from what you said but it can't hurt can it?  It may not matter with switch down, but what about with switch up?  Or is the 12 V prevented then because the base of the transistor isn't firing so no 12 V is flowing?

MonMotha

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2378
  • Last login:February 19, 2018, 05:45:54 pm
Re: 12 volt coin counter with I-Pac/4
« Reply #21 on: April 18, 2006, 12:02:56 am »
Your math is correct.  I'd probably use a 2.2k or 1k resistor since I've got tons of those sitting around and 3.3k might be pushing it.  Basically, just keep your base current reasonable (the datasheet should list a maximum rating for base current).

You could add such diodes if you like, but they are not needed.  With the switch up, V_BE will be 0 since the pull-ups on the IPAC will float it to 5V and the base with no current will float to 5V.  V_CE (collector to emitter) is never known until you solve pretty much everything else.  The base voltage sets the emitter voltage, not the collector voltage.  If the diodes make you feel more safe about it, put them in.  We've established that the IPAC will reliably sense a low at 0.7V, and diodes are cheap.

Also, if you wanted to, you could use 4 transistors and get rid of the diodes that you have shown.  the base-emitter junction of the transistor will take care of everything.  You could get by with a single resistor on the combined bases then if you're sure only one switch will be triggered at once - otherwise it's best to just use 4 resistors too in that case (resistors are CHEAP).

clhug

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 179
  • Last login:April 04, 2024, 10:49:58 pm
Re: 12 volt coin counter with I-Pac/4
« Reply #22 on: April 18, 2006, 12:30:20 am »
Awesome, thanks again!!

Looking at Radio Shack's web site I see 2.2 K or 3.3K so I'll start with the 2.2k and see how that goes.  The only current rating listed on the package for the transistor is I subscript C as 200 mA.  Sounds like we're well under that no matter what (short of using no resistor at all).

Oh, I also see on RS's web site that the resistors come in 1/2 watt or 1/4 watt.  Same price.  Does it matter for this purpose?

I might look at the 4 transistor method.  However, a package of 2 diodes cost the same as the single transistor so from a cost standpoint the diodes seem cheaper (though I know we're only talking a dollar or two overall here), and I think less complicated for wiring.  I couldn't guarantee that no more than one coin would ever fire at the same time.  While improbable that they'd be exactly at the same time, it's entirely possible.

I'll probably go ahead and add the diodes to the inputs as well.  It may not technically be needed but I'd just feel safer with my brand new $65 board.

I'll have to pick up the resistors at Radio Shack on my way home from work tomorrow so I'll let you know how it goes.

clhug

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 179
  • Last login:April 04, 2024, 10:49:58 pm
Re: 12 volt coin counter with I-Pac/4
« Reply #23 on: April 18, 2006, 06:55:32 pm »
Picked up the 2.2 K resistor tonight and it didn't work.  Input detected on I-Pac but counter wouldn't fire.  Does that mean the resistor is too high of a value?  Try maybe a 1 K, and keep dropping down until it works?

On a side note, I hooked up the relay using this new method and everything worked great!  I'm tempted to just go this route since I know it works.  Is there a big reason I should try to get the transistor method working vs. the relay?  As long as I put that diode backwards across the coil of the relay should I be safe with that?

MonMotha

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2378
  • Last login:February 19, 2018, 05:45:54 pm
Re: 12 volt coin counter with I-Pac/4
« Reply #24 on: April 18, 2006, 11:18:23 pm »
You can safely make that base resistor a LOT smaller (in fact, on the 2N3904, you can maybe eliminate it entirely - it'll just blow up the transistor if it doesn't work, nothign else would get damaged).  Again, measure the voltages I mentioned above (especially V_BE and V_CE).  V_CE should be very small, about 0.25V or thereabouts so that the voltage across the counter is as near to 12 as possible.

Of course, if you already have the relay and that works, you can just do that, sure.  I try to avoid relays after assembling an entire security system using nothing by relays for logic: they're power hungry, loud, big, and unreliable, but they certainly can have their place.

clhug

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 179
  • Last login:April 04, 2024, 10:49:58 pm
Re: 12 volt coin counter with I-Pac/4
« Reply #25 on: April 18, 2006, 11:39:41 pm »
Okay, I'll give that a try.  Maybe I'll try like just a 100 ohm resistor or something.

The nice thing about this relay is it is small, and doesn't make any noise at all.  In this case I'm not sure power is a concern.  I can see that it could be fallable someday though with enough use.  I do agree, I'd kind of rather not have any moving parts that could fail, but it seemed to work pretty flawlessly for now.

clhug

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 179
  • Last login:April 04, 2024, 10:49:58 pm
Re: 12 volt coin counter with I-Pac/4
« Reply #26 on: April 19, 2006, 12:37:59 am »
Okay, I hooked this back up and took some readings.  V_BE always seems to be about 0.8 V, but V_CE was 6.5 V when using the 2.2k ohm resistor on the base.

I didn't have any other resistors around at the moment, but I got the idea to use the relay coil as a resistor just to give it a try.  It's 250 ohms.  With that, V_CE dropped to 4.6 V.  So definitely the smaller resistance is giving more voltage through the CE.  Does this info help determine at all what size resistor I might need, or confirm for sure whether or not I even need the resistor?  (I know it's only 79 cents, but I don't want to potentially deliberately blow the transistor if I don't have to.)

Or worst case, what if I do eliminate the resistor entirely and it still doesn't work?  Is there a different type of transistor that would trigger more easily?

Or am I maybe looking at the darlington pair idea again?

clhug

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 179
  • Last login:April 04, 2024, 10:49:58 pm
Re: 12 volt coin counter with I-Pac/4
« Reply #27 on: April 19, 2006, 05:17:26 pm »
We have a WINNER!!!  I stopped at Radio Shack on the way home from work again tonight and picked up some 100 ohm, 47 ohm, and 10 ohm resistors.  I decided to try several instead of just one.  Hit it first time.  With the 100 ohm resitor on the base of the transistor the counter fires great!  V_CE is 1.7 V.

So my question is, should I just stick with the 100 ohm resistor or should I see if there's a higher one that will still work so I have less current that might have less "wear and tear" on the components, if that kind of thing matters at all.  Or just not worry about it?


MonMotha

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2378
  • Last login:February 19, 2018, 05:45:54 pm
Re: 12 volt coin counter with I-Pac/4
« Reply #28 on: April 19, 2006, 05:31:31 pm »
Don't worry about it.  100 ohms is just fine.  In pulsed service like that, the base of the transistor can take a lot of current.  I was mostly going through the design for academic reasons (so that you'd know how it's working, or if someone in the future happens upon this thread).  If it isn't reliable, you could even go lower.  That transistor is actually spec'd for V_BE max of 6V, which seems unusually high to me, but then I'm not normally using transistors in this manner (I'm normally using them linearly as amps).  This means that in theory no resistor on the base would be fine.

clhug

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 179
  • Last login:April 04, 2024, 10:49:58 pm
Re: 12 volt coin counter with I-Pac/4
« Reply #29 on: April 19, 2006, 06:46:19 pm »
Cool.  Thanks for all your help!  Now I've just to permanently build the circuit to work with all 4 inputs.  Once I'm sure it's working entirely as expected I'll post back my final design for anybody else who may need to do this.

One thing I just thought of today.  With trying to trigger the one counter from multiple inputs, if coins are triggered at the same time on different inputs, the counter will only count one unit.  This is probably highly unlikely (though possible) if using actual coin mechs, but for someone using coin buttons on their control panel I can see where one player might hold the button down slightly longer while another player is also pressing their coin button.  Not sure there's any way around this though.  It just seems like something we have to accept when trying to drive it off multiple inputs.

clhug

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 179
  • Last login:April 04, 2024, 10:49:58 pm
Re: 12 volt coin counter with I-Pac/4
« Reply #30 on: April 30, 2006, 11:47:32 pm »
Well, I finally put the thing together and got it all set up in the cabinet and wired to the coin door.  Works like a charm!!  With one small exception.  It works by itself as I had originally tested it, but when I hook up the lights for the coin door (12 volt lights) the counter no longer works.  The lights work, and the I-pac still senses the input from the coin slots, but the counter won't count.  If I unhook the lights, then the counter works fine.

I'm guessing the lights must pull down the 12 volts a bit?  What could I do to fix this?  Would that be lowering, or eliminating, the resistor from the 5 V to the base of the transistor?

It's not that big of a deal because I've got a whole separate power supply (came with the game cabinet when I bought it) that I can power the lights off of, and have already wired that up, but everybody might not have that luxury so I'm still curious about trying to make it work with running the lights of my PC power supply with the counter.

Thanks again!

Oh, once I get a bit more time I'll post a full summary and final diagram of what I ended up with in case anybody else needs the info.

MonMotha

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2378
  • Last login:February 19, 2018, 05:45:54 pm
Re: 12 volt coin counter with I-Pac/4
« Reply #31 on: May 01, 2006, 01:03:48 am »
Yup, just lower that base resistor until it works again.  If you want, it can be eliminated entirely, but I usually keep them in there just for posterity.

clhug

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 179
  • Last login:April 04, 2024, 10:49:58 pm
Re: 12 volt coin counter with I-Pac/4
« Reply #32 on: May 02, 2006, 10:45:10 pm »
Okay, here's my final post on what exactly I ended up with and a few things I learned in case anybody else needs the info.

Before anything else I want to give thanks to TheNasty for the basis of all this and his wiring diagram as a place for me to start.  I hope he doesn't mind but I used his drawing as a basis to mock up the rest of the drawings I present here.  (I just wanted to give credit to the original drawing.)


5 Volt Counter
First, I want to address the 5 volt counter.  Definitely nothing against TheNasty, I couldn't have done this without his diagram as a starting place, but there are a couple things about his diagram for the 5 V counter I discovered.

I'm 99.999% sure the diodes are not needed with TheNasty's diagram.  By putting the counter on the ground side you're putting it on the side that's normally common anyway even if the counter wasn't there, so the diodes aren't needed to protect against all coins firing when only one input is closed.  (I.e., the coin switches themselves prevent the other inputs from firing.)  The diodes certainly don't hurt anything by being there though, they just don't seem necessary.

Second, while this is certainly the most simple way to wire a 5 volt counter it may or may not work depending on the counter.  In my tests trying to use a 5 V relay in place of the 5 V counter (which would then close the relay switch for the 12 V counter), which electrically should be essentially the same (both an electromagnetic coil), I couldn't pull enough current from the I-Pac inputs to fire the relay coil.  The inputs still triggered on the I-Pac but the relay wouldn't fire.  So it's reasonable to guess that some, perhaps not all or maybe not even most, but at least some, counters will be the same way.  To solve that, I found an alternate wiring diagram in an old thread that somebody had drawn by hand.  I've cleaned it up using TheNasty's diagram as a basis.  It's the first diagram attached to this message.  Here, we pull 5 V directly from the PC power supply through the counter so we're sure to have enough current to drive the coil.  Also, here the diodes are definitely needed because we're combining the input side of the switches.

In summary of the 5 volt counter if that is what you have, I'd say definitely try TheNasty's method first since it is much easier, and doesn't require a separate line direct from 5 V, but if that doesn't work then try this alternate wiring method.


12 Volt Counter
Now, on to the 12 volt counter.  This uses the alternate 5 V counter wiring method as a basis, and essentially just inserts the transistor into it.  The second diagram attached here is the wiring I ended up with.  I did try to build this off of TheNasty's original method initially (putting the resistor on the ground side of the switches) but again, I couldn't draw enough current through the transistor to get the counter to fire that way.

Two quick notes reagarding this that you might want to modify in your own circuit.

Note that there are two sets of diodes in my circuit.  The set at the top coming out of the transistor serve the same purpose as in my alternate 5 V diagram, to keep all inputs from firing when only one switch is closed.  These diodes are necessary.  The 2nd set of diodes coming out of the I-Pac inputs are to protect from any 12 volts from going back into the I-Pac.  That would be bad.  Technically, these diodes from the I-Pac inputs shouldn't be needed since theoretically any time the 12 V flows it should be going directly to ground through the switches and can't go back into the I-Pac, but I didn't want to take any chances.  They certainly don't hurt to be there and I thought only about $2.00 in diodes to protect my $65 I-Pac was worth it.

Second, the 100 ohm resistor into the base of the transistor worked fine, until I tried to hook up the coin door lights to the PC power supply as well.  At that point the counter would no longer fire.  The lights worked fine and the I-Pac inputs still triggered but the counter wouldn't fire.  If you need to run any other devices off your 12 V from the PC power supply, you should be able to reduce that resistor until it does work (try a 47 ohm, if that doesn't work try a 10 ohm, if that doesn't work, try eliminiating the resistor entirely).  In my case I just happen to have a completely separate external power supply that I decided to run the lights off of.

Last, attached are front and back pictures of how I took this circuit and actually implemented it on a small PC board (back view is flipped left to right from the front if you're trying to figure out how the wiring on the back corresponds to the components on the front).  The inputs from the I-Pac connect to the bottom.  The top terminals go to the coin switches, the wires that would normally go directly to the I-Pac.  On the right side (in the front view), 5 V comes in directly from the PC power supply on the bottom terminal, 12 V to the 2nd to bottom terminal.  The top two terminals on the rights are the out to (2nd from top terminal) and return from (very top terminal) the counter.  Essentially the middle two terminals on the right side are just shorted together so the 12 V comes in and then goes right back out to the counter.  This just made it easier to run wires so I could run both the 5 V and 12 V lines from the PC to this board instead of 5 V coming to this board and 12 V going to the counter in a completely different part of the cabinet.  And then similarly coming back from the counter, only having one wire returning from the counter to the board.  Probably uses more wire this way but is more "discrete" (for lack of a better word) in having each component with it's own wires.  Oh, I do still basically have to run the main PC Power supply ground directly to the I-Pac ground though.  I used a terminal "barrier" strip to connect to the I-Pac ground connections to give me more connections to ground.

Hopefully this is all a bit clearer than mud, but if anybody has any questions I'll do my best to answer them.

clhug

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 179
  • Last login:April 04, 2024, 10:49:58 pm
Re: 12 volt coin counter with I-Pac/4
« Reply #33 on: December 12, 2023, 10:02:59 pm »
I know this is an OLD thread (17 years!) but somebody pinged me on it the other day, which also made me realize that I had an update to it, just in case anyone else is looking for this info to use a 12 V coin counter with a 5 V input board like the I-Pac.

First, a follow-up from the last post above from 17 years ago.  The person who recently pinged me asked what the purpose of the transistor was in my final diagram.  In looking back at it, I'm not sure the transistor and resistor are actually needed.  I think I was still hung up on the original design (see the diagram much earlier in the thread) and was trying to isolate the 12 V from the 5 V using the transistor.  But in looking at it again, it appears the transistor is not serving any real function in my final circuit above.  Since the 5 V is going directly into the transistor Base, the transistor is essentially "always on", and the 12 V and 5 V end up merging anyway and flowing to ground.  But someone more knowledgeable than me about electronics would need to confirm for sure.  If @MonMotha is still around and sees this after 17 years (which I'm not sure since it's showing his last login in 2018), perhaps he can verify whether the transistor was really required or not in my final circuit above.

Second, the previous solution only works when the 12 V is coming from the computer power supply of the computer that the I-Pac is plugged into, and thus the 5 V and 12 V share a common ground.  A few years ago, I updated the computer that runs my arcade cabinet to a "mini" PC and I was no longer able to get a 12 V feed from the computer.  Thus, I had to use a separate 12 V power supply that no longer shared a common ground with the I-Pac and computer power supply.  The previous circuit stopped working.  What I ended up doing was replacing the 12 V coin counter in the original circuit with a 5 V relay, and connecting the 12 V coin counter with its own power through the contact side of the relay.  This resulted in the circuit I've attached to this post.

Now, again, the transistor and resistor in this circuit are almost certainly not needed in the new circuit since that side of the circuit is now entirely 5 volts.  But since I already had the circuit from my previous build, it was easier to add the 5 V relay to the existing circuit than it was to rebuild the entire circuit to remove the transistor and resistor.

baritonomarchetto

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 822
  • Last login:Today at 10:39:56 am
Re: 12 volt coin counter with I-Pac/4
« Reply #34 on: December 13, 2023, 12:14:51 am »
Another approach is the use of a ULN2003 (Darlingron transistor array. SEGA and other manufacturers adopted that IC to drive small loads, inductive (i.e coils) and non inductive (flashing start lamps anyone?). One can use two lines for a single load to increase the current synk up to 1A.