1

I'm building a system as follows:

  • There are two pumps which lower and raise the level of the water
  • There is an ultrasound detector which measures the level of the water
  • While the water is too high, water is pumped out
  • While it's too low, water is pumped in

There are thresholds to prevent micro-adjustments, the system doesn't flip-flop back and forth.

However after a short while the ultrasound sensor stops working, until I power the system off and on again. My electronics knowledge is extremely rudimentary, but I know motors can be nasty to other components?

I've included my circuit diagram, should I be doing anything about that? I'm using reed switches to turn them off and on, but the ground and 5v rails are all tied together, and powering the arduino too via VIN.

enter image description here

asked May 30, 2021 at 20:03

2 Answers 2

3

Motors are inductive loads (they contain coils) that generate voltage spikes when switched off. These voltage spikes can indeed be nasty to other components.
You need to add a flyback diode in parallel with the motor, with the cathode connected to Vcc.
It will normally not conduct current, but when the motor is switched off, because the voltage spike is negative, it will provide a path for the current and allow to dissipate it through the coil's internal resistance.

As pointed out in the comments, it's also a good idea to (always) add an electrolytic capacitor (> 100 μF) close to the ultrasonic detector to filter out this kind of spikes.

answered May 30, 2021 at 20:14
1
  • 1
    It might also be a good idea to put a capacitor of >100 μF between Vcc and GND, close to the utrasonic detector. Flyback diodes need to be placed between the reed relay and Vcc, in parallel with the motors, with the stripe (cathode) connected to Vcc. Commented May 31, 2021 at 6:22
0

Hopefully you are powering the Arduino Vin with at least 7 volts. We know the Arduino a power supply it is NOT so where does the 5V come for the motors? You need to post technical links to the hardware items you are using. Are you calling relays reed switches? D11 and D12 sound like port pins, normally they cannot drive relays unless they are designed appropriately. I would suggest you either buy another set of electronic parts or stop using it until the problems can be determined. As far as a circuit diagram does not show the information needed. A schematic, not a frizzy thing is much better.

answered May 31, 2021 at 1:08
1
  • We don't know what the OP uses, but if you use relay modules designed for use with an arduino, they include the transistor to drive the relay as well as the flyback diode, at least for the relay. Commented May 31, 2021 at 6:20

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.