Controlling a water pump through a realay using Mega 2560

Hello,

I have just bought a Arduino Mega 2560 board. As a part of my final year project, i need to control a water pump. Could you please me help me with enough details like description, circuit diagrams and codes. I am totally new to Arduino projects.
Thaks You.

Thanks a llot for your support..and sorry for the incomplete details, my project is about an automatic irrigation system that will sense soil humidity and automatically turn on or off an irrigation pump.

For the purpose of demonstration, i guess i will just be using a toy motor.Later,i will try it on a typical pump that is used for irrigation. So i need help in relay interfacing for both the cases..I cant provide you with any technical details right now as i have not selected the type of motor i am going to use. For now u can assume i will be using a toy motor.

I live in Bangladesh, here most of the things are not available or difficult to get..so i have to check the availability as well. Moreover i am an undergrad final year student of Electrical and Electronic Engineering..so wont be able to afford the actual pumps that are actually used in practice.
I think if i could just demonstrate that with a simple toy motor that would do...

But for the purpose of my project book i will need to know about those irrigation pumps as well.
The irrigation pump will be of the following type:3-4cppage.gif
But, as i said i will demonstrate the project using a toy motor.
Thank You.

There have been several threads last year about moisture measurement and automatic pumps on the forum, biggest "problem" is to get a good moisture reading.

Check - Soil Moisture Sensor - VH400 - or search the forum for vegetronix.com

or - http://www.instructables.com/id/Garduino_Gardening_Arduino/ - also discussed here on the forum somewhere

Thanks a lot friends!!! You guys are so helpful!! Don't know how to return the favour thanks a lot:) I will let you guys know if i get stuck somewhere.:slight_smile:

Don't know how to return the favour

Some day you will see someone with a question or whatever you know the answer to, then you know it's your time

Once a wise man said, if someone does bad to you, forgive him, if someone does good to you, do good to three others

hey...one more thing pls,
I have a 12VDC Relay, whose coil energizing current is 37.5 mA. As far as i know the max current for the pins is 40mA for ATmega 2560. So would it be safe to use that relay?
Thanks!:slight_smile:

You'll need a diode, at least...

You are so close to the pin limit that I would encourage you to use a transistor to drive the relay.

For your demonstration, instead of just a little motor, why not a little pump? Buy the sort used for car windscreen washers: Runs on 12v DC... but draws a lot of current.

Thanks :slight_smile: i have to see if that type of pump is available here...thanks a lot for the idea..that will help me to demonstrate better:) What type of transistor? Could you please provide me with more details pls.

sanowar:
hey...one more thing pls,
I have a 12VDC Relay, whose coil energizing current is 37.5 mA. As far as i know the max current for the pins is 40mA for ATmega 2560. So would it be safe to use that relay?
Thanks!:slight_smile:

No. The 40ma Atmel spec if for absolute maximum value, above which will damage the device. All other Atmel specs assume/recommend a 20ma output current usage. No big deal, just mean you need to use a 10 cent transistor to switch the coil on and off. The more important spec is the relay's contact ratings. Until you have a real good idea of worst case 100% current draw for the motor you aren't ready to spec the relay contact ratings.

If multi-HP and/or mulit-phase AC, then a properly sized motor starter is what would be advised. Your Arduino relay contacts would then just have to be size to be able to energize the motor starter's 'M' coil.

Lefty

Lefty

The contact Ratings is 10A . I thing that would do...and about the transistor..what type of transistor. Could u please give me more details about this and the motor starter?
Thanks

The relay that i have has 5 pins but i cant relate it to the reference below:

So, if i use a 12V motor or pump should i use a relya with transistor as a diver as shown below:

or

Shall i follow the technique demonstrated below:
http://itp.nyu.edu/physcomp/Tutorials/HighCurrentLoads

I am clear about the multiphase AC pump in that that i will have to use a contactor controlled by an SCR as mentioned.
Thanks.

Yes, I wanted to control a small dc motor for demonstration. But, it was suggested that i use a pump used to sprinkle eindscreen of a car. Thats 12V.
So i thought demonstrating with a pump of that sort would be better. Now i dont know whether i can consider that 12VDC pump a 'dc toy motor'

As regard to a small motor i got two different suggestions:

  1. Using just a transistor as shown in the tutorial.
  2. Using a transistor to drive a relay which in turn would drive the pump or motor.

So i just wanted to know which one to go for as i was a bit confused myself..
Thanks.

As regard to a small motor i got two different suggestions:

  1. Using just a transistor as shown in the tutorial.

That will work if it's a DC motor, the transistor has to be sized for the voltage and current rating of the 'small motor'. If the motor requires higher then +5vdc and more then 200-300ma of maximum current then you will also have to have a independent DC power source as the arduino board can only supply +5vdc and not much more current then I just mentioned.

  1. Using a transistor to drive a relay which in turn would drive the pump or motor.

That will work also. If it's a 5vdc coil relay then the arduino board can power the transistor/relay and you then have to supply an external power source for the motor being controlled by the relay contact. Relay contacts have to be rated for equal or higher voltage/current then the maximum that the pump/motor requires.

So i just wanted to know which one to go for as i was a bit confused myself..

We can't make all the decisions for you. It's up to you to choose the method best for your components. Usually you need to start with selecting the motor as that then dictates what the specifications requirements of the other components much match or exceed.

Thanks

Your welcome.
Lefty

The motor that i would like to run is a 9V one but i don't know anything about the max current that it can draw as the datasheet is not available.
I have a 12VDC relay and a NPN transistor. How shall i determine if the transistor is properly sized...i mean what to look for in the datasheet.
Thanks

ohk.

I would go for the first option:

using an transistor like the bd137
If you wanna expand the project with a real pump it is easier to realize.

thanks!:slight_smile:

Btw guys..i just got the Arduino Mega 2560 board delivered!!!:slight_smile: