Electronic interference at 3.3 Volts?

Hello guys :D

Setup: Arduino Due

My problem: I'm working on a project in which the Arduino needs to recognise if one out of two buttons is pressed or not.

I'm doing this by constantly checking the analogIn pins A0 and A1 if there is a current flowing (3.3V). If I use a short wire to connect the 3.3 output pin to one of the analog pins it works perfectly.

Now the problem: For the final project the button wires run through an about 10 meter long cable. All of the wires for the 2 buttons go through one big cable. (Like the interns of an ethernet cable).

Now, if I measure the voltage of the 2 cables which go from the buttons to the arduino, both are giving me 1.6 Volts, even when the button is not pressed. I think there is some electrical interference going on. What can I do to prevent this?

Thx for your answers :)

Draw a diagram. It's likely your leaving the buttons floating or screwed up the wiring somehow. Do you have any of the internal input resistors turned on?

I and 2 friends checked the wiring 3 times, there is for sure no problem in the wiring. Maybe I will do it a fourth time hehe.

No, I don't have any resistors turned on I think. I didn't even know you could do something like that.

One more info: When I look at the power the arduino is mesuring at the two pins the numbers jump from everything between and 1023.

BTW so you don't think it has something todo with interference?

What you are doing will not work. Loose wires not "tied" to anything will work as antennas, collecting "interference".

You need to declare the inputs like INPUT_PULLUP to turn on the internal pullup, keeping the line high and it should not capture any noise.

// Per.

I don't know the skill level of you or your friends. Even if your wiring is exactly as you intended it to be, it means nothing if the circuit design is bad. The fact that you don't know about the internal pull up resistors lends credence to the "don't know what you're doing" idea. That's why I asked you to draw a diagram, because your verbal description does not contain enough details. A proper description must detail all connections of all components in the circuit, and not gloss over details with a vague statement like "all of the button wires". What wires, exactly? What are the connected to on the buttons, and what are they connected to on the Due? How are the Due's pins configured in your software?

Yes, my skilllevel is not that high (working with Arduino for 1 month) but I thought maybe it would be enough to tell you that the cables are very close to each other to tell me if have to expect interference.

Thank you for the idea with the pullup resistors. I will test it tomorrow :slight_smile: I already thought I would need to put them in myself somewhere in the cable circuit. If the problem still exists I will post a diagram, no problem.

Have a nice day :slight_smile:

The internal pullups are weak, 10 meters is fairly long, you may need to use external resistors instead. Try and see.

Add 100nF capacitors from each offending pin to ground to bypass all the high frequency noise and cross-talk? I presume you don't need high bandwidth to check buttons being pressed. Use 4k7 pullups or so.

Are you supplying significant 3.3V power along your 10m cable? Low voltage at high current doesn't work well with long cables, too much voltage drop.

Perhaps I'm having a really bad day with reading comprehension but it appears to me that this thread has become a case of trying to solve the wrong problem. I see multiple suggestions of input pull-ups, both internal and external, implying the OP is reading digital inputs. But, he says early on:

I'm doing this by constantly checking the analogIn pins A0 and A1 if there is a current flowing (3.3V). If I use a short wire to connect the 3.3 output pin to one of the analog pins it works perfectly.

Without ever defining "works perfectly". And then later we get:

One more info: When I look at the power the arduino is mesuring at the two pins the numbers jump from everything between and 1023.

Which says to me he's reading this as an analog input. We have seen no code and no schematic. Is there any clairity whatsoever as to what the OP is really doing?

RabbitzZz: Yes, my skilllevel is not that high (working with Arduino for 1 month) but I thought maybe it would be enough to tell you that the cables are very close to each other to tell me if have to expect interference.

I make no assumptions about the skill level of someone I don't know. Maybe you have 10 years professional experience, maybe you just started yesterday. I can't know that until you tell me.

Details matter. Maybe you've done the classic mistake of forgetting a pull up (or pull down) resistor. Maybe you're omitting the GND wire in the cable. Maybe you miswired the switches. Maybe your pull ups are too weak and you are picking up interference. Misplacing a single wire, or omitting, adding, or changing a single component can have substantial effects on the operation of the circuit.

I can't make any assumptions about what you've done correctly, so the list of things that might be wrong is large. That is why you must meticulously and accurately describe your setup.

My money is on him needing a pull down resistor on the analogue input. The fact that his is using an analogue input to read a single button is an error in itself so goodness knows what he thinks "correct wiring" means.