hi im using an arduino to make a coin changer, and one of my component is a 9 slot circular blue coin hopper operating in 240V. i also have 2 optical sensors for the coins for input and feedback, and every time the hopper start and stop, arduino senses pulses from the both sensors, i tried to disconnect the sensors leaving the solid wire still connected to the pins of arduino, it still senses the pulses which obviously did not come from the sensors because i already disconnected it, but when i removed the wires connected to the pins, the arduino did not detect any pulse as well as from the optical sensors because i already disconnected it from the arduino.
is this caused by magnetic surges from the motor?
i havent tried to use stranded wires o a bread board but i will update this thread if it changes.
what shall i do for this not to happen?
Yes you have a lot of interference from the solenoids/motor in the device.
You need shielded cables, probably need to shield the Arduino in a metal enclosure too.
Moving the Arduino well away from the coin changer would help, and make sure you never
ever run sensor cabling alongside high current or mains wiring - keep it well away.
yoyoy_kun:
what can use to shield the solenoid motoras well as for the arduino board and wires?
Well, since the solenoids are electro magnets, you need a magnetic material such as thin steel, perhaps cut up a steel can and form that metal to enclose the solenoids and fasten it firmly to the rest of the metal structure.
i've ran out of aluminum foil, and i only manage to shield it with 1 layer, and it still receiving erratic pulses..
also i also tried to cover it with anti static wrapper, and still not working..
still looking for a soft start relay(circuit) maybe some other time..