I have a project that uses 12v power and uses ground for arduino inputs. I get random triggers when 12v is given or taken away to the accessories.
The brain contains 5v, 12v and 110v. The 110v is actuated by a 5v relay controlled by the arduino and powered by the 5v rail that is stepped down from the 12v power supply. There are 4 identical items controlled by the brain. They have 2-12v lights and very small (10mm) cylindrical electromagnets with flyback diodes 1” from the electromagnets. There are 4 wires to each of the 4 items. 12v+, ground, “win” (which is ground returning to the arduino) and a second 12v+ to power the 2 LEDs and the small electromagnet mentioned above. These 4 wires are in a single shielded 4/22 wire that is 6’ long, generally used for security systems, and each of the 4 items has its own 6’ wire from the brain.
The problem: when I supply power to the additional 12v+ for the electromagnet it triggers random “win” inputs. Again, all electromagnets are supplied with flyback diodes.
The questions:
1. Is the likely cause, noise from the 12v+ wire becoming energized inside of the same shielded cable?
If so, can it be solved easily by programming a recheck into the code to confirm the signal? Or am I going to need to separate the signal wires completely from the 12v wires?
The brain contains 5v, 12v and 110v. The 110v is actuated by a 5v relay controlled by the arduino and powered by the 5v rail that is stepped down from the 12v power supply. There are 4 identical items controlled by the brain. They have 2-12v lights and very small (10mm) cylindrical electromagnets with flyback diodes 1” from the electromagnets. There are 4 wires to each of the 4 items. 12v+, ground, “win” (which is ground returning to the arduino) and a second 12v+ to power the 2 LEDs and the small electromagnet mentioned above. These 4 wires are in a single shielded 4/22 wire that is 6’ long, generally used for security systems, and each of the 4 items has its own 6’ wire from the brain.
The problem: when I supply power to the additional 12v+ for the electromagnet it triggers random “win” inputs. Again, all electromagnets are supplied with flyback diodes.
The questions:
1. Is the likely cause, noise from the 12v+ wire becoming energized inside of the same shielded cable?
If so, can it be solved easily by programming a recheck into the code to confirm the signal? Or am I going to need to separate the signal wires completely from the 12v wires?