microweather carrier with an irrigation system

i have a microweather carrier with microprocessor esp32

which i connect with a soil moisture. so far no probleom with it. my problem comes when i connect the soil moisture with a vane in order to implement an irrigation system. i am confused , i do not know in which pin i have to connect the vane pins for ground and and 3v are loud and clear the next one is my consern.

when i implement it in an arduino mega board i connected it to A0, now in sparkfun microweather i do not know what to do .

i tried a couble of options but with no result.

please for your help :frowning:

What is a “microweather”? Please post a link to the product page.

I am sorry, i meant MicroMod Weather Carrier Board https://learn.sparkfun.com/tutorials/mi … 1617474086. i have connect the soil moisture and i get the measurements. What pin i can use in theMicroMod Weather Carrier Board as an output to control a water pump :?:

D0 (digital WSPEED) and A1 (analog WDIR) - the pinmap is the colorful section here https://learn.sparkfun.com/tutorials/mi … e-overview (scroll down a little), also be sure to go through the arduino example code further down and see the function names

thank you for your answer.

from the pin table i can understand from what is written that D0 (WSPEED) is a Digital pin that is dedicated for wind speed measurements.

in the image below i can understant that the only available pins for other purposes except weather measurements are :

https://cdn.sparkfun.com/assets/learn_t … eaders.jpg

as in my case a water pump needs to connect with the soil moisture in order to achievea smart irrigation system

i do not understant which pin i must use for example trx , sda or else?? :frowning:

The PWM pins look to be free, you could use one of those?

What’s the rating of your water pump?

Thank you for your answers!

how i can use this pin pwm1 in my code ? i mean , i can declare it for example as int PWM1= 47;

my pump is 5V as you see in the below link:

https://www.amazon.de/-/en/WayinTop-Aut … 97&sr=8-11

i declared the pin PMW1=47 as you suggest for the relay of my water pump but it does not work and i do not know how to fix it. could you give me some help please??

you can find my code below

int soilPin = A0;  //Pin number that measures analog moisture signal
int soilPower = G0;  //Pin number that will power the soil moisture sensor
int PMW1= 47;
int output_value ;

void setup() {
  Serial.begin(115200);
  while(!Serial); //Wait for user to open serial monitor
  
  Serial.println("MicroMod Weather Carrier Board - Soil Moisture Connector Example");
  Serial.println();

  pinMode(soilPower, OUTPUT);
  digitalWrite(soilPower, LOW);
  
  pinMode(PMW1, OUTPUT);
  pinMode(soilPin, INPUT);
  delay(2000);
}

void loop() {

 digitalWrite(soilPower, HIGH);
 output_value= analogRead(soilPin);
 Serial.print("Soil Moisture : ");
 Serial.print(output_value);
 Serial.println();
Serial.print(PMW1);
if(output_value<30){
  digitalWrite(PMW1, LOW);
 }
 else
 {
  digitalWrite(PMW1, HIGH);       
 }
 delay(1000);
  
}

47 is the micromod connector pin, not your processors I/O pin. Check the schematics for your processor and see what I/O pin is connected to micromod connector pin 47 then use that pin in your code.