If you need a 24V supply, Marlin P Jones & Assoc. is currently running a sale. Item # 18235-PS is a 24V/2.5A SMPS for only $12.95. www.mpja.com

ids: Note that milhouse did post a link to a large SSR for a reasonable (though still higher than the cost of the components in my circuit) price earlier in the thread. Digi-Key is not usually the cheapest place to get that sort of thing, though they are reliable. Likewise, you can probably also find the components for my circuit cheaper elsewhere (feel free to sub the opto and the darlington for comparable parts).

Do not forget the diode across the coil (anode to the grounded side, cathode to the supply side) to prevent damage to the transistor. 1N400x series should be fine.

Run a wire off the 12V (yellow) wire from a standard PC hard drive power connector to the Input (+) connection on the Relay. This wire should also have a 500mA fuse installed in-line.Run a wire from the Input (-) connector to any available port on the LedWiz.Cut the DC power supply plug off and, after checking the polarity, connect it to the Relay (+) and (-) connections.Install Mame Hooker and run Q*Bert, jumping off the board so the knocker, in theory, triggers.Edit the qbert.ini file generated by Mame Hooker (Knocker0 is the output) and add the appropriate code (will post later as I don't have it in front of me).

Am I blind or did you leave out where to hook up the solenoid? Sorry, it's 4am.

Not blind. Should be:Cut the DC power supply plug off and, after checking the polarity, connect DC (-) it to the Relay (-) connection and DC (+) Solenoid (+) (the line with the solenoid in-line fuse). Connect the Solenoid (-) to the Relay (+). The + path of the DC power should go 1. into Solenoid (+) (fuse) line; 2. out of Solenoid (-) to Relay (+); 3. Relay (-) back to DC Power.

MonMotha - I did see the link for the cheaper SSR, but shipping it to Canada gets expensive. The DigiKey parts, plus shipping, still works out much better (threw in some other odds'n'ends since shipping is a flat $8 either way). Your comment about subbing for comparable parts seems to assume I have some inkling of what I am doing - sorry, haven't a damn clue. I'm just following your schematic, and hoping not to injure myself or burn the house down.

I've recreated the schematic, adding a fuse where I'm guessing it belongs, the diode across the solenoid (as mentioned), and changed voltage to 28. Validation would be hugely appreciated.

I'm going to check some local shops for power supplies. Otherwise, I'll see what MPJA offers for shipping up this way - thanks for the link.

afaik, the voltage for the fuse is not very important, so long as it is greater than the supply - is that right? e.g. I can use a 120/240VDC fuse, no problem?

Your schematic looks good. I'd change the notation on the GND (-28V) node, as that may imply that it's an actually -28V node (and the supply is +28V). That ground is "the ground from the 28V power supply", which I think you've got down, but the schematic may be a bit misleading for anyone who sees it in the future. I see that you also corrected the pin numbering on my optoisolator

Yes, the voltage on the fuse is relatively unimportant as long as it's higher than what you're working with. Somewhat like capacitors, the voltage rating on the fuse is a "most it can handle" type thing.

It may be necessary to decrease R3 some for reliable operation. You can go all the way down to 100 ohms if necessary.

Thanks a lot for the feed back - diagram updated. Prior post should show new schematic (refresh your browser if not).

I found a 24V/1.6?A supply nearby (didn't change diagram to reflect it, however). Hopefully that will be enough to power the coil. Got some 120V/1A fuses. And, my DigiKey order has arrived. You'll know when the knocker arrives as I'll be unable to post updates from the hospital

About mid-way down, is the Copper wire resistance table. If I'm reading that right, then 24 gauge should be enough. Fortunately I have a lot of that handy (or is it 22 that I have? I'm good either way). I'm thinking this table is the right one, as house wire is typically 14gauge for a 15 amp line and 12 gauge for 20A, which matches this table perfectly.

Typical rule of thumb for arcade applications is that you should use 22AWG for signals and 18AWG for power.

In this case, 22AWG should be fine, especially if your runs aren't more than a few feet, but it never hurts to use something larger (note: lower AWG numbers are larger wire). I don't know that I'd use 24, simply because it's so small it can break easily when subject to vibration and rough handling (like, say, a knocker firing all the time), but it shouldn't be a big problem electrically.

Sorry - one more question: for the resistors, what Wattage? I realize I've been stuffing in the ones I use for LED's (1/4 Watt) - they are probably not going to cut it, especially on the coil side of the circuit (but what the hell do I know?)

The only resistor that sees any power is appreciable R1. It'll actually burn about 1.5W when it's on with the 500 ohm value shown currently. Rule of thumb is to double the actual power in the resistor to get the rating, but given the low duty cycle, you'll probably do fine with a 2W.

You can increase it substantially to bring this power down, but going too far will leave the transistor in the linear region and blow it up I erred on the very conservative side making sure the transistor would be "very on" not knowing what the knocker current (amperage) was originally. If the knocker is only about 2A or less (which it sounds like it is), you can very safely bump R1 up to a 2.7k resistor. At 2.7k, R1 will burn a little over a quarter watt, so use a half watt resistor.

R2 and R3 can be quarter watt. 100 ohms is a little low for R3 (and puts it right at 1/4W), but it should be fine. I'd probably make it closer to 270 ohms. That's about right given the 2.7k above and a ~1:1 optoisolator. R2 can stay 10k in any case.

Looks good to me. Again, you may need a heatsink on the transistor. Depends on how long you use it and long it's on vs. off (the so-called "duty cycle"). Radio Shack sells, or at least used to sell, various TO-220 heatsinks.

The circuit in the above link assumes your control output can source current and is a good option if that's the case. The LED-Wiz and similar devices can only sink current, so the NPN low-side switch is not an option, necessitating the use of the PNP high-side switch discussed earlier in the thread. The cap across the transistor is something of a snubber device and, while probably not mandatory, isn't a bad idea in either case.

Fuse blew after a few test runs. I'm actually using a 36V supply (DMM says 36.3V) rated at 1.7A (the supply i mentioned earlier turned out to be a dud).

So I'm stumped. Set DMM to measure Amps, and bypass fuse - not sure how much the rest of the circuit could handle, so I've keeping it on only for very brief moments (less than a second). The DMM takes time to catch up, it seems, but I saw it go as high as 1.4A.

I'm guessing a resistor could be used to limit current here - but what is the criteria for choosing one? Or is there a better solution?

Some pics...

Circuit (diode not visible, but it's there)

Solenoid (also has a diode, kinda redundant i think, but safe)

Power supply - 36V, 1.7A - I think it was for a printer or something, dont care, was cheap

Yes. The coil will initially spike at several amps. A normal "quick" fuse will blow. You want a time delay or slow blow fuse. Also probably a good idea to drop that supply to a 28 or 24V. 36V will just raise the spike even higher and may even run out of the range of what the transistor can handle without biting it.

I can confirm that a 1A fuse will blow. I went through 4 or 5 until I switched to a slowburn which has now lasted over a week with daily use. It even survives LedBlinky's startup animation which causes it to fire 3 times in rapid succession.

Thank everyone. I do have slow-blow fuses. I should have mentioned how I am testing - it's by hand, not via LED-Wiz. It seems that if I connect it very briefly, it's ok. A bit longer and the fuse blows. A bit longer than that (and without the fuse) and the power supply itself shuts down (unplugging it seems to reset it). So I am wondering if this will be an issue once it's driven from the LED-Wiz, which should be providing a very brief "on" time. Alternatively, perhaps a resistor to control current flow?

MPJA wants too much coin to ship to Canada, but I did have that exact unit in my cart for a while. Was your testing via an LED-Wiz (or equivalent), or by hand, as was mine? It seems that a very quick "on" time is not a problem, so a pulsed signal from some controller is probably fine, and will always be fine. I used a 5V wall wart to trigger the circuit; +5V screwed in, and touching the Ground/Negative to the appropriate terminal (on the green screw-terminals in my picture above). The longer I held it, the more problematic it became. I was hoping for a more technical/electrical discussion/solution - as electronics is not my strong point. From my standpoint of ignorance, and the fact that the coil is showing me only 4ohms of resistance, it would seem that a fair bit of current could be drawn here. If Ohms law applies, 36V/4Ohms = 9A, and the linked power supply: 28V/4Ohms = 7A. Looking at the schematic (see above), I would assume the only other resistance, apart from negligible amounts from the wiring, in terms of driving the coil, could possibly come from the Darlington. However, reading the spec sheet for that (http://www.fairchildsemi.com/ds/TI/TIP105.pdf) I see "high DC current gain". While it does show resistors as part of its internal circuitry, it does not list any value with Ohms elsewhere in the spec, so I'd assume, given this and the statement "high DC current gain," that if anything, it's more like anti-resistance (I'm sure people in the know are laughing at me now ).

I believe this circuit, as conceived by MonMotha, can handle a good deal of Volts and Amps, however, this thread also contains notes of using a 1A slow blow fuse. I'm just trying to get my head around how this all comes together - and perhaps if being driving by a quick pulse from a controller is all I need to resolve this.

I played around with it both manually and by triggering it with MAME and the parallel port. It took at least several seconds manually triggering for the 1amp slow blow to go. I'll take a measurement of the knocker coil I have tonight. It's an actual Q-Bert knocker.Might be better to use a different coil than to find the right resistance and wattage resistor if you keep having trouble, but it will probably be ok once you put in the slow blow fuse.

The circuit you build should be good to about 7 amps, though the transistor will get quite warm if you leave it on all the time and probably needs a heatsink.

Ohm's law doesn't perfectly apply to this situation. The coil is very inductive. This means that quick on/off pulses won't have a chance to ramp the current all the way up to the 7A+ that you calculate using ohm's law, but in "steady state" operation (i.e. leaving it on for a long time), the only thing to limit the DC current is indeed the coil's resistance, so it'll eventually get up there. Short pulses may only see an amp or two, which is why a slow-blow 1A fuse is about right.

There is also an initial spike due to the secondary capacitance of the coil, and that's even harder to model, but it's also fortunately not likely to be a big deal as it's a fairly minor effect. Again, the slow-blow fuse is appropriate.

You don't want to size the fuse all the way up to the 7A because the coil itself probably can't take that for very long. It will get quite warm and may melt the enamel insulation off the wire that forms the coil resulting in an internal short. If the coil accidentally gets left on for more than a little bit, you WANT the fuse to blow to protect the coil, transistor, and power supply.

I would recommend reducing your supply voltage down to about 24-30V and stick with a 1A slow blow fuse.

Sorry for not chiming in (I don't check the main forum as much). Somebody brought this thread to my attention.

Your script command is slightly incorrect....

"knocker0=lwp 1 16 100,lws 1 16 1,wat 5000,lws 1 16 0" Will fire the knocker if it is on OR off. It fires when the game starts up yes? Not supposed to do that.

If you need the wait command to get the knocker actiavtion just right you need to tell mamehooker to do nothing when the state is off... so use a vertical bar to divide and states and a nll command for state 0 (first slot)

something like this:

knocker0=nll |lwp 1 16 100,lws 1 16 1,wat 5000,lws 1 16 0

HOWEVER

My guess is that if you set it up properly this won't be needed.

Let's use the vertical bar to ix itIt should probably look like this:

knocker0=lwp 1 16 0,lws 1 16 0|lwp 1 16 100,lws 1 16 1

I'll be honest though.... I don't have a clue why you are messing with the lwp command AND the state command. The way ledwizzes work when you set the power level to anything other than 0 the state is automatically turned on. But I don't know how the ledwiz handles relays, so you might know best.

Btw... as for your circuit... the fuse is the redundant (and useless) part. The diode is absolutely necessary and is what will save your device.

That much current going into a pc will instantly fry it and fuses, due to their analog nature, don't blow quick enough to prevent that. The diode will take care of the back-flow voltage though and that's a more constant danger.

knocker0=lws 1 16 %s%The "%s%" will be replaced by the state sent from Mame - so in the case of the Q*Bert knocker, it will run twice in quick succession, turning it on, then off.

One more small point for anyone else trying MameHooker for the first time -- each time you run Mame with a new game, MameHooker will create a game specific ini file in it's ini directory. If you want to set this up and haven't yet run Mame + MameHooker + the rom (e.g. qbert) - simply create a file in the ini dir called, for e.g., "qbert.ini" to hold this info, for e.g.

fwiw, in my circuit, the fuse is really protecting the knocker and the power supply for it - these are isolated from the PC via the opto-coupler - thankfully, as I accidentally left that pin high on the LEDWiz recently; fried the fuse rather than my PC/LEDWiz.

Btw... as for your circuit... the fuse is the redundant (and useless) part. The diode is absolutely necessary and is what will save your device.

That much current going into a pc will instantly fry it and fuses, due to their analog nature, don't blow quick enough to prevent that. The diode will take care of the back-flow voltage though and that's a more constant danger.

The diode is there to protect the switching transistor from the inductive voltage spike and is generally required, yes, though omitting it will just (possibly substantially) shorten the lifespan of the big transistor.

The fuse is there to prevent a FIRE due to overheating of various things (power supply, solenoid, etc.) if something goes wrong. Depending on your power supply it may or may not be strictly necessary. I wouldn't take such chances over a dollar worth of parts that are so easy to install.

The fuse is also likely to prevent damage to the solenoid due to overheating (which may or may not be enough to catch it on fire) if you were to accidentally hold it on for a long time.

Given that there's an optoisolator between the power side and the signal side, I don't think there's any worry whatsoever about damage to the PC. If you've got enough potential to break down the isolation gap on those things (easily good to a kV or so), you've got bigger problems.

Well if a solenoid is activaed with the proper voltage/amperage it should be able to stay on indefinately without fear of overheating or fire. This is why you don't have to worry about your washing machine catching fire even though a solenoid value is held on for several minutes while it fills with water.

I'm a big fan of redundancy, so I would probably use a fuse as well... couldn't hurt, my comment was in response to you downplaying the diode, which in imho is the most important part. Seriously which would you rather damage? A hacked laptop powersupply and a crappy old solenoid or your 40 dollar ledwiz and potentially your usb port and entire pc?

afaik, solenoids have rated duty cycles and max. on times to avoid overheating and other problems (some can be always on). I had assumed that the valve types, as you mention (and like the one I recently replaced in my dish washer) are designed for the duty cycles and on-times they receive.. However, a qbert (pinball) knocker is activated for very, very brief moments, and not very often. Such a device is not necessarily designed to remain on very long. Also, as I understand things, a solenoid will offer very little resistance after the inductance settles, and so controlling current (amps) can be an issue.

Note in the linked spec sheet the Pulse rated one says On for 100ms, Off for 900ms. I'm assuming you'll run into problems if you push it a lot harder than that - even with proper voltage, etc. It's just a property of its construction.

Of course, a fuse, whether redundant or not, is always good. I've blown several, so it's been good having it there to protect other components. I'm blowing it partly because I don't have specs for the solenoid, and mostly because don't know what the hell I'm doing Afaik, this thing is used in pinball tables at higher voltages than I'm feeding it, so maybe it's just meant to eat more current than I'm allowing for or...? Anyway, it's been running fine for a while, thanks to many people who've contributed to this thread, MonMotha, MameHooker, etc.

also - the diode on the solenoid is a must, regardless - I think we're all agreeing on that.

Well if a solenoid is activaed with the proper voltage/amperage it should be able to stay on indefinately without fear of overheating or fire. This is why you don't have to worry about your washing machine catching fire even though a solenoid value is held on for several minutes while it fills with water.

I'm a big fan of redundancy, so I would probably use a fuse as well... couldn't hurt, my comment was in response to you downplaying the diode, which in imho is the most important part. Seriously which would you rather damage? A hacked laptop powersupply and a crappy old solenoid or your 40 dollar ledwiz and potentially your usb port and entire pc?

While some solenoids are built to be continuously energized such as those used for failsafes to close valves and such, I wouldn't think a pinball solenoid would be rated for 100% duty cycle. Given the steady state current draw on the thing (~7A calculated, though it might saturate lower than that depending on construction) and the fairly small wire it appears to be using, I'd suspect that the enamel would eventually melt causing shorts and increasing the current draw further (and rendering the thing useless). Now, if your supply is reasonably sized and will shut down above a couple amps, you're probably fine, but if you've got a biggun, you might have problems. The transistor is also not heatsinked, and, while it can handle 7A or so, it'll get pretty toasty after a while with no heatsink. Would it catch fire? Probably not, but I haven't done a thermal analysis on it and don't care to, so I'll pay the dollar for the fuse.

As to the lack of diode, as I suspected, there's already one on the solenoid, so it is effectively redundant. However, even without it, the transistor specified has an antiparallel diode which will cause any kickback to be clamped pretty close to the positive rail. Since that's well within the breakdown limit of the transistor, it'll probably be fine, which is where my downplay came from. Now, how much your supply will appreciate it is another story... Like the fuse, it certainly doesn't hurt to have it, and not all power transistors have it at all, so I'd recommend it always be installed.

Again, with this build, it's virtually impossible to damage anything on the "left" side of the optoisolator. Breaking down that thing in a manner that allows any appreciable current flow would be a pretty impressive achievement, so my focus as far as protection goes would generally be on the power side.

While some solenoids are built to be continuously energized such as those used for failsafes to close valves and such, I wouldn't think a pinball solenoid would be rated for 100% duty cycle.

While mostly unrelated to the discussion, some pinball solenoids, such as those on the flippers, get full power only on the leading edge of activation. This allows for a good, strong hit of the ball, but also allows the player to "hold" the ball almost indefinitely, without burning up the solenoid, by cutting the voltage to about half of the initial pulse. This approach is a good one for any solenoid that needs strength to activate, but not much just to hold it in place.

Regardless, I agree that fuses are always a good idea where larger currents are concerned. I have seen a situation in my own pinball machine where the flipper solenoid and wire insulation melted, due to the failure of a component responsible for the approach I just mentioned.

You've quoted me but I think we need someone like MonMotha to answer, as I really dont know enough to provide an answer with any confidence. While I do have a working qbert knocker, thanks to MonMotha, MameHooker and its author, and others, I am far from knowledge about electronics - I know just enough to be dangerous. I suspect there are chips or relays that might activate with such low voltage, but this is all beyond me. Hopefully someone who really knows this stuff can help.

What changes would I have to make for this to work off 1.9VDC for the control voltage? I want to try and make this work off the NumLock LED.

Decrease R3 to ~27 ohms and use an LTV-815 instead of an LTV-816. If you've already got a current limiting resistor (i.e. what you have has been designed to directly drive a bare LED), then omit R3 entirely. Everything else should be able to stay the same.

If you are trying to hook up an existing LED output that already has an LED on it, be aware that won't work right since that's a current limited source. If you remove the existing LED and substitute instead the LTV-815's input LED, that should work.

Decrease R3 to ~27 ohms and use an LTV-815 instead of an LTV-816. If you've already got a current limiting resistor (i.e. what you have has been designed to directly drive a bare LED), then omit R3 entirely. Everything else should be able to stay the same.

If you are trying to hook up an existing LED output that already has an LED on it, be aware that won't work right since that's a current limited source. If you remove the existing LED and substitute instead the LTV-815's input LED, that should work.

When I boot, this knocker goes off three times (really annoying). I do not think it's the LEDWiz causing it, as there are no other indicators that the LEDWiz is turning anything on. For example, no LED's flash. This is well before Windoze is fully booted, and long before any opening animation sequence. The first knock is during POST or thereabouts, the other two are early in windoze boot. If it were just a single knock, I'd assume some sort of instability as the circuit is first powered up. But three knocks? It also knocks on power-down - but just once in that case. IIRC, I did probe the LEDWiz output with a meter and saw nothing - though a very quick spike would go unnoticed.

Any advice/suggestions? I do have a multimeter and scope I could apply if it will help.

Nice work guys! I did this many years ago by building a custom version of MAME and using the IPAC LED interface to trigger the knocker.

Shouldn't the Q*BERT or Coily AHHHHHHH sound cut off immediately when the knocker is triggered? That is another modification I did to MAME and it gives a much better effect. I'm pretty sure this is how the original Q*BERT machine works also.