I've got a problem with inputs being very unstable.
i defined the inputs as INPUT_PULLUP.
at 3 of my arduino's there is no problem (Wire length < 1m)
but at one of my arduino the wire length is +/- 5m and all 6 of the inputs are constantly switching.
(at this arduino i've got also 6 inputs with wirelenght < 1m also no problem)
When i connect them to 0v all the switches are closed and stable.
the cable isn't shielded..
when the cable isnt connected to anything; how can it switch??
do i have to place resistors at the end of the cable?
The internal pullup resistors are very weak due to there high value.
Try pulling the line up to VCC using an external resistor of a lower value (try 10K) and see if that cures your noise problem.
Also consider you may need to switch to screened cable for such a long run.
Just wondering what devices you have connected because from another thread you mention home automation, freezing I2C bus, 7 Arduino nanos with I2C extenders. Is this a new problem with the home automation project?
It would be helpful if you could provide links to your devices, schematic diagram and code. That way, it would make it very easy for others to identify problems.
i've changed to external pullup; the problem seems to be solved now!
it's not an option to replace the unshielded cable. there is a lot of cable i have to replace then
thanks a lot everyone!!
@dlloyd; this is still the same project, i've rebuild everything; the first version gave a lot of trouble with the freezing I2C.
I Changed all of the boards to Arduino MEGAs; so all the in&outputs are on the board now; i don't need shift registers anymore and have more Serial ports
I got rid of the I2C and now using RS485 so i can handle all the data by myself (it doesn't freeze anymore)
All the switches are handled by single ATMega328 chips which handles the push buttons;
because when using the serial interface, it sometimes don't detect all the double or tripple clicks of a button.
changed the configuration of all the switches in the house using LM339 IC's to let them operate on a higher voltage (because nowhere in the house except for the RS485 is shielded cable)
I still have some little trouble but step by step things are getting better
That's why i'm using the LM339
it's a voltage comparer; when pushing a button; the voltage rises from 16v to 24v and the IC returns a digital output to the arduino. Since i'm using that, no button problems appears..
Way to resurrect a necro thread... Still impressed by all those first posters even finding this old stuff!
10 uF can destroy your switches amongst other problems (current surge upon closing), unless you place a small resistor in series with the switch as well.