Close
0%
0%

Bin Temperature Monitoring System

A grain monitoring system that will cost 200 to 300 CAD instead of 5000 CAD. Also open source instead of closed source.

Similar projects worth following
This project is meant to create a low-cost solution for small to medium-sized farmers who want to monitor their grain while it is in the bin. Currently, there is a solution that is on the market, but it costs roughly $5000, and it is closed source. All that these smaller farmers need is a couple of temperature sensors that can operate in the bin and a notification when something goes wrong. According to my calculations, the materials for this do not cost more than $300.

The temperature of the grain is critical because if the temperature starts rising the grain may spoil, and the farmer will lose money.

The current strategy is to use the Arduino MKR 1400 to control three DHT 22 sensors to collect temperature information from the bin. The sensors then send the data to the cloud where the farmer can look and see if the grain is heating. Eventually, a webhook will be added so that an alert is sent out if the grain starts heating

arduino_dht11_diagram.pdf

wiring diagram

Adobe Portable Document Format - 24.82 kB - 02/28/2021 at 00:53

Preview
Download

View all 7 components

  • Update to the Instructions and Materials

    Kody Alan Rogers02/28/2021 at 01:19 0 comments

    I have updated the instructions and the materials list. I know it needs a lot of work, and probably next weekend I'll add more detailed instructions and photos.

  • Major Updates Needed

    Kody Alan Rogers02/28/2021 at 00:23 0 comments

    So the project has changed significantly since I last updated this page. I'll list the major news below:

    1. The wooden box is no longer being used and instead, a waterproof junction box is being used. In particular, this one from Amazon is being used: https://www.amazon.ca/gp/product/B075DJQJVY/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1. I made this change since the wooden box was never really a good option, and it fried the Arduino I had inside.
    2. The project is no using the Arduino cloud to monitor the grain and that code can be seen here: https://github.com/PhysicsUofRAUI/binTempSensor/tree/master/code/ArduinoCloud. I will be adding more code there and eventually will be adding a webhook so that an alert is sent if the grain starts heating
    3. A different sensor might be used. The DS18B20 is the sensor that might be used instead and that is because it is waterproof, cheaper, and all three can be wired on one wire. Given that it has not been tested yet I may only deploy it in a few of the bins.
    4. It is up and running and has been for several months now so that is great!

  • Operating in a bin

    Kody Alan Rogers09/28/2020 at 17:36 0 comments

    The set up is currently collecting data from within a bin filled with canola. It is operating as expected, and I will continue to monitor the temperature variations so that I can best decide when a text alert should be sent out.

    For the most part the project is done and working!

    Later, could be awhile, I will give a more descriptive update and more in depth instructions of how to build.

  • Not Working in low temperatures

    Kody Alan Rogers11/20/2019 at 01:30 0 comments

    Hey.

    So I put the current build outside to see how long it would run for in the cold weather. 

    I did not do good. It sent me the first message but then six hours later (what I had set it to send the temperature at) there was silence. 

    I think it is a combination of the battery not being charged very much before and that the battery does not like the cold weather.

    The next update will be switching gears a bit. I will be constructing a 40 foot usb cable to power the arduino off of (this will replace the solar panel and the battery), and then I will put it and the sensors into operation in an empty bin. This will be the first iteration of tests that will be done on a wired version. 

    The wired version is being further pursued at this point because it will be cheaper and will operate at the low temperatures better. 

    A bit off topic, but a contest where a friend and mine were going to present this project has been postponed till March or April.

    Cheers,

  • We are outside wherever now!

    Kody Alan Rogers11/11/2019 at 02:13 0 comments

    Hey!

    I have made an enclosure for the Arduino. Before this enclosure I just left the Arduino in a BBQ to see how long it would work on the solar panel. I also am using a more powerful solar panel. Right now I am mostly testing whether or not the poor battery will freeze in the cold even though it is inside an enclosure (does the Arduino dissipate enough power to keep it warm). My guess is it will freeze. 

    Cheers,

  • The project has went Solar!

    Kody Alan Rogers09/01/2019 at 02:58 0 comments

    Hey!

    I have the BinTempSensor inside the BBQ at home right now attached to a solar panel. Attaching a solar panel is an important step because it is needed to keep the project off the grid and able to be used in any bin. 

    It has been running for almost 3 days now and when it was running only on battery it only lasted two days at most. I have been checking it during the day and it seems to get fully charged (the battery) around noon each day. I would consider it a success.

    The next steps are:

    1. Make an enclosure for the Arduino: made of wood at first, but likely will be a 3D printable enclosure in the end
    2. Move the temperature sensors off of the breadboard onto wires and eventually those wires will be wrapped around a rope or cable that will be dropped into the bin.
    3. The final step for this version will be adding a heating mechanism inside the enclosure (I'm from Canada and it gets cold here). Right now it is planned to be a separate circuit that will be switched on and off by the Arduino.

    I am hoping to list step by step instructions to build the device to the point it is within the next week, but harvest and the new semester are starting so it may not be for a bit longer. For now the instructable I wrote a while back has the set up with the battery and I'll give a bit of a blurb below of how to extend it.

    Instructable: https://www.instructables.com/id/Remote-Temperature-Sensing/

    Next steps are:

    1. Buy the needed supplies: solar panel charging kit, the solar panel, DC jack adapter, and an extra battery is also needed
    2. Cut the wires off the extra battery (we need them)
    3. Now solder the wires from the extra battery to the wires from the charging kit
    4. Plug the battery into the charging port of the solar panel charger
    5. Take one end of the wires that were soldered together and plug it into the load end of the solar panel charger
    6. Plug the other end of the soldered wires into the Arduino
    7. Plug the solar panel into the DC jack of the solar panel charger

    Remember that the set up should be placed in a rain proof, but not water proof, enclosure to ensure that water does not mess things up.

    Sorry for such a brief description I promise that within a month I will have better instructions (hopefully within a week!), but I thought it be good to give an update of where things are at.

    Thanks for reading!

View all 6 project logs

  • 1
    Wire the cable

    I have attached a wiring diagram showing the Arduino Uno instead of the Arduino MKR 1400, and the DHT 11 sensor instead of the AM2302 sensor. I hope it gives people some idea while I work to create a proper schematic. The capacitor shown in the schematic was placed close to the controller, but you can try different placements.


    Placing the sensors is more tricky than just making a good schematic since some people's bins are different from others. In my case, I started at the end of the wire and then added the other two sensors 7ft apart from each other.

    The AM2302 datasheet can be found here and it is likely useful for wiring it up yourself: https://cdn-shop.adafruit.com/datasheets/Digital+humidity+and+temperature+sensor+AM2302.pdf.

    I have also have a half-completed tutorial on how to make the temperature cable that can be found here: https://github.com/PhysicsUofRAUI/binTempSensor/blob/master/how_to_docs/build_temp_cable.md.

  • 2
    Upload the Code
    /* 
      Sketch generated by the Arduino IoT Cloud Thing "Bin One"
      https://create.arduino.cc/cloud/things/acdff5db-845e-42f4-851d-6b8367a3c258 
    
      Arduino IoT Cloud Variables description
    
      The following variables are automatically generated and updated when changes are made to the Thing
    
      float temperature1;
      float temperature3;
      float temperature2;
    
      Variables which are marked as READ/WRITE in the Cloud Thing will also have functions
      which are called when their values are changed from the Dashboard.
      These functions are generated with the Thing and added at the end of this sketch.
    */
    
    #include "thingProperties.h"
    #include <DHT.h>
    #include <DHT_U.h>
    #include <Adafruit_Sensor.h>
    
    // everything to control the sensors
    #define DHTPIN1            5
    #define DHTPIN2            4
    #define DHTPIN3            6
    
    #define DHTTYPE           DHT22
    
    DHT_Unified dht1(DHTPIN1, DHTTYPE);
    DHT_Unified dht2(DHTPIN2, DHTTYPE);
    DHT_Unified dht3(DHTPIN3, DHTTYPE);
    
    unsigned long count;
    
    int resetPin = 1;
    
    void setup() {
      digitalWrite(resetPin, HIGH);
      pinMode(resetPin, OUTPUT); 
      
      // Initialize serial and wait for port to open:
      Serial.begin(9600);
      // This delay gives the chance to wait for a Serial Monitor without blocking if none is found
      delay(1500); 
    
      // Defined in thingProperties.h
      initProperties();
    
      // Connect to Arduino IoT Cloud
      ArduinoCloud.begin(ArduinoIoTPreferredConnection);
      
      ArduinoCloud.addCallback(ArduinoIoTCloudEvent::DISCONNECT, doThisOnDisconnect);
      /*
         The following function allows you to obtain more information
         related to the state of network and IoT Cloud connection and errors
         the higher number the more granular information you’ll get.
         The default is 0 (only errors).
         Maximum is 4
     */
      setDebugMessageLevel(2);
      ArduinoCloud.printDebugInfo();
      
      dht1.begin();
      dht2.begin();
      dht3.begin();
    
      sensor_t sensor;
      
      count = 0;
    }
    
    
    void loop() {
      delay(500);
      ArduinoCloud.update();
      // Your code here 
      
      if (count < millis()){
        // Get temperature event
        sensors_event_t event1;
        dht1.temperature().getEvent(&event1);
        
        if (isnan(event1.temperature)) {
          temperature1 = -100.0;
        }
        else {
          temperature1 = event1.temperature;
        }
        
        // Get temperature event
        sensors_event_t event2;
        dht2.temperature().getEvent(&event2);
        
        if (isnan(event2.temperature)) {
          temperature2 = -100.0;
        }
        else {
          temperature2 = event2.temperature;
        }
        
        // Get temperature event
        sensors_event_t event3;
        dht3.temperature().getEvent(&event3);
        
        if (isnan(event3.temperature)) {
          temperature3 = -100.0;
        }
        else {
          temperature3 = event3.temperature;
        }
        
        count = millis() + 900000;
      }
    }
    
    void doThisOnDisconnect(){
      /* add your custom code here */
      Serial.println("Board disconnected from Arduino IoT Cloud");
      
      delay(60000);
      
      digitalWrite(resetPin, LOW);
    }

     The above code is called one_bin.ino and it is the main code.

    The code below is defining the 'thing properties'.

    /// Code generated by Arduino IoT Cloud, DO NOT EDIT.
    
    #include <ArduinoIoTCloud.h>
    #include <Arduino_ConnectionHandler.h>
    
    
    const char THING_ID[]      = "acdff5db-845e-42f4-851d-6b8367a3c258";
    
    const char GPRS_APN[]      = SECRET_APN;
    const char PINNUMBER[]     = SECRET_PIN;
    const char GPRS_LOGIN[]    = SECRET_USERNAME;
    const char GPRS_PASSWORD[] = SECRET_PASSWORD;
    
    
    float temperature1;
    float temperature3;
    float temperature2;
    
    void initProperties(){
    
      ArduinoCloud.setThingId(THING_ID);
      ArduinoCloud.addProperty(temperature1, READ, ON_CHANGE, NULL);
      ArduinoCloud.addProperty(temperature3, READ, ON_CHANGE, NULL);
      ArduinoCloud.addProperty(temperature2, READ, ON_CHANGE, NULL);
    
    }
    
    GSMConnectionHandler ArduinoIoTPreferredConnection(PINNUMBER, GPRS_APN, GPRS_LOGIN, GPRS_PASSWORD);

    Your code on the Arduino cloud platform should look like this when you upload it to the board. For instructions on how to upload it to the board please look at this introduction to the Arduino Cloud: https://www.arduino.cc/en/Tutorial/iot-cloud-getting-started.


    The three cloud variables needed are three floats that are called temperature1, temperature2, and temperature3. All three are set to update on change.

  • 3
    Place the cable in the bin

    Go up to the top of the bin and drop the cable into the bin. I used a piece of air seeder hose to keep the wire from rubbing against the opening.

View all 4 instructions

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

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