3

How could I estimate the max number of switches that I could connect to an Arduino Uno?

I am questioning if Arduino has enough power to simultaneously operate an X number of switches with no issues.

I am using an external power adapter of 12 volt/2 amps (barrel).

Here is the hardware: https://m.hellasdigital.gr/el/products/tank-pool-water-level-liquid-sensor-float-switch

Dave Newton
  • 245
  • 1
  • 3
  • 12
Investigator
  • 159
  • 6
  • 2
    Count the number of digital-capable IO pins :) It's unclear what problem you're thinking you'll run in to. Are the switches, for example, really far away? – Dave Newton Jun 07 '21 at 19:59
  • 2
    You can use up to (N/2)² switches where N is the number of IO pins you have. – Majenko Jun 07 '21 at 20:01
  • 1
    Yes I am trying to find out why under some conditions the sensor does not trigger the Arduino. It is one in the hundreds but it happens often if you think that the sensor is triggered twice every five minutes continuously. The distance is under five metres. I will soon move the power cables away from the signal cables. Right now they are a bit close. – Investigator Jun 07 '21 at 20:03
  • 3
    How are they connected? You might want to check out https://arduino.stackexchange.com/q/13072/8583 and similar; 5m isn't far-far, but it's far enough. – Dave Newton Jun 07 '21 at 20:09
  • 1
    Yes indeed I forgot to write that I used 10 k pull up resistors and I do not use the Arduino internal. Maybe I should try the 1 K. Something else that may be relevant while I was reading the article is the fact that all buttons use the same ground cable. Maybe each one should have each own twisted and only at the end I should connect all ground together. – Investigator Jun 07 '21 at 20:20
  • 2
    I liked the idea of using opto coupler isolation. First of all I have to put the cables in an order. For instance a separate twisted pair per switch and put them far away from the high voltage cables. – Investigator Jun 07 '21 at 20:38

1 Answers1

1

thank you a lot about your input it was very useful. My source of issues was a faulty sensor. After I changed it things are smooth now. I separated the power cables from the signal as well that is super important.

Thank you a lot about the valuable input!

Investigator
  • 159
  • 6