Clicking noise, Keypad.getKey the coulprit?

(ps. looks like I cant post the vide and audio file due to size limit, will see this evening if i can compress them a little and post them, in the mean time may be this is giving some idea of the issue I have ... ?)

Hi guys, need your help about some clicking noise I've in my project.

(project details

  • stand alone arduino, built by myself, it takes care of switching 6 relays, lighting 6+2 LEDs, and reading + buttons.
  • relay board, again built by myself, it takes care of switching 6 relays with relevant LEDs, via an ULN2083 (ok don't tell me about 74HC595, I'm just studying it.... :))

Please hear the audio on this video, hear the noise ? I can get rid of this noise getting the processor busy to blink some LEDs outside the main loop, but as soon as the process return into main loop, the noise is back again.

(bear with me, this is not an guitar/effects/audio noise, it comes from the process. Lowering guitar volume the noise is still present)

I've noticed, after a whole day of trial ...., that if I slow down, say with a delay of about 300ms (IIRC), the main loop, the noise become a "timed" click, you can hear it clicking in the attached mp4 file.

And also found that //ing this line

char thisSwitch = keypad.getKey();

the click totally dissapear.

So my ?s are, is it possible that the Keypad library is, checking/changing the status of pins/ports, creating this noise ?

or

Is something inside the whole procedure producing this ?

and

What is, normally/usually, producing this sort of clicking.

(I've attached the full and big code, as there's no way i can put it all in /code, though it's not well commented do hard to follow... :wink:

Thanks guys in advance for your help!!

Cheer
Armando

Hi,

Sounds like you have ElectroMagnetic Interference problems and electrical 'noise' is getting into your keypad. This is not unusual with all those relays and etc....

Take a look at THIS: to start with, and then see more about EMI HERE:

Try to physically separate inputs like the keypad from outputs like relays.

Decode on one common ground point (The - terminal of your power supply, for example).

Try disconnecting the USB after uploading to see if THAT is part of the problem...

Hmmm....

Why are you using relays to control LEDs? You could get rid of the relays (and the electromagnetic noise they produce) by using solid state switches to control the LED strip - namely, by switching the low side with an appropriately rated logic level power MOSFET (logic level is a must - digikey/mouser let you filter on this)....

It would also let you switch the LEDs as fast and as often as you wanted, which you can't do with relays.

Thanks for replies guys,

just to clear it a bit

I've alredy PCBs made for this project so no way I can change for other "technique" at the moment so, where is possible, I need to solve this issue for this project, cannot modify PCB to add optoisolator or other change. (may be on next project :slight_smile: )

What I had till yesterday was :

regulated 9V in, + goes to a spst switch just for on/off (no LED).

Then +9, runs || to the 2 boards, standalone board (7805 to regulate to 5v), then to switching board (again 7805)

Ground running || to standalone arduino board, then to switching board (the one with uln,relay, LEDs, switches), and to input jack

Note ** the audio gnd is not connected to digital gnd, though I have the 2 wires on a breadboard outside the box so I can short/connect them or not, this doesnt seem to change anything.

Following terryking228 advice, I've now

+9 still || as above, but I've added a 104-0.1uf "decoupling cap"(?) || to + and - pads of each board.

Ground.3 wires from power socket to each board and input jack.

here's the schemaitc of the switching board

The standalone arduino is taken from this (without the serial parts)

Seems nothing changes with above cap.

I should say everything is now in a wooden box, with all wires coming and goin everywhere.. you know spaghetti dish :slight_smile:

btw, had little time yesterday thoug, I've modified the sketch to generate rnd characters instead of calling Keypad.get, and can confirm the click is gone.

Attached the old version of the sketch, though the "Keypad" part is the same now.

sorry for this long post, hope we can get this clicking solved.. :wink:

Armando

6_channels_Switch.ino.txt (18.4 KB)

arma61:
I've alredy PCBs made for this project so no way I can change for other "technique" at the moment

Fail! :roll_eyes:

I fully agree with you Paul__B!

In my defense I'd say that the whole project was working fine when based on mechanical dip-switches,
... then I've decided to go with A..... it looks so easy.....

Hi!

just an update. It really looks like the keypad lib was the "culprit", I've found this

that do the same but, probably, in a different way, so the noise is gone, also with a delay of 500ms in the loops there's no click whatsoever.

Thanks 4 help guys

Ciao

Armando