Arduino digital input-pullup error

Can someone please help me with what feels like a "floating" error. I've made a scoreboard and on occasion, the score climbs on it's own.

The board is made up of 15 LED seven segment common anode displays, powered with a 24V DC supply, control board (with shift registers and an Arduino Uno), and a 12V DC twelve channel remote.

The remote control receiver is made up of 12 relays. All commons are connected to ground. When I press the remote button, this connects the ground of that relay to an arduino digital pin 2, 3, 4, 5, 6, 7, or 8.

In my code I've defined these pins as input pullup:

pinMode(button[i], INPUT_PULLUP);

The code is written so that false triggering can't happen - definately marks when the button is pressed, released and duration of press).

Between the digital pins and the remote relays, my connection was with 4 dupont wires (as I didn't have ones long enough). I changed these and "I think" it fixed the problem. However I'm not sure why. I thought pullup pins would stay high (+5V) unless definately grounded.

Any ideas anyone? I can't afford to have the score change on its own during a game

I would suggest using external pullup resistors for the buttons (2.2K - 4.7K). This would make the signals stronger less susceptible to noise, circuit leakage, etc. The internal pullup resistance is only 30-50K and works OK in most cases, but your project has a lot of relays, LEDs and switching activity.

dlloyd: I would suggest using external pullup resistors for the buttons (2.2K - 4.7K). This would make the signals stronger less susceptible to noise, circuit leakage, etc. The internal pullup resistance is only 30-50K and works OK in most cases, but your project has a lot of relays, LEDs and switching activity.

No wonder. I assumed it was lower than that. I'll add the resistors. Is 2.2K to 4.7K a little high. For switches I've created (pre using Arduino), I thought the rule of thumb was 10K. Would this be ok?

The smaller you can make the resistor the less susceptible it is to noise. The values dlloyd gave you would serve you better than 10K

Grumpy_Mike: The smaller you can make the resistor the less susceptible it is to noise. The values dlloyd gave you would serve you better than 10K

Thanks Mike and dlloyd. I'll change my circuit now and add the resistors. Ta.

Talking about "noise", can I ask another question on something I found today. I'm not sure if this is normal. I can see the LEDs just "slightly flickering" occasionally (almost un-noticable). But it's not rythmic. I did voltage checks across the earth, neg and pos connections and found the following:

I'm using a 240V AC supply to deliver 24V DC, with earth connected to the scoreboard frame. 2 steel posts are hold up the board. These are around 2 feet in the ground held in by concrete

  • Measurement between earth and 240 negative = 1VAC (and 5m ohm) - Is this normal?
  • Resistance reading between 24V DC negative output and earth = nil
  • Resistance reading between 24V DC positive output and earth is unreadable, however when the meter is set to "sound", I can hear a really short beep. Is that normal?Is the above "noise"? I have caps spaced throughout my circuit, so I thought this would sort this issue out. Any suggestions?

Is the above "noise"? I have caps spaced throughout my circuit, so I thought this would sort this issue out. Any suggestions?

I skimmed through the other thread ... didn't see any reference to "ferrite" core. I would suggest using a ferrite core on the 24V and GND power rails. Both wires could wrap through it (try at least 5 turns) to provide noise suppression.

cjcj: Thanks Mike and dlloyd. I'll change my circuit now and add the resistors. Ta.

Talking about "noise", can I ask another question on something I found today. I'm not sure if this is normal. I can see the LEDs just "slightly flickering" occasionally (almost un-noticable). But it's not rythmic. I did voltage checks across the earth, neg and pos connections and found the following:

I'm using a 240V AC supply to deliver 24V DC, with earth connected to the scoreboard frame. 2 steel posts are hold up the board. These are around 2 feet in the ground held in by concrete

  • Measurement between earth and 240 negative = 1VAC (and 5m ohm) - Is this normal?
  • Resistance reading between 24V DC negative output and earth = nil
  • Resistance reading between 24V DC positive output and earth is unreadable, however when the meter is set to "sound", I can hear a really short beep. Is that normal?Is the above "noise"? I have caps spaced throughout my circuit, so I thought this would sort this issue out. Any suggestions?

I sincerely hope that you are not using the 240V neutral as a ground connection. But it sure sounds that way.

Yes, I agree with aarg .... 240 negative Neutral

Measurement between earth and 240 negative = 1VAC (and 5m ohm) - Is this normal?

Measurement between 240 Neutral to Earth can even be higher than 1VAC and be a normal condition. There is most likely other loads on the 240V system and the point at which Neutral is grounded to earth would be at the Mains transformer or service ... never consider shorting Neutral to earth or GND as it will be already done at the service.

It's also normal to hear a short beep when testing Neutral to earth voltage using continuity mode on a multimeter. This would be due to the 1VAC voltage difference and/or capacitance from Neutral to earth.

dlloyd: I skimmed through the other thread ... didn't see any reference to "ferrite" core. I would suggest using a ferrite core on the 24V and GND power rails. Both wires could wrap through it (try at least 5 turns) to provide noise suppression.

I've never used a "ferrite core" before, but if it lowers the noise, I'd like to give it a go. Thanks for the link, but is there a specific location it should be placed?

Shorting neutral to earth - no, not doing that. I was just measuring between them. Good to know that the short beep when measuring between them is normal.

(PS. Aarg, sorry for the confusion - I'm not using the 240V neutral as ground).

Thanks for the link, but is there a specific location it should be placed?

I think the best location is close to the circuit board connections.

A short beep normally means you are charging up a capacitor somewhere.

To truly test for this "noise" you will need to use an oscilloscope on the input pin in question. This is the simplest way...unless you don't have access to an oscilloscope.

You can also use a transistor before the input pin. This is an easy add-on and requires a certain amount of voltage to fully act as a switch which should help reduce the likelyhood of a false trigger.

Hope this helps, Laggy

Thanks dlloyd. I'll place it near the circuit then. I assume given it's a magnet, winding the positive and neutral thru and around it, somehow must remove the noise by removing induced magnetic fields around the wire and induced current??? I'm just learning. But I'll include it.

Mike (sorry - I can't say grumpy!) - charging up a capacitor makes perfect sense - hence it's such a short beep.

Laggy - I "wish" I had an oscilloscope - it would answer so many question for me rather than "experimenting" and "guessing". Calculations seem to only go so far. I'll have to hint it to my kids (birthday present!)

Dlloyd - I just added a 2.2K resistor to pin today - works a treat (touch wood). Ta. Thanks everyone - scoreboard is operational again.