close-circle
Close
0%
0%

The Compost Professor - A Smart Composting System

A set of senors and actuators that make composting simple.

Similar projects worth following
close
Per the EPA, food scraps & yard waste make up 20-30% of what we throw away, and could be composted instead. Making compost keeps these materials out of landfills, where they release methane, a potent greenhouse gas. This is cause for alarm among global warming scientists because methane emissions warm the planet by more than 20X similar volumes of CO2.

Unfortunately, most do not compost - typically due to ignorance on the benefits of composting, misunderstanding of what can be added to compost, and lack of desire to manage compost.

The Compost Professor is a smart composting system to help anyone compost. The system:
- Monitors compost and automatically takes actions to regulate the compost (add water or air)
- Uses analytics to make recommendations on what to add ("greens", "browns" etc) and when to turn compost
- Tracks when the compost is ready for use
- Supports re-order of materials (charcoal filters, compost activator, etc)

Overview

The Compost Professor is made up of multiple components

  1. Compost Unit - A Smart Compost bin that monitors compost and take actions (hydrates the compost or opens/closes air vents). The Compost Unit takes measurements every hour and send relays measurements (and gets instructions) from the Base unit using radio packets.
  2. Base Unit- Receives data from the Compost Unit and sends the data to Compost Professor Cloud, which analyzes the data and makes recommendations on action needed. Instructions on actions needed (water the compost or open/close the vent) are transmitted from the cloud to the Compost Unit via radio packet
  3. Kitchen Unit - A small touchscreen device that sits in the kitchen and tells the user on actions needed (e.g. - turn the compost bin, add green materials, add brown materials, add compost activator, refill the water reservoir, replace the batteries). The unit is small and is meant to sit on the kitchen counter near the "compost scraps" bin
  4. Compost Professor Cloud - an free-to-use machine learning system that takes input data (compost temperature, compost moisture, weather conditions, sunlight conditions, historical data) to make recommendations on actions to create compost in the shortest amount of time possible.
  5. "Can I Compost" Alexa skill - lets the user asks what materials can be composted. Over time, will integrate with the Compost Professor to make specific recommendations based on the user's compost measurements.

The goal is that the system helps the user quickly create a batch of compost with minimal work. We are also looking to ensure that the compost is created using aerobic processes (with oxygen) versus anaerobic (without oxygen). Anaerobic processing (like landfills) can create higher concentrations of methane gas.

Data Flow

Project Phases

The project will be developed in multiple phases:

Phase 1: Sensor Tests (complete)

  • Proof of concept to validate sensors, output to serial print
  • Arduino 101 for Satellite System
  • Raspberry Pi for Base Station

Phase 2: Proof of Concept against small batch of compost (complete)

  • use LoRa radio to communicate readings between Satellite and Base System
  • Data stored in SQLite database
  • Initial dashboard with simple analytics

Phase 3: Prototype v2 (complete; feedback incorporated into Phase 4)

  • Base System - move from Raspberry Pi to Intel Edison and add warning indicators
  • Move from breadboard to soldering
  • Improved dashboard and analytics
  • Improved sensors
  • Add solar power

Phase 4: Prototype v3 (target completion - Oct 20)

  • Make system more "stand alone" (feedback was that the v2 required too much work to configure and install)
  • Incorporate components into Compost Tumbler
  • Tune devices for less power consumption/deep sleep
  • Build GUI for compost data
  • Build better analysis system (move to AWS in order to leverage server-less and machine learning modules)

Phase 5: Build MVP and Website (Dec 2017)

  • Move from retail products to custom built PCBs
  • Determine manufacturing options for compost bin
  •  Create website with registration for free use for cloud/APIs
  • Create order process to replenish consumables (carbon filters, compost activator, wood pellets). See Business Case for more details.

Running List of Requirements, Enhancements & Improvements

Open:

  1. Build motor to automatically turn compost (added 10/12/2017)
  2. Consider using Radio Packets versus Wifi for Kitchen sensor (as of right now, RFM69 library conflicts with TFT library). If change is made, this increases battery life of Kitchen Unit
  3. Add Website - Unit Registration and Ordering capability
  4. Add Registration process for free unit of APIs
  5. Determine best model for creation/manufacture of compost bin

Complete:

  1. Soil moisture sensor not robust enough - switch to combined temperature and moisture sensor probe (ETC - Phase 3) [use a corrosion resistant moisture sensor) - DONE
  2. BLE not suitable for communication between devices, switch to LORA or radio packets (ETC - Phase 2) - DONE
  3. Ambient temperature should factor into analytics (ETC - Phase 3) - DONE, but...
Read more »

currentReadings.php

Draft version of the PHP file that reads the SQLite database and creates a JSON object for the dashboard measurements.

php - 1.23 kB - 06/03/2017 at 19:09

download-circle
Download

dashboard5.html

Draft version of the dashboard

HyperText Markup Language (HTML) - 7.27 kB - 06/03/2017 at 19:08

download-circle
Download

satellite_sensor_prototype_code.txt

Arduino sketch for the prototype

plain - 7.15 kB - 06/03/2017 at 02:37

download-circle
Download

SatelliteSensorFlow.jpg

The Logic for the Satellite Sensor

JPEG Image - 75.01 kB - 06/03/2017 at 02:29

eye
Preview
download-circle
Download

  • 2 × Adafruit Huzzah Feather Needed for Base Unit and Kitchen Unit
  • 1 × Adafruit RFM69 32u4 Feather Needed for Compost Unit
  • 1 × Compost Unit 3D prints see GitHub for STl files
  • 1 × Compost Bin any large compost tumbler will do.
  • 1 × Base unit case see GitHub for STL files

View all 37 components

  • Creating a New User Interface

    Darian Johnson10/01/2017 at 05:34 0 comments

      Oct 1, 2017

      Version 2 of Compost Professor used a web-based GUI to inform users of the status of their compost, and actions they needed to take. I initially planned to make the GUI a phone application that would provide information via Bluetooth... however, based on my own experiences, I went a different direction.

      In my house, my kids are responsible for putting our kitchen scraps into the compost bin (it's one of their chores). I can barely get them to do their chores... there was NO WAY that they were going to look at a phone app to determine if they should add "green", water the compost, or stir the compost. 

      So I went with a battery powered "kitchen" unit that provides explicit directions on the screen.

      There are still a few things to work out:

      1. The voltage divider that I use to read the battery status slowly drains the battery. I added a capacitor is series with one of the voltage divider sensors (as recommended on another site), but I don't think it's going to do. Ultimately I think I'll use a transistor to turn "on/off" the voltage divider
      2. I'm using an ESP8266 - primary because of the low cost. I'm thinking of switching to sending data via radio packets (to the "base hub, which has internet and RFM69 capability). I believe this will help with battery management as well.
      3. I put the ESP8266 into deep sleep, but that means it's about 3 seconds to "wake-up" the device. Might not seem like a long time, but it is when you're standing at the counter waiting to take scraps outside after dinner.
      4. The TFT screen back-light stays on even when the ESP8266 is asleep. There weren't great options to deal with that on the prototype TFT screen I am using. Other TFTs require a pin to pull HIGH for the back light to turn on... this would resolve the problem.

  • Starting Final Prototype Build

    Darian Johnson09/26/2017 at 03:44 0 comments

    Sept 25 2017

    Been a while since I last wrote a log... I've successfully ported the code from Arduino 101 to ESP8266 and ATMega32u4 bases. I'm using Adafruit feathers for the prototypes. These are great boards for prototyping:

    • They have feathers/wing for multiple chip types and functions  (I've played with the ESP8266, ATMega and M0 Cortex models, with "add ons" for RFM69 packets and TFT screens)
    • VCC is 3.3 V - this restricts some sensors (namely gas sensors). I'm ok with the trade off, as it reduces battery consumption.
    • There's a wealth of documentation available.

    It hasn't been perfect, there are some challenges - specifically, I struggled to get the RFM and TFT components to work together (though this isn't because of the Adafruit construction - it's due to the way the RFM libraries are written).

    I've also started to design and print the cases for the components (building on the files provided by Adafruit).

  • Major Changes to the MVP

    Darian Johnson08/30/2017 at 03:50 0 comments

      August 29, 2017

      I've started work on the new prototype. Key changes:

      1. Moving from Arduino 101 board to Adafruit Feathers (RFM and ESP8266). The feathers (and their associated wings) have a smaller form factor and lower power requirements (3.3v v 5.0 volts).
      2. Adding a physical compost bin
      3. Adding a physical display (a TFT screen). I may still use a web app/bluetooth phone app, but I thought seeing the feedback as easy as possible made the most sense.

  • MVP - Solar Powered Smart Compost System

    Darian Johnson08/14/2017 at 21:59 0 comments

    Aug 14 2017 -


    It's been a busy few months since my last log. I've updated the solution as follows:

    • communication between devices using radio packets
    • solution waterproof and solar powered
    • solution integrated into Alexa skill
    • solution notifies users of status via a kitchen compost bin

    The good news is that I've tested the logic and feel comfortable with the analysis algorithm. 

    The bad (or good, depending on the point of view) is that the solution still requires work:

    • I originally designed the solution as an "add-on" to an existing compost bin. Based on user feedback, I need to create an "all-encompassing solution", which includes an outdoor compost bin
    • I am unable to power the entire solution (servo, Arduino, and pump) with one rechargeable battery. 

    I'm in the process of making design changes, now. The goal is to have a more robust prototype available for testing by early September.

  • Analyze Sensors and Take Action Code

    Darian Johnson06/11/2017 at 05:10 0 comments

      6/11/2017 -

      I am still waiting for my LoRa sensors to arrive; in the meantime, I've started writing the logic that will interpret the sensor data. This code will run on the base station. The flow is:

      1. Base station requests sensor data
      2. Satellite station returns sensor values
      3. Base station interprets data and sends commands to satellite station
      4. Satellite station takes requested action (water compost, open vent, etc)
      5. Base station saves sensor data to database
      6. Base station saves UI data (warning colors, messages) to database for easy retrieval

      The first pass of the code is below:

      from datetime import timedelta, datetime
      import json
      
      def main:
          # TODO implement
          #return 'Hello from Lambda'
          
          tempMessageArray = [
              "Your compost is at optimal levels.", #0
              "Your compost is ready for use. At your convenience, move your sensors to a new compost pile/layer.", #1
              "Your compost heating cycle is complete and is in a 'curing stage'.", #2
              "Your compost has reached an unsafe temperature. Immediately turn the compost and add water.", #3
              "Your compost has reached unhealthily temperature. At your convenience, turn compost and add 'brown' (Carbon-rich) materials.", #4
              "Your compost temperature is slightly higher than optimal. You may want to turn the compost and add 'brown' materials.", #5
              "Your compost temperature is slightly higher than optimal, but is staring to cool off. I will let you know if any action is required.", #6
              "Your compost is at optimal temperature.", #7
              "Your compost temperature is slightly lower than optimal, but is staring to warm up. I will let you know if any action is required.", #8
              "Your compost temperature is slightly lower than optimal, and is continuing to cool. At your convenience, turn compost and add 'green' (Nitrogen-rich) materials.", #9
              "Your compost temperature is slightly lower than optimal, and is continuing to cool. The ambient temperature is low, so you should cover your compost to continue aerobic composting." #10
              ]
              
          moistureMessageArray = [
              "Your compost moisture content is too high. Turn your compost and add 'green' (Nitrogen-rich) materials.", #0
              "Your compost moisture content is too high but is starting to dry out. I will let you know if any action is required.", #1
              "Your compost is at optimal moisture levels.", #2
              "Your compost moisture content is too dry, but is starting to reach optimal moisture. I will let you know if any action is required.", #3
              "Your compost  is too dry and requires your attention. You need to turn and water your compost." #4
              ]
          
          #warnings
          success = "alert alert-success"
          info = "alert alert-info"
          warning = "alert alert-warning"
          danger = "alert alert-danger"
      
          #Limits
          tempDanger = 175
          tempHigh = 160
          tempOK = 140
          tempLow = 90
          moistHigh = 60
          moistLow = 40
          
          #get inputs for analysis
          sensorDataJSON = getSensorData()
          trendDataJSON = getTrendData()
          days = handleDateLogic()
          
          #set variables
          tempF = sensorDataJSON["tempF"]
          tempC = sensorDataJSON["tempC"]
          moisture = sensorDataJSON["moisture"]
          methane = sensorDataJSON["methane"]
          waterLevel = sensorDataJSON["waterLevel"]
          ambientTemp = sensorDataJSON["ambientTemp"]
          
          tempTrend = trendDataJSON['tempTrend']
          moistTrend = trendDataJSON['moistTrend']
              
          tempAlert = info
          moistAlert = info
          methaneAlert = info
          waterLevelAlert = info
          OverallMsg = tempMessageArray[0]
          msgPriority = 3 #1 = trumps all other actions, #2 additive
          
          if days > 35:
              OverallMsg = tempMessageArray[1]
              
          elif days > 25:
              OverallMsg = tempMessageArray[2]
              
          else: # the compost is not ready
          
              ################################################################
              #Handle Temperatures
              if tempF > tempDanger:
                  addWater()
                  openVent()
                  tempAlert = danger
                  OverallMsg = tempMessageArray[3]
                  msgPriority = 1
                  
              elif tempDanger >= tempF > tempHigh:
                  addWater()
                  openVent()
                  tempAlert = danger
                  OverallMsg = tempMessageArray[4]
                  msgPriority = 1
                  
              elif tempHigh >= tempF > tempOK:
      
                  if tempTrend < 1:
                      openVent()
                      tempAlert = warning
                      OverallMsg = tempMessageArray[5...
    Read more »

  • Logic/Alerts/Actions based on Temperature and Moisture readings

    Darian Johnson06/09/2017 at 03:16 0 comments

    6/8/2017 -

    I am in the process of writing the logic that drives alerts and actuators (water pump and vent open/close). I've create a few tables that will help me to write the AI.

    Temperature Logic

    Moisture Logic

  • Art of the Possible with Alexa

    Darian Johnson06/05/2017 at 13:33 0 comments

    6/5/2017 -

    I created a simple Alexa skill that tells a user if an item can be composted.... I wanted to extend this functionality into a "bolt on" Alexa skill for the Smart Compost System. The Alexa skill would integrate with the Smart Compost data to tell the user recommendations specific to his/her needed. For example, if the oxygen flow was too high (not enough carbon), then the user would be directed to add items like grass clippings, leaves, newspapers instead of fruit or vegetable scraps.

    Video below is a demo of the skill...

    You can read more about it (and get the source code) here: https://www.hackster.io/darian-johnson/compost-helper-alexa-skill-51d52e

  • Smart Compost Dashboard

    Darian Johnson06/03/2017 at 19:08 0 comments

    6/3/2017 -

    I am in the process of creating a dashboard for the Compost System. The version is still very much in the early stages, but will share what I have created to date:

    • The gauge shows the number of days until the compost is ready (25 days at greater that 110 degrees F).
    • The sensor indicators are red, yellow, and green based on the state of the sensor
    • The actions panel shows the interpretation of the data, and the actions the user must take. This also has a red, yellow, and green indicator.

    The dashboard is written in HTML/Javascript, leveraging:

    • Bootstrap
    • JustGage.js
    • icons from Freepik

    The data is stored in a SQLite database. The data is retrieved by making a http call to an php.file (see code in attachments section for details).

    Right now, the actions are hard coded into the HTML; I am still in the process of writing the logic for determining when a particular action needs to take place. For example, if the temperature is low, but the ambient temperature is low as well, then we would want to wait 5-10 hours to determine if the temperature rises before asking the user to take more corrective actions (e.g. stirring the compost or adding more nitrogen-rich materials).

  • My First Prototype (outside of soil)

    Darian Johnson06/02/2017 at 22:43 0 comments

      June 2 2017 -

      I've assembled the sensors and actuators into a bird's nest of wires... but, it works fine for a prototype. The attached video shows how the assembled prototype will work (I wanted to show the components before I added them into the composting soil).

      A few notes:

      1. I originally planned to use a solenoid and use gravity to water the compost, but ultimately decided on a pump.
      2. I have a difficult time calculating % humidity using the moisture sensor (there isn't a great correlation between the voltage out of the sensor to the % wetness of the soil). I'm looking into using a better sensor that (a) outputs % moisture and (b) is more robust (this sensor would only last a few months) [I'll probably use this sensor - https://www.amazon.com/Adafruit-Accessories-Temperature-Moisture-Sensor/dp/B00XW2NXD4]
      3. I am using an ultrasonic sensor for the prototype, but plant to switch to a "dumb" float sensor (I don't need to know levels - just dry or not dry]
      4. I was originally using Bluetooth LE to send data from Arduino to a Raspberry Pi - but decided to remove that logic and go with LoRa instead. Devices are in the mail now... hope to show that interaction later this month.

      Last note - here's a simple process flow that outlines the logic.

  • Prototype Sensors Received

    Darian Johnson05/28/2017 at 12:59 0 comments

    5/27/2017 -

    I got my first set of sensors in the mail. At a high level, my though process is:

    • Temperature sensor to measure compost - healthy compost must reach a temperature of 140 F for 20-25 days
    • Moisture sensor - compost should be 40-60% moist
    • Methane Sensor - a high PPM reading would indicate that the compost is in an anaerobic cycle (similar to a landfill)

    I also have a few actuators

    • solenoid valve to support gravity drip of water (if moisture is below 40%)
    • servo - to open/close a vent to a perforated pipe embedded in the compost (to support additional oxygen and air flow

    Finally, I am using a Arduino 101 as the micro-controller for the sensors and actuators. I will use a Raspberry Pi to persist the data and make it available in a web page. I'll use BLE for communication between to the for the prototype (will need to move to LoRa for the final product.

View all 11 project logs

  • 1
    Assemble Water Reservoir


    Components Needed:

    • Slimline Beverage Container

    Arrow Home Products 00744 Slimline Beverage Container, 2.5-Gallon, Clear

    • Water Float
    • Water Pump (note - you will use the same power source to power the microprocessor and the pump. Therefore, the pump needs to be able to operate at a low voltage). 

    • Gorilla Glue
    • Silicone adhesive
    • Water Reservoir Case and Cap 3D prints
    • Reservoir Spigot 3D print
    • Hose Cap 3D print
    • Plastic Bottle top
    • 1.5 inch Inner diameter Spa Hose (1 foot)
    • 3/8 inner diameter Vinyl Hose 5 feet
    • Exopy

    Prep-work

    1. Remove the top and spigot from the beverage container. 
    2. Extend the length of the cables to 4-6 feet. Note - Because these components will be in water, ensure that the original cables connected to the Water Pump and Float are long enough to clear the reservoir. If they are not long enough, then you will need to waterproof the connections when lengthening the cable.

    Water Float

    1. Screw the Water Float into the Water Float Cap
    2. Secure the Water Float Cap to the Water Float Case with glue.
    3. Once the cap is dry, add glue to the bottom of the Float Case and lower the case into the Water Reservoir.

    Water Pump

    1. Attach a hose to the pump and secure with glue or a clamp 
    2. Insert the hose and the pump wires through the Reservoir Cap
    3. Insert the pump into the spigot opening and screw the Reservoir Cap in place with the original spigot screw ring
    4. Use silicone adhesives around the opening and Reservoir Cap. When dry, apply glue.

    Assemble Water Reservoir

    1. Insert the flow cap into the vinyl hose and secure with glue
    2. Drill holes approximately 2 inches apart into both sides of the vinyl hole. Start with smaller holes closer to the pump and larger holes towards the end.
    3. Drill an 1/2 in holi into the larger beverage case top and insert the Spa Hose
    4. Secure the case top with silicone and glue.

    Install Water Reservoir

    1. Place the water reservoir into the bin and mark where the hose meets the top and where the reservoir is flush with the bin. Remove the reservoir.
    2. Drill a 1/2 in hole where the hose meets the top.
    3. Mix a small batch of epoxy and apply the epoxy to the inside of the bin where it reservoir will sit.
    4. Place the reservoir on the epoxy and weigh down the reservoir with books until the epoxy dries.
    5. Once the epoxy dries, insert the Reservoir Spigot (the 3D printed object) into the hole.
    6. Attach the Spa hose around the spigot and glue all pieces with epoxy.
    7. When dry, screw a plastic bottle top to the spigot.
    8. Arrange the vinyl hose (e.g. the "watering hose, with the holes") along the length of the center beam and attach with cable ties.
    1. 2
      Purchase and Assemble a Compost Bin

      For prototyping purposes, I purchased the following bin on Amazon (https://www.amazon.com/Yimby-Tumbler-Composter-Color-Black/dp/B009378AG).

      When assembling the bin, I did not add the divider. In addition, I assembled all parts except one of the ends and the bin door.

    2. 3
      Assemble all Feather and and Wings

      Following the instructions on Adafruit, assemble the feathers

      Kitchen Unit:

      • Use Huzzah Feather and TFT featherwing; regular headers are fine here (you may need to trim them to fit flush against the TFT)

      Adafruit Huzzah (ESP8266)

      Adafruit Feather HUZZAH with ESP8266 WiFi - with or without headers

      Adafruit TFT Featherwing

      TFT FeatherWing - 2.4


      Base Unit:

      • Huzzah and RFM69HCW Feather. Use short stacking headers for the Huzzah.
      • Note - be sure to choose the correct freuqency for your location (815 - Europe, 900 Americas, 433 - Asia)

      Adafruit Radio FeatherWing - RFM69HCW 900MHz - RadioFruit

      Adafruit Radio FeatherWing - RFM69HCW 900MHz - RadioFruit

      Compost Unit

      • 32u4 Feather with RFM69 and Proto wing; short stacking headers are suitable here as well.

      Adafruit Feather 32u4 RFM69HCW Packet Radio - 868 or 915 MHz - RadioFruit

      Adafruit Feather 32u4 RFM69HCW Packet Radio - 868 or 915 MHz - RadioFruit

      FeatherWing Proto -

      FeatherWing Proto - Prototyping Add-on For All Feather Boards

    View all 11 instructions

    Enjoy this project?

    Share

    Discussions

    Valeryprogrammation wrote 08/25/2017 at 13:28 point

    I've made a copy all the material I could take here on a facebook page.

    https://www.facebook.com/CSI-Syst%C3%A8me-Composteur-Intelligent-531790463824939/
    I hope I can make a similar project, borrowing this one.
    And I will try to pair the project with a local fablab I'm working with.
    I will obviously keep you in touch with my progress.
    Thank you

      Are you sure? yes | no

    Similar Projects

    Does this project spark your interest?

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