2

I have a standard float switch in a remote water reservoir connected to a normal electric cable (100m+ long). I want to check with a raspberry pi if the float switch is on (i.e. water level is low) or off (i.e. water level is okay) and based on that control a relay switch.

Is there an easy way to detect if the switch is on or off with a raspberry pi? I presume I cannot simply connect it to the GPIO pins as it is a float switch that is meant to automatically disconnect a mains circuit?

Update1: The float switch looks like this and thus simply disrupts a mains electricity signal float switch

Update2: I prefer to use this existing float switch as it is already in place in the reservoir and the 100m+ cables are in place under ground. It was connected to the mains and would automatically disrupt the power to a pump, but I want to have a raspberry pi in-between. So I guess the question can be rephrased to: in what way can one measure if current can flow through a mains wire with a raspberry pi?

crazjo
  • 391
  • 2
  • 9
  • 18

1 Answers1

1

Buy a cheap relay and connect it to the main circuit. And then use one of the normal open contacts of the relay to connect to the raspberry pi, then treat it as a button?

Fernando
  • 63
  • 5