The digital aspects of the circular food economy need software to run them. Much of it has been developed specifically for this project, and in order for others to replicate it elsewhere, there are several components that will be released as open source.
Please note that to make use of the source code, experience in programming and/or software development is required. While the code (for the mobile app and server at least) is thoroughly documented and commented to make using it as easy as possible, it still requires specialised knowledge. It is also not in the scope of this website to teach how to program, so if you wish to learn, you should consult relevant resources.
Mobile app and server
If you are setting up your own school or community compost scheme, and are interested in using this mobile app and server application alongside it, the source code for both is available on this website.
All references to YSSC have been removed from this source code. While the server application’s source code is more or less the same as the actual one used for the school, the mobile app’s source code is set up to be more akin to a template, and shows examples of how all the components can be used. Included with the code are extensive comments to explain the purpose of all the different components. There is also a read-me document for each that lists the included files and what they are for, and how to build and run each application.
This source code is released under the MIT License. This is a permissive licence that allows the code to be used in any way, with the only condition being that the licence included with the code, and our copyright notice, is included in all copies and derivative work. This only covers the code included here: the Node.js packages that the code uses may have different licences, though they all should have an open source license as well.
Links to the source code repository or a direct download of the source code are available on the Resources page.
Sensors
Whichever microcontroller you use, it will have to be programmed to work with the sensors. For example, the Arduino uses either C or C++ code and has its own API for accessing the microcontroller’s functions and any attached sensors.
It is out of the scope of this website to teach how to program a microcomputer, especially since there are several different types. If you wish to use a similar sensor system and don’t know how to use one, there are sources online for working with these devices, such as the documentation on the Arduino website for Arduino.
However, we have included a series of steps below to show the process of installing the necessary programs on your computer and loading the example code onto an Arduino for testing. Note that this code expects the various sensors below to be already connected. The code itself is available on the Resources page – there is a full example for running the Arduino with the methane and temperature sensors, and smaller samples for the moisture or water level sensor.
- Go to the Ardunio website and download the IDE. What version you pick depends on your operating system. After downloading it, if you chose an installer version, install it with the USB driver option selected.
- Open the code through File -> Open and selecting the “Interfacing.ino” file.
- With the Arduino connected to your computer, make sure the settings for the board in the IDE are correct:
- In the Tools menu check that the board appears as one of the items and that it is set to the correct type of Arduino in the submenus.
- Also in the Tools menu, ensure that the correct port is selected.
- If this is a brand new Arduino board, it may need a bootloader. This can be installed using Tools -> Burn Bootloader.
- The preferences for the IDE should be set correctly as well. In File -> Preferences, make sure that:
- “Use external editor” is not checked, and;
- beside “Show verbose output during:”, “compliation” and “upload” are both checked.
- To ensure the code is correct, click the Compile/Verify button – the round button with the tick – at the top of the screen under the menu bar. If the code has errors, they will be shown at the bottom of the screen.
- If there are no errors, click the Upload button – the round button with the arrow – next to the previous button to upload the code to the Arduino.
- If successful, the output console for the selected port should appear, and the Arduino should start sending data for the current methane levels and temperature. You can double check by moving the sensor to a place that has a different methane level or temperature.
While the example code supplied is for use with Arduino, if you wish, you can substitute an alternate microcontroller and code for use with the system. Be aware that we do not have code samples for other platforms, however.
We likewise do not have code for uploading the data collected from the sensors to a cloud data service. In the case of Substation33’s design, they used proprietary code for this purpose, which we cannot redistribute. However, the service you choose will likely have instructions on how to connect to them using a microcomputer.