Assembling The Robo Garden Frame And Starting On The Electronics

I've been busy hacking on the electronics for the RoboGarden and though it was time to post an update lest I move further down the rabbit hole. The frame is completely assembled, and putting it together went rather well but there were a few minor issues to bring up that could be improved in future iterations. Here is a run down of the frame assembly:

Assembling the Frame

The frame is completely assembled, and putting it together went rather well but there were a few minor issues to bring up that could be improved in future iterations. Here is a run down of the frame assembly:

Attaching the Feet

Printed feet attached to aluminum uprights

As I mentioned before, future iterations of the feet would be universal; you can't really tell here, but the rear feet point one way and the front feet point another. They were also quite tight in assembly and required some sanding down. This dimension should be enlarged a bit.

Basic Frame Assembly

LED heat sink mounts attached to cross members

Assembled frame

Both the LED heat sink holders and the support components of the frame snapped together easily. I was really happy with the tightness of the connections, although I think they could still be a little looser and still have everything tightly held together.

Another future improvement would be to dimension everything for more readily available copper plumbing tube or even wooden dowels, provided they are sufficiently straight. A switch to this material would make the item more repeatable, so to speak, as I wouldn't have to hijack a girl's shoe rack.

Attaching the Motor

Mounted stepper motor on motor mount

The motor mount is a little flimsy with the motor hanging off the back, so some additional support could be used. Also, while putting this together I realized I had forgotten to build a place to add the micro switch for preventing carriage over travel. This will be easy to add with a little snap on bracket to the travel tubes in the short term. A longer term solution would be to integrate the part in with the motor mount.

Carriage Assembly

Assembled carriage on rails

The carriage went together well, but I need slightly longer screws so that I can use lock nuts. In testing, one of the nuts already vibrated off and I can't tighten them down too much or else the carriage won't move! One way to solve this in the near term would be printing head recesses into the carriage front. On the other hand, I needed some shorter screws for the belt mount, but this isn't anything that would hurt operation.

Idler Assembly

Idler bearing on mount with shaft

The idler was an area that could use a lot of improvement. Not only were the holes a little tight and the part just as flimsy as the motor mount, but the geometry while the belt was installed caused bad flexing:

Idler pully with belt

Ultimately, I ended up just having the belt ride on the collar of the pulley, as it otherwise was too tight and strained the stepper motor operation.

  • Motor mount is a little flimsy; hangs out the back and could be weak.
  • Forgot to make a mount for the micro switch; this can be a little clip-on adjustable number, but ultimately should be part of the motor mount.
  • The screws need to be longer for the carriage connection, but could also work with a recess for the screw heads.
  • The screws should be shorter for the belt mount.
  • Holes for the idler bearing mount could be a littler larger.

Completed Frame

And here we have it, the completed RoboGarden frame:

Complete frame

Here is another shot which shows the big 10 watt grow LED:

Looking up at the underside of the frame

Electronics Design

While I still have to design and print the micro switch mount, I was eager to start on the electronics. Here is the ideal operation:

  1. Soil moisture falls below a certain level for a specific plant.
  2. Carriage moves to plant location.
  3. Motor turns on the water for the plant at a preset amount.
  4. Carriage returns home.

Also, plant lights would be switchable, with a future upgrade of control based on a photo sensor.

These operations boil down into a few specific circuit modules:

  • Circuit to power the Arduino controller.
  • Power driver and relay for the lights.
  • Control circuit for the pump which could either be electrically adjustable to control flow, or just a relay and a clip on the tube to control flow.
  • A circuit to control the stepper motor.
  • Sensor input circuit from the eight moisture sensors.
  • Sensor input from micro switch.
  • Testing and control circuit (see below).

Before building the moisture sensors, I thought it would make sense to provide a manual control first, as this could help me test the operation without waiting for dirt to dry. I'm thinking it would be a simple two button control with a numerical indicator; each press would cycle through the plants and a second button would turn on the pump.

Some of the parts I started out with:

Power supply, arduino, breadboards and relays

Powering the Arduino

To power the Arduino from the large power supply, I built a small and simple voltage regulator to drop down the voltage to about 7 Volts; something the Arduino likes as input. This also ended up being the supply voltage for the stepper controller, as the raw 12 was a bit too high. Here is the schematic which also includes a power on indicator LED:

Basic lm317 power regulator schematic

And the resulting prototype on the breadboard:

Power regulator prototype on breadboard

On this breadboard, the "bottom" rail, as shown in the photo, are the raw power supply and the "top" rail is the regulated voltage which I supply to the Vin pin on the Arduino. I've confirmed that this setup works even with the USB connector in place.

Testing the Stepper Motor

Driving the stepper motor is nearly the same circuit that I detailed back in this post. The few changes I made include using the regulated voltage to drive the motor, rather than the Arduino +5V and also adding a trigger pin to the enable pins of the H Bridge. The reason I did this, was so that I would not need to keep the stepper energized after it moved. I could "turn it on," move the carriage to a new location, and then, "turn it off".

There is not much to show on the breadboard, the schematic is more useful here:

H bridge to arduino wiring diagram

The color codes indicate the wire colors of the specific stepper motor I'm using, a Pololu Bipolar. And the numbered lines indicate the Arduino pins I'm using.

The final part of this test was some basic code to play around with the stepper. Modifying the example code for a stepper resulted in this:

#include <Stepper.h>

const int stepsPerRevolution = 200;  // change this to fit the number of steps per revolution
const float mmPerStep = 0.31;        // carriage travel per step

// initialize the stepper library on pins 8 through 11:
Stepper myStepper(stepsPerRevolution, 8,9,10,11);

int enable = 7;

void setup() {

  pinMode(enable, OUTPUT);
  digitalWrite(enable, LOW);
  // set the speed at 60 rpm:
  // initialize the serial port:

void loop() {

if (Serial.available())
  int cm = Serial.parseInt();
    int steps = round((cm * 10) / mmPerStep);

    digitalWrite(enable, HIGH);
    digitalWrite(enable, LOW);

What this code will do is listen for input on the serial terminal. When you enter a number of centimeters, the program converts that to the number of steps required to move the carriage that far.


The most sensible modules to tackle next are the testing/control circuit and the micro switch input. All the code and schematics are now available in the github repository for this project. Enjoy!

If you enjoyed reading this or learned something, please consider sharing via , , or . Thanks!

If you enjoyed this article, you might like others related to the Robotics interest. This article is part of the Robogarden project.