system
July 12, 2014, 11:41pm
1
Hello,
I have this sensor:
and I'd like to use it with arduino to control the water pump.
I also have a relay for arduino.
Do I connect one cable to 5V and the other end to Analogue PIN?
How can I read whether the sensor is passing 5V through?
Thanks in advance.
it is a simple switch, yes?
when the level gets to a point, the circuit opens or closes? hint: you can use your multimeter to check that.
Just check to see if it is normally open or normally closed.
The switch appears to be this one
Any digital pin should be fine, e.g D2 Just connect it between the pin e.g. D2 and GND and enable the internal 22k pullup resistor by
pinMode(2,INPUT);
digitalWrite(2,HIGH);// enable internal 22k pullup
Also remember to debounce the switch (See Arduino Playground - Bounce )
The device is a simple reed switch. You can use any pin you like. The button example in the IDE has all you need and uses pin 2.
Yes, I use one like that and I use the digital pin and the digitalRead()
.
VT91
February 5, 2016, 1:17am
7
When I mount this kind of float switch, do I drill a hole in the side of a bucket, at the bottom or mount it with threads facing up?
I am not using this in a bucket, yet Chinese are not too eager to tell the exact location of the reed switch in the body of this device and how it should be oriented to work.