Digital input false triggers when using 24Vdc solenoids

I've converted an old EM pinball machine using arduino mega. Inputs are digital and they and the scoring works perfectly. Problem is the left flipper and at least one of the pop bumpers will false trigger a digital input and score 1,000 points.
All solenoids run off 24VDC. Score reels and chimes are controlled via MOSFETS via the arduino.
Flippers, pop bumpers and kickers (sling shots) are operated by directly applying 24VDC.

I've opto coupled the digital inputs, changed from active low to active high, run the switch contacts wires away from the wires to the solenoids, put a 10,000uF cap on the 5VDC rail, powered the arduino mega on the PC USB port, run the 24VDC solenoids on a 24VDC battery, I've got a cap across the EOS contacts on the flipper, separated the two voltage grounds, connected the two voltage grounds. It's hard to run the flipper solenoid via a MOSFET but I did with the offending pop bumper and the false triggering still occurred.

I can't think what else could be causing this issue.

Does anyone have any ideas before I burn this pinball machine to the ground?

The solenoid operated scoring reels don't effect the digital inputs and most of the other solenoids on the play field don't affect the digital inputs, just seems to be the left flipper and one pop bumper.

You didn't mention it so, just to check the box, are there kickback diodes on the solenoids - and on any other DC operated inductors?

I do have diodes on all the solenoids and other DC operated inductors.

Check the connection of those troubeling solenoids. Eventually replace tjode diodes. What is Your experience of soldering? Too much heat could have damaged the diodes.

Railroader, diodes are newly soldered on. Wires to solenoids are all new.
Soldering skills are excellent I've been an electronics tech for 40 years.
New to Arduino and a simple Google search shows there are issues with false triggering on digital inputs.

Fine. I suppose there is some length of each cable. Pulling the cables at random, like in the old wire wrap technic, reduces noise jumping from one cable to other cables. In other words, the opposite of esteticly beautiful bundles.

Should have also mentioned I've tried running the offending flipper wires well and truly away from the other wires.
One important note is if I don't allow the EOS (end of stroke) contacts to open on the flipper then the false tripper doesn't happen.
Pinball flippers have an EOS contact which opens and approxiamtely doubles the coil impedance so the flipper can be held on without burning out the coil or PSU.
Oddly it always affects the same digital input. The rouge pop bumper coil always affects only the one input but a different one.

Could You make a little drawing of those solenoids, the EOS and the kick back diode? The diode must be fitted to the coil having the EOS "outside" this little circuit.

1 Like

Another box to check: Input pinMode is INPUT or INPUT_PULLUP?

Did you try a snubber circuit (diode) across that contact.

There is one across the coil so effectly across the contacts.

I've used pinMode as INPUT and INPUT_PULLUP. Diagram shows using INPUT_PULLUP. I modified it for just INPUT.

The false registering of 1000 points - how many input pulses does that represent?

Do you have an oscilloscope?

One input. Each input is 1,000 points but I know using Serial.print which ones.
I have a CRO but it's old.

It may well be the contacts of the switch in question bouncing. Have you/can you replace the switch contact set or the entire switch?

Some background:

It's not bouncing. The rollover causing the 1,000 points isn't being operated. The flipper doesn't operate that rollover, the flipper shouldn't give any points. The flipper operates and the program 'thinks' that rollover has been triggered.
My fault finding has found the EOS contacts opening is causing a false trigger on this digital input.
Very early on I replaced the new diodes across the coils with newer diodes. Even have 0.1UF cap across the EOS contacts.

Have you tried a lower value pullup resistor on the input? I’d try something on the order of 1K. Also, a 0.1uf cap from the Arduino input pin to ground would be a good idea as well.

Another point of spurious entry is that open input on the optocoupler led, looks dubious to me. A big negative spike from a de-energized coil capacitively coupled into the cathode of the input led would do it. Not knowing what the pulse duration makes it hard to know what to do but you could try a 1uf (or higher) ceramic cap across the LED pins. If your soldering skills are up to the task, you can wack a 0805 smd cap between 0.1 spaced pins.

Thanks, I also had a mini epiphany. Since it only seems to be two inputs false triggering maybe I have crook inputs? Mrs Electronics is an tricky bitch at the best of times so it's a possibility. I am using a shield with screw terminals which also had an area for me to mount the resistors for the MOSFETS.
I'll try swapping to another input. Not many spare on this pinball job.

Disagree completely. Electronics is physics which follow well understood rules. It’s knowing which rules apply and when that’s the bitch.

Swap suspect input pins with ones that are known to function as expected.

Atmega processors are pretty darn reliable with inputs having Schmitt trigger levels. Noisy inputs don’t happen in silicon, they’re made by the user.

Much higher probability of it being software before hardware.

By tricky bitch I'm referring to the odd things like dry joints, dodgy components, etc.
Can't see it being software, if I comment out the the code for the false triggering input then 1,000 isn't registered. Quite clear the software is reacting to the input.
Working on suggestions now.

Well after trying every trick in the book regarding electrical noise reduction I finally looked at a software solution.
In the pinball software I have a function which detects when rollovers and targets are activated. I added -
It gives enough time for electrical noise to stop before the software starts looking at the inputs.
I know delay isn't the best thing to have in code but there are no other important things going on in the program. All it does is look for inputs and increment the score.