Nano is glitching

Hi All, I am making a oil pumping counter for a friend. I have Nano, an opto-isolated single relay board and a 20 x 4 LCD. His meter has a reed-switch pulse output. Purely switched and no voltage.

It is all working fine here on the bench but testing the real thing with the pump, the Nano is sometimes glitching when the pump Contactor kicks in.

The flow meter is connected to the Nano's Pin 7 and the Nano's Ground.

The Contactor is 220vac, 40-Amp with a 110vac 120mA coil that is attached to the single relay board, NO and COM. Power to the Nano is via a 9vdc wall-wart.

Should I be using a capacitor somewhere to stop the glitching, or what? If so, what value and type, a little out of my depth here.

Thanks in advance.

Please post a hand drawn wiring diagram.

Is the reed switch anywhere near the AC circuitry? If so, consider using shielded wire to connect the switch and the Arduino.

How is the button wired? If the switch is wired between the port pin and ground, with INPUT_PULLUP, use a low value external pullup resistor (e.g. 1K) instead.

Thanks JR,

The pump and meter are on the floor. The contactor for the pump is on the wall about 3-feet above them on the wall.

The wires from the meter (reed switch) run past the contactor and through the wall to the Nano+display box in the room adjacent. Not much wiggle room but will try the shielded cable and keep it as far away from the AC as possible.

I am using Easy-Button library to debounce the reed switch, so not sure if it is using PULL_UP but will dig around in the .h files. GitHub - evert-arias/EasyButton: Arduino library for debouncing momentary contact switches, detect press, release, long press and sequences with event definitions and callbacks.

The reed switch is wired as you suggest, port Nano-D7 and Nano-GND.

The 20 x4 display is Serial on A4 and A5, Nano-5v and Nano-GND.

Pretty impressive button-library by the way. :slight_smile:

Hi,

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Can you please post a picture of your project showing your component layout?

Do you have any controller, low voltage wiring running next to the 220Vac circuit?

Thanks.. Tom... :slight_smile: