Get blueprints to build your own bin or monitor mine

About the Smart Wormbin


The smartWormbin combines open hardware as well as open software. The construction plan of the box can be found below, also a schematic for the Arduino construction as well as the corresponding code can be found on this page.
All data I collected so far can be downloaded as a .csv file. I would be very happy about visualization/evaluation of my data.

Use my materials and build your own smartWormbin!

Smiley face

Data Visualization

Download the .json or .csv file and get creative




Blueprint

Get all the materials and tools together and start building your own wormbin

Materials

2 x Wood panel, cm x cm, x 1.5 cm

2 x Wood panel, cm x cm x 1.5 cm

2 x Wood panel, cm x cm x 2 cm

16 x Wooden strip (ca 15 cm x 3 cm x 3 cm)

1 x Aviary mesh

2 x Furniture hinge

Min 80 x Wood screw

500 x Compostworm

Tools

Drill

(Electric) Screwdriver

Stapler

(Optional) Angle grinder

 

 

 

 

Augmentation

Arduino UNO

DHT11 / DHT22 Sensor

iHaospace Soil Moisture Sensor

HC-05 Bluetooth module

Wires, Resistors, Power supply

 

 

 

Arduino Schematic




Arduino Code


            /*
            IoT SmartWormbin
            HBKsaar OMTWGR
            Read humidity and temperature of DHT11 sensor
            Read soil moisture of iHaospace
            Send values over serial port
                      
            @author Simon Engel
            @version 0
          */
                      
          #include "DHT.h"          //load DHT library
          #include 
          #define DHTPIN 2          //DHT sensor on pin 2
          #define DHTTYPE DHT11     //DHT11 as DHTTYPE
          
          DHT dht(DHTPIN, DHTTYPE); //call sensor by 'dht'
          SoftwareSerial Bluetooth(10, 11); //instantiate Serial
          float oldHumidity = 0;
          float oldTemperature = 0;
          float oldSoilMoisture = 0;
          
          void setup() {
           Serial.begin(9600);
           Bluetooth.begin(9600);
           dht.begin();            //start DHT11 sensor
          }
          
          void loop() { 
            delay(2000);
            float humidity = dht.readHumidity(); 
                      
            float temperature = dht.readTemperature();
                      
            float soilMoisture = analogRead(A0);
          
            if(oldTemperature - temperature < - 1 || oldTemperature - temperature > 1 ||
               oldHumidity - humidity < - 3 || oldHumidity - humidity > 3 ||
               oldSoilMoisture - soilMoisture < -30 || oldSoilMoisture - soilMoisture > 30 
            ){
            
            Bluetooth.println(humidity);//send values over serial port
            Bluetooth.println(temperature);
            Bluetooth.println(soilMoisture);
          
            oldHumidity = humidity;
            oldTemperature = temperature; 
            oldSoilMoisture = soilMoisture;
            }
                      
           }
          
          

Python serial port reader


""" 
   IoT SmartWormbin
   HBKsaar OMTWGR
   Listen to serial port rfcomm0 and write data to csv file
                
   @author Simon Engel
   @version 0
"""
            
import serial, time, csv        #import necessary modules
ser = serial.Serial('dev/rfcomm0')     #Bluetooth binded to rfcomm0 (may vary)
ser.flushInput()
                
while True:
  try:
    humidity = ser.readline()   #read humidity, temperature and moisture
    temperature = ser.readline()
    moisture = ser.readline()
                
    #decode ASCII value, cast to string, remove whitespace using strip
    humidity = str(humidity.decode('ASCII')).strip()
    temperature = str(temperature.decode('ASCII')).strip()
    moisture =str(moisture.decode('ASCII')).strip()
                
    print(humidity)             #printing values for terminal use
    print(temperature)
    print(moisture)
                
    #create timestamp
    localtime = time.asctime(time.localtime(time.time())) 
                
    #create smartWormbin.csv and append data
    with open("smartWormbin.csv", "a", newline='') as f:
      writer = csv.writer(f, delimiter=",")
      writer.writerow([localtime, humidity,temperature,moisture])
  except:
    print("Keyboard Interrupt")
    break

CONTACT

Openness makes the world go round!