4

I am trying to build an automatic watering system by following some examples. However, I don't have all the components for the entire system, therefore I have built it in Fritzing using only the components that I have (see scheme below):

enter image description here

I didn't build the physical version yet, because I am not sure that such a system would work without burning anything. In many examples, people connect the pump to a Relay Module, but since I don't have it yet, I would like to build it like this until I set up the watering system.

Can anyone help me understand why a relay would make it better or worse?

P.S. I have a JPC-3F relay, but I can see that the Relay Module contains multiple components. Is it possible to add the JPC relay to the pump without having the entire Relay Module? Would I need extra components for that?

Thank you!

EDIT: Thanks to the answer from ratchet freak, I have added resistances and a transistor. It works fine, but the same question stands. Do I still need a relay in this case? enter image description here

Physther
  • 207
  • 2
  • 4
  • 8

3 Answers3

9

You should put a resistor in series with the led to limit the current.

The IO pins cannot source enough current to run the pump without damaging themselves. That's why you need a buffer of some kind.

The extra components in the relay module are a transistor to do the actual switching and a reverse-biased flyback schottky diode in parallel with the relay coil. The flyback diode is required to absorb the voltage spike generated by the coil getting switched off and acting like an inductor.

You can use a transistor to switch the motor directly assuming you can find one that can handle the current draw. If you do then you absolutely will need a flyback diode on the motor to avoid damage to the transistor.

ratchet freak
  • 3,267
  • 1
  • 13
  • 12
4

this is not an answer to the question you asked, but you need to understand this:

generic DC relay advice. Use commutating diodes. this is not a special kind of diode, it is a particular use of a generic diode. you want 2:

one across the coil, reversed biased - cathode to +VDC. The coil throws a huge spike of negative DC when power to the coil is cut and the magnetic field collapses. this diode eats that spike

second one from the load to ground, reverse biased. this eats any spike from the load to ground - the fat blue arc you see when you disconnect a load by yanking the wire

https://www.allaboutcircuits.com/textbo ... -circuits/ https://www.allaboutcircuits.com/textbo ... ing-diode/ https://en.wikipedia.org/wiki/Flyback_diode G

2

The relay have a coil resistance of 70 ohm for the 5 Volt version.

Ohms law, U = I x R

I = U/R = 0.071 Ampere, and now you have to find out, can an Arduino I/O pin drive a load of 71 mA? If not you have to add a driver aka most commonly a transistor.

And now you should ask yourself, can I drive the motor directly with a transistor driver and skip the relay? So do you have any data on the pump?

And if you look at the datasheet for IRF520, fig 3 and fig 4 have the data for planning if it will work or not.

Ref.: https://www.infineon.com/dgdl/irf520npbf.pdf?fileId=5546d462533600a4015355e340711985

MatsK
  • 1,366
  • 1
  • 11
  • 24