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
-
2Count 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– Dave Newton06/07/2021 19:59:20Commented Jun 7, 2021 at 19:59
-
2You can use up to (N/2)² switches where N is the number of IO pins you have.Majenko– Majenko06/07/2021 20:01:03Commented Jun 7, 2021 at 20:01
-
1Yes 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– Investigator06/07/2021 20:03:14Commented Jun 7, 2021 at 20:03
-
3How are they connected? You might want to check out arduino.stackexchange.com/q/13072/8583 and similar; 5m isn't far-far, but it's far enough.Dave Newton– Dave Newton06/07/2021 20:09:05Commented Jun 7, 2021 at 20:09
-
2I 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– Investigator06/07/2021 20:38:14Commented Jun 7, 2021 at 20:38
1 Answer 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!