Pages: 1 2 [3]   Go Down
Author Topic: Watering System Build  (Read 867 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 32
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Bottom line is you don't need to remove those jumpers and connect the female pins because you don't care about speed. Leave them on and use the INn pins to turn the motor on and off.

Thanks, I understood most of that but struggled on bits.

I've removed the crowding, and I've got the H Bridge connected. To power the H-Bridge i've had to connect the 5V on the front of the H Bridge to a naked part of the 5v from the moisture sensor to the arduino. (not the best I'm guessing?)

I did this because there is only one 5v connector.

Here is a image :

http://i58.tinypic.com/33lih69.jpg

Thanks dave-in-nj and raschemmel !!

Logged

Offline Offline
Faraday Member
**
Karma: 87
Posts: 4970
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Draw a schematic with pen and paper of all your connections and take a photo and post it.
Have you powered up the motor driver yet?
Logged

Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,
DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

Offline Offline
Newbie
*
Karma: 0
Posts: 32
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Draw a schematic with pen and paper of all your connections and take a photo and post it.
Have you powered up the motor driver yet?

yeah, I had quite a lot of help from a friend and explained how to set it up and helped with the code.

The motor works on 7.5 volts. I'm drawing the schematic now, upload in a few.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 32
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

http://i61.tinypic.com/2090s94.jpg

Direct link to schematics.
Logged

Offline Offline
Faraday Member
**
Karma: 87
Posts: 4970
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Can you upload your code ?
Logged

Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,
DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

Offline Offline
Newbie
*
Karma: 0
Posts: 32
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Can you upload your code ?

Code:
#define triger 250
#define triggerValue 580  //the trigger value of the moisture, the minimum value is 0, means the moisture is 0, the soil is very dry. the maximum value is 1024.
#define wateringTime 35  //the time for watering the flower1, millisecond. delay 35ms, uses about 70ML water

 int analogInPin = A0; 

int moistureValue=0;       
long int moistureSum=0 ;

 int pumpAnodePin =  6;      //pin 6 connect to the anode of the pump
 int pumpCathodePin =  7;   //pin 7 connect to the cathode of the pump

void setup()
{
  Serial.begin(9600);
  delay(500);
  pinMode(pumpAnodePin, OUTPUT);
  pinMode(pumpCathodePin, OUTPUT);
}

void loop()
{
   
  delay(1000);
  moistureSampling();
 
  if(moistureValue > triggerValue)
  {
    proWatering(wateringTime);
    return;
   }
   
}

void moistureSampling()// read the value of the soil moisture
{
  for(int i = 0; i < 30; i++)//samping 30 time within 3 seconds
  {
    moistureSum = moistureSum + analogRead(analogInPin); 
    delay(100);
  }
  moistureValue = moistureSum / 30;//get the average value
  // print the results to the serial monitor:
  Serial.print("Moisture = " );                       
  Serial.print(moistureValue);     
 
  Serial.println();
 
  moistureSum = 0;//reset the variable

  delay(4000);     //delay 4 seconds
}


void proWatering(int wateringTimea)  //sweep watering
{
 
  digitalWrite(pumpAnodePin, HIGH);  //the pump start working
  digitalWrite(pumpCathodePin, LOW);
 
  delay(wateringTimea);
  digitalWrite(pumpAnodePin, LOW);
  digitalWrite(pumpCathodePin, LOW);


}

Here you go.
Logged

Offline Offline
Faraday Member
**
Karma: 87
Posts: 4970
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Have you tested it ? (with water ?)
Logged

Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,
DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

Offline Offline
Newbie
*
Karma: 0
Posts: 32
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Have you tested it ? (with water ?)

yeh, seems to work fine.

Do you think there is anything wrong with it? I'm worried about the 5v from the H-Bridge touching the 5v jumper that connects to the 5v on the arduino, it's a naked wire. Is there a work around to this?
Logged

Pages: 1 2 [3]   Go Up
Jump to: