Saddat AhmadDaniel Law
Created April 4, 2021

Lane Tech HS - Plant Waterer

This contraption moves a water bottle with a stepper motor to water plants.

BeginnerFull instructions provided5 hours34
Lane Tech HS - Plant Waterer

Things used in this project

Hardware components

Stepper Motor
Digilent Stepper Motor
×1
Argon
Particle Argon
×1
Breadboard (generic)
Breadboard (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×3
BOOSTXL-ULN2003 ULN2003A Dual Stepper Motor BoosterPack
Texas Instruments BOOSTXL-ULN2003 ULN2003A Dual Stepper Motor BoosterPack
×1

Software apps and online services

Particle Build Web IDE
Particle Build Web IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Schematics

Stepper Motor

Code

Stepper

Arduino
#include <Stepper.h>

// According to the URL I emailed, there's 2038 steps?
// In the doc that comes with the kit, 2048
// In the data sheet I found online, 64
// With testing 2048 seems to be the right answer
const int stepsPerRevolution = 2048;
int current = 0;
int last = 0;


// Change the pins below to match your Argon set up
#define IN1 2
#define IN2 3
#define IN3 4
#define IN4 5

// Pins entered in sequence IN1-IN3-IN2-IN4 for proper step sequence
Stepper myStepper(stepsPerRevolution, IN1, IN3 , IN2, IN4);


void setup() {
  // Adjustable range of 28BYJ-48 stepper is 0~17 rpm
  // Putting anything above this seems to make the motor not spin at all
  myStepper.setSpeed(17);
  last = (int)(Time.now());
  last -= 86400;
  Serial.begin(9600);
}

void loop() {
  // step one revolution  in one direction:
  current = (int)(Time.now());
  if ((current - last) >= 86400) {
      Serial.println("clockwise");
      myStepper.step(stepsPerRevolution * 3);
      delay(500);
    
      // step one revolution in the other direction:
      Serial.println("counterclockwise");
      myStepper.step(-(stepsPerRevolution * 3));
      delay(500);
      last = (int)(Time.now());
      
  }
}

Credits

Saddat Ahmad
3 projects • 2 followers
Daniel Law
47 projects • 10 followers
Teacher. Maker. Citizen of the planet.

Comments