# Clicking noise, Keypad.getKey the coulprit?

**URL:** <https://forum.arduino.cc/t/clicking-noise-keypad-getkey-the-coulprit/384858>\
**Category:** General Electronics\
**Created:** [May 9, 2016, 11:48am UTC](https://forum.arduino.cc/t/clicking-noise-keypad-getkey-the-coulprit/384858 "2016-05-09T11:48:48Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![arma61](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@arma61](https://forum.arduino.cc/u/arma61)\
**Post date:** [May 9, 2016, 11:48am UTC](https://forum.arduino.cc/t/clicking-noise-keypad-getkey-the-coulprit/384858/1 "2016-05-09T11:48:48Z")

</div>

(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

```cpp
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... 😉

Thanks guys in advance for your help!!

Cheer  
Armando

---

<div class="post-metadata">

**Author:** ![terryking228](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/terryking228/32/214478_2.png) [@terryking228](https://forum.arduino.cc/u/terryking228)\
**Post date:** [May 9, 2016, 1:00pm UTC](https://forum.arduino.cc/t/clicking-noise-keypad-getkey-the-coulprit/384858/2 "2016-05-09T13:00:37Z")

</div>

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:](http://arduino-info.wikispaces.com/ArduinoPower) to start with, and then see more about EMI [HERE:](http://arduino-info.wikispaces.com/RelayIsolation)

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....

---

<div class="post-metadata">

**Author:** ![DrAzzy](https://avatars.discourse-cdn.com/v4/letter/d/eb9ed0/32.png) [@DrAzzy](https://forum.arduino.cc/u/DrAzzy)\
**Post date:** [May 9, 2016, 2:57pm UTC](https://forum.arduino.cc/t/clicking-noise-keypad-getkey-the-coulprit/384858/3 "2016-05-09T14:57:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![arma61](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@arma61](https://forum.arduino.cc/u/arma61)\
**Post date:** [May 10, 2016, 11:24am UTC](https://forum.arduino.cc/t/clicking-noise-keypad-getkey-the-coulprit/384858/4 "2016-05-10T11:24:42Z")

</div>

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 🙂 )

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)  
 ![](https://europe1.discourse-cdn.com/arduino/original/4X/a/7/4/a748d59ab72ee30172a98fa09d35eadd8a3ac7dc.jpeg)  
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 🙂

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.. 😉

Armando

[6\_channels\_Switch.ino.txt](https://forum.arduino.cc/uploads/short-url/i3AqncAMb3ZFhdi7Lkg02DSjpgV.txt) (18.4 KB)

---

<div class="post-metadata">

**Author:** ![Paul\_B](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/paul_b/32/216376_2.png) [@Paul\_B](https://forum.arduino.cc/u/Paul_B)\
**Post date:** [May 10, 2016, 3:53pm UTC](https://forum.arduino.cc/t/clicking-noise-keypad-getkey-the-coulprit/384858/5 "2016-05-10T15:53:41Z")

</div>

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

Fail! 🙄

---

<div class="post-metadata">

**Author:** ![arma61](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@arma61](https://forum.arduino.cc/u/arma61)\
**Post date:** [May 10, 2016, 4:19pm UTC](https://forum.arduino.cc/t/clicking-noise-keypad-getkey-the-coulprit/384858/6 "2016-05-10T16:19:31Z")

</div>

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.....

---

<div class="post-metadata">

**Author:** ![arma61](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@arma61](https://forum.arduino.cc/u/arma61)\
**Post date:** [May 16, 2016, 11:11am UTC](https://forum.arduino.cc/t/clicking-noise-keypad-getkey-the-coulprit/384858/7 "2016-05-16T11:11:49Z")

</div>

Hi!

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

> **[Keypad With Arduino Without Using Keypad Library (First Tutorial)](https://www.instructables.com/Keypad-With-Arduino-Without-USing-Keypad-library-F/)**
>
> Keypad With Arduino Without Using Keypad Library (First Tutorial): Keypad used usually in most of projects to enable customer to deal with project such as (Real Time Clock (RTC) to adjust day,time ,access control,.....etc) but if you use it with...

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

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 6, 2021, 1:55am UTC](https://forum.arduino.cc/t/clicking-noise-keypad-getkey-the-coulprit/384858/8 "2021-05-06T01:55:08Z")

</div>


