I'm working on a project that is due soon, and I've ran into a very puzzling problem. I'm using this ultrasonic sensor to measure water level in a tank.
I'm trying to control the flow of water using solenoid valves and those bilge pumps. As of right now, I'm only trying to test the sensors and pumps and get them to work together, but when I have the pumps connected to the relays, when the sensor reads a certain value needed to turn on the pump the sensor starts reading completely wrong values right at the moment when the pump is turned on.
I'm using those relays with the - terminal of the pump connected to Normally Open, and the - from the voltage supply to load.
That relay draws 185mA and may be causing a problem.
Try an external 5V supply for the relay board, connect its GND to the Arduino GND.
Set pinMode for pin 2 in setup(), maybe try pinMode(2,INPUT_PULLUP);
LarryD:
That relay draws 185mA and may be causing a problem.
Try an external 5V supply for the relay board, connect its GND to the Arduino GND.
Set pinMode for pin 2 in setup(), maybe try pinMode(2,INPUT_PULLUP);
do you mean i should connect the GND from the supply and the arduino together for the relay?