APBucket (Arduino Plant Bucket)

Indoor plant enviroment measure and control with arduino and Rpi

Similar projects worth following
APBucket, the complete indoor plant open source growing solution

The aim of this project is to create an easy to mount, as-cheap-as-possible open source universal embeded arduino program that could control climate of any box, bucket, indoor garden or even greenhouse to make any plant grow in its ideal conditions in small adapted spaces. To ensure this, a series of measurement devices, climate control devices and lightning devices must be controlled. Lightining could be any kind, but the LED lights optimization will be studied, as is the most suited lightning for the build.

The inspiration of this projects came from, were awesome people have been years creating awesome indoor growing systems with LEDS, CFL and some Buckets, Cubes or whatever got in their hands, my principal goal is to provide this people with complete automation and extend this to any growing system.

Hi, want to start this project saying, the main purpose of this project is to learn to connect and program different sensors, im going to do it nowadays, i know there must be thousands similar projects, but this will not be a reason to stop making my own approach.

This means that i want to share it with everybody as i sourced it and learned from other people guides, and im making it with their help, so what i do with their help should help others.

#First objectives of the Program:
-Meter Humidity and temp from air
-Meter Humidity Soil

-Meter amount of light (LDR)
-Water the plant when needed
-Control the lightning cycles

-Control the light spectrum using led arrays
-Extract and intake air when needed and have control over the fans Speed, RPM

-Collect data from arduino to a Rpi and control variables from there

#Later Features (Any good suggestions would be welcome)

-Change all the power supplies to just a old sauvage pc power supply

-Control over single led/ small amount of them (Better lightning control) using MOSFET and using 12V pc power supply ramp

-Control of CO inside of the bucket (improved climate control)

-Control of the Rpi by web

-Better control of the light (change LDR for more precise stuff)

-Control of the temp at the led heatsink

-Control of plant height by sensors

-Control of light distance to maximize lightbeam


bucket v 0.1 alpha copia.png

made with /u/Ekrof 3D bucket designer

Portable Network Graphics (PNG) - 506.36 kB - 03/19/2017 at 01:40


general fritz wiring.jpg

General first wiring prototype including all parts

JPEG Image - 4.74 MB - 01/08/2017 at 15:32



Detail about how the relays are going to drive the electricity

JPEG Image - 1.18 MB - 01/08/2017 at 15:31


bucket v 0.1 alpha.png

First test bucket prototype made with /u/Ekrof 3D bucket designer

Portable Network Graphics (PNG) - 621.05 kB - 01/08/2017 at 15:31



Digital and Analog arduino ports

JPEG Image - 1.25 MB - 01/08/2017 at 15:31


View all 7 files

  • 1 × Rpi Electronic Components / Misc. Electronic Components
  • 1 × Arduino Mega 2560
  • 1 × Adafruit v1 Motor shield
  • 1 × 4xRelay module
  • 4 × 9mm fans Salvage

View all 15 components

  • Things have changed a lot

    niko04/22/2017 at 09:28 0 comments

    I hadnt made any updates here because lack of time, but the bucket have changed a lot.

    Finally, assembled first prototype for the circuit board, already i have lot of changes in mind, but at least it took out a lot of cables and mess. Heres a shot:

    Basically, powers 2 12v fans for the air flow and one to cool the leds, also uses has 2x 12V 6A relays to switch on and off the power to the main and side lights(also added them to the bucket) and has a connection for the water pump(which is still in development). Takes the power from a sauvaged 12V Wall power source and everithing is turned on and off by transistors controlled from the arduino.

    Im now trying to develop a second model with a lot lot of updates, to make it even easier and more functional.

    Othe major development was the redesign of the bucket. The top leafs where getting burned, so i decided to add more space vertically, i did a little sketch about it:

    I did a little base with sauvaged pine wood from a matress:

    and it turned out pretty well alltogether:

    The air is flowing pretty well just with the 2x top fans and two passive intakes at bottom, also i added SMD 3560 as side lights, powered by 12V 1A wall power sources i had at home, and they turned to work pretty well, as some lower zones of the plant were getting very little light and this helped to develop that parts.

  • Minor updates

    niko01/28/2017 at 03:15 0 comments

    This week started university again so less time will be invested in this project, but at the moment works.

    I've updated the code on GitHub

    Ive updated the way the lights are controlled and put a start-end time for each light.

    also mae larger the time between conditions measurement as i sont want to make the mysql very large and a reading of temperature every 20 sec is unnecesary

    So right now is working autonously, except for the watering system.

    I also upgraded the bucket, mounting the fans and putting led lights in the top part, im pretty happy with the result.

    By the moment 1 fan is taing air in and the other one out, untill i mount the bottom fans.

    Also lights get a bit hot (maybe 50-60 *C) because i pasted them not the best way, so maybe this will be modified, if somebody makes something similar, dont put all the leds that turn on at same time together. I pasted by the moment the small heatsinks, but maybe they will be replaced by bigger/better ones

    As the plant is small, the led lenses arent mounted yet and the plant is over some small bucket

    I think im not doing things very bad if the plant looks so healthy :)

  • Getting stuff done

    niko01/21/2017 at 02:57 0 comments

    Have been working in this stuff all week so some mayor things have been done.

    Also some minor things were bought so, pricelist should be actualized


    -Bought a squared metal stuff to paste the LED lightning system on it, in total 32 x 3W LEDs to speed up plant growth

    -Welded all the connetions and powered it with the LED drivers

    -Added one of the PC fans at top and some heatsinks. Was planning to add 2 of that pc fans but i think with that one and some more heatsinks is enough. Bougth also 12V 1A power connector for the pc fan. Here you can see it in place with the arduino gathering data

    -Here you can see it in action

    ##Arduino and rPi data logger

    Some further advances had also made been on the software part

    I've uploaded the program to : Arduino Plant Bucket Github

    By the moment, the program in the arduino reads all for sensors, and sends the info by serial to the rPi, this one waits for all the data of the row, and inserts it in a previosly created MySql database

    Here you can see it working:

    The programs need further programming as i'm not very happy how the sql data is organized(im a complete sql NOOB).

    Light and fan control and the watering system are not implemented.

    At lest i can try to have an idea of how is the enviroment inside of the bucket graphing the data with

    This is how my first day plot looks like:

    Reference links:

    Transfer Arduino Data to MySQL Database on Raspberry Pi - Youtube - DB Connector


    if somebody got reading until here, thing that i supose will never happen, i am also learning a bit of photography, and did some practice timelapses with my old nikon d40 and gphoto2 and the rPi, about the first days of the Cream caramel plant. Will try to do some more next weeks,

    Here is the unedited result:

  • Wiring update and sensors test

    niko01/12/2017 at 20:28 0 comments

    So after making the Component desglose, i decided to make a clear wiring diagram proposal and creating the arduino program.

    The new general wiring diagram, it's not definitive, will be actualized as needed to mount the project, especially the ports to which the sensors are connected, but starts to look clean and organized.

    For the first part of the program i decided to create the basic functions that will gather data from the sensors, also for testing them, and send that data thru USB serial to the arduino.

    The circuit is showed under, the cutted lines from ground to 5V and between PINs D48 & D49 is because of some fritzing error, they shouldn't be included.

    This is the protoboard mounting:

    DHT22 Data PIN 53 - Blue

    YL-69 Turn on PIN 49 - Yellow

    YL-69 Data PIN A9 - Purple

    LDR Data PIN A8 - Green

    For creating this cricuit i gathered information about them from the net, best info i got from:

    Adafruit - Using a DHTxx sensor

    Read LDR Values on arduino - Luis LLamas (Spanish)

    Using the YL-39/YL-69 Soil himidity sensor with arduino

    And this is the result test program, reads values from the sensor pins and send it thru USB, while is taking measurements, onboard led turns on:

    // Sensor Test Program
    // @date 12/01/16
    // @author Niko Rodriguez
    // Lee DHT22 PIN D53
    // Lee YL-69/YL-38 PIN A9 & D49
    // Lee LDR PIN A8
    // While is taking lectures, onboard led turns on
    // Connects to pc while usb serial
    // For arduino Mega 2560
    // DHT Temperature & Humidity Sensor
    // Written by Tony DiCola for Adafruit Industries
    // Released under an MIT license.
    // Depends on the following Arduino libraries:
    // - Adafruit Unified Sensor Library:
    // - DHT Sensor Library:
    #include <Adafruit_Sensor.h>
    #include <DHT.h>
    #include <DHT_U.h>
    #define DHTPIN            53         // Pin which is connected to the DHT sensor.
    // Uncomment the type of sensor in use:
    //#define DHTTYPE           DHT11     // DHT 11 
    #define DHTTYPE           DHT22     // DHT 22 (AM2302)
    //#define DHTTYPE           DHT21     // DHT 21 (AM2301)
    // See guide for details on sensor wiring and usage:
    DHT_Unified dht(DHTPIN, DHTTYPE);
    uint32_t delayMS;
    // YL-39 + YL-69 humidity sensor
    byte humidity_sensor_pin = A9;
    byte humidity_sensor_vcc = 49;
    int LDR_Pin = A8; //analog pin 0
    //Onboard LED
    int defaultLed = 13;
    void setup() {
      // Init the onboard LED
      pinMode(defaultLed, OUTPUT);
      // Init the humidity sensor board
      pinMode(humidity_sensor_vcc, OUTPUT);
      digitalWrite(humidity_sensor_vcc, LOW);
      // Setup Serial
      // Print temperature sensor details.
      sensor_t sensor;
      Serial.println("-ABP first test program, 12/01/2017-");
      Serial.println("           -Made by Afro33-         ");
      Serial.print  ("Sensor:       "); Serial.println(;
      Serial.print  ("Driver Ver:   "); Serial.println(sensor.version);
      Serial.print  ("Unique ID:    "); Serial.println(sensor.sensor_id);
      Serial.print  ("Max Value:    "); Serial.print(sensor.max_value); Serial.println(" *C");
      Serial.print  ("Min Value:    "); Serial.print(sensor.min_value); Serial.println(" *C");
      Serial.print  ("Resolution:   "); Serial.print(sensor.resolution); Serial.println(" *C");  
      // Print humidity sensor details.
      Serial.print  ("Sensor:       "); Serial.println(;
      Serial.print  ("Driver Ver:   "); Serial.println(sensor.version);
      Serial.print  ("Unique ID:    "); Serial.println(sensor.sensor_id);
      Serial.print  ("Max Value:    "); Serial.print(sensor.max_value); Serial.println("%");
      Serial.print  ("Min Value:    "); Serial.print(sensor.min_value); Serial.println("%");
      Serial.print  ("Resolution:   "); Serial.print(sensor.resolution);...
    Read more »

  • Component Check and Price

    niko01/11/2017 at 15:11 0 comments

    I already bought some of the last things i need to start to build, seed already has germinated so yesterday was put on soil, i want to start taking measurements with the Arduino and Sensors, so before that i decided to make a sum up of everithing i have need and what still i need and to make an estimated cost of the project:

    ##Here is a photo of all i already got:

    ##Fans, Heatsinks and usb cables:

    USB A - MicroUSB (Salvage 2 €)

    USB A - USB B (Salvage 2 €)

    Heatsink GPU (Salvage 5 €?)

    Intel 12V CPU FAN PWN Controlled (Salvage 5 €?)

    Old Salvage 12V with RPM speed hall sensor (Salvage 5 €?)

    2x90mm CPU Fans (Salvage 5 €?)

    Xbox 2x70mm Fans (Salvage 5 €?)

    ##Led Drivers and 3W leds:

    4x Heatsinks (0,60 €)

    1m 220V cable, Conectors, AC power plug, general AC switch (Salvage 2 €)

    2,5-6V Aquarium water pump (3,98 $)

    10x 3W LED Full Espectrum !

    10x 3W LED 445-450 nm ( Far Red) !

    10x 3W LED460-470 nm (Red) !

    10x 3W LED 620-630 nm (Blue) !

    10x 3W LED 660 nm (Royal Blue) V

    2x 36-75V 650 mA LED Driver ! 56,89 € ! <-Total

    ##Sensors :

    AM2302(DHT22) (8,25 €)

    YL-69 with YL-38/YL39 (4,48 €)

    Buzzer (PC Salvage 0,05 €?)

    LDR (Salvage 2 €?)

    Specialized Literature (Optional, Already got it but was like 25 €, very recomedable)

    ##Arduino and Rpi Boards:

    Arduino Mega Clone (10,55 €)

    L293D Arduino Motor Shield(4,04 €)

    4x Arduino Relay Board (5,25 €)

    Half Size Breadboard (1,34 €)

    Heatsink Paste (2 €)

    Thermal Paste (Salvage 6 €)

    Bunch of resistors, NPN Transistor, LEDs... (Salvage 3 €?)

    Also for the interfacing i will use a Rpi Model 3 B with Raspbian (Optional 44 €)

    For which i needed to buy:

    16 Gb MicroSD (Optional 7 €)

    HDMI to VGA (Optional12 €)

    VGA cable (Optional 2 €)

    USB Mouse (Optional 8 €)

    USB Keyboard (Optional 2 €)

    VGA Monitor (Optional 15 € Bargain)

    Hot glue gun (Optional 3 € with glue Bargain)


    90 L Container (18 €)

    7l Soil Container and Soil (3,50 €)

    ##Still needed

    Copper and copper melterer (Optional 5 €, Arrives Monday)

    Some aluminium where put the leds

    Aluminium for Reflecting light


    With Salvage price and withouth optional things : 160,93 €

    Salvage makes me save (in my case): 42,05 €

    Total project cost (discounting salvage): 118,88 €

    LED Lights and drivers: 56,89 €

    Total Project cost without light: 61,99 €

    Rpi with Monitor etc: 90 € (not only for this)

    Book + Optional Tools: 32 €

    Total Price of everithing involved with salvage price discounted: 240,88 €

    Electrical pieces, arduinos, sensors, and shields were bought on ebay and the local shop, LEDs on Amazon.

  • Prototyping the conections

    niko01/08/2017 at 12:53 0 comments

    For the start of this project i have been working on the wiring of what will be the first prototype. It will be a 10 gal bucket with the 3 18x led arrays connected at the top (red) with their 2x fans and heatsink to cool (white) and with 2x 12V fans at top(purple) and 2x at bottom(green) for climate control, to try to achieve the first goals of the project.

    *Thanks to spacebucket community for creating the spacebucket 3d prototyping program, is very helpfull

    The design of the wiring sketch is still not definitive as some questions regarding the wiring are still to be resolved, expecially the protection about high voltage management, sith some fuses maybe needed for general protection and about the wiring of the sensors and the fans and the electrical noise that this could provocate.

    But is a first aproach

View all 6 project logs

Enjoy this project?



Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates