Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Gardena water valve with Arduino Uno
/*******************************************************************
____ __ ____ ___ ____ ____ __ __ _ ____ __
( __)( ) ( __)/ __)(_ _)( _ \ / \ ( ( \(__ ) / _\
) _) / (_/\ ) _)( (__ )( ) /( O )/ / / _/ / \
(____)\____/(____)\___) (__) (__\_) \__/ \_)__)(____)\_/\_/
Project name: Gardena water timer controller using Arduino Uno
Project page: https://electronza.com/gardena-water-timer-controller-arduino-uno/
Description: Gardena T14E, Arduino Uno, Ardumoto and some passive components
********************************************************************/
int pwm_a = 3; //PWM control for motor outputs 1 and 2 is on digital pin 3
int dir_a = 12; //direction control for motor outputs 1 and 2 is on digital pin 12
void setup()
{
pinMode(pwm_a, OUTPUT); //Set control pins to be outputs
pinMode(dir_a, OUTPUT); //Note that the PWM pin is used as a regular output pin
}
void loop()
{
// turn on sequence
digitalWrite(dir_a, LOW); // set to turn on
digitalWrite(pwm_a, HIGH); // apply pulse
delay(500);
digitalWrite(pwm_a, LOW); // turn off pulse
//wait for about 10 seconds
delay(1000);
delay(1000);
delay(1000);
delay(1000);
delay(1000);
delay(1000);
delay(1000);
delay(1000);
delay(1000);
delay(1000);
// now turn it off
// turn on sequence
digitalWrite(dir_a, HIGH); // set to turn off
digitalWrite(pwm_a, HIGH); // apply pulse
delay(150);
digitalWrite(pwm_a, LOW); // turn off pulse
// again some delay
//wait for about 10 seconds
delay(1000);
delay(1000);
delay(1000);
delay(1000);
delay(1000);
delay(1000);
delay(1000);
delay(1000);
delay(1000);
delay(1000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment