In the Orto Botanico of Siena there are laboratories focused on the research on some plant species. It is interesting to evaluate the effect of intraspecific competition in terms of growth, germination and the allocation of nutritional resources. At a density of seeds corresponds a certain rate of competition. Increasing competition, the biomass of each plant is reduced: an interesting problem is to generate models that estimates the optimal seeding density that maximizes the biomass.
WHAT DOES IT DO
The project has as its goal the collection of some data from the lab:
- Temperature of the vases and the room
- Moisture in the vases
- Images of the vases to estimate the growth of the samples
HOW DOES IT WORK
The application is composed of two parts: the web interface and background running scripts.
The web interface is used to view the status of the lab. Written in PHP, it runs on any webserver (like nginx or Apache). Since it is web-based, it can be reached from outside the botanic facility, getting out of the box remote control. The web GUI can be also used to configure the webcam settings and export collected data to CSV/Excel.
The background scripts are written in PHP too and scheduled via crontab. They are used to collect data from the sensors, take pictures with the webcam and estimate the plant growt analyzing the colors in the image. All the data collected is stored in a SQLite database.
The temperature and the humidity sensors are connected to the Arduino CPU. In order to get sensors data from PHP I used the UDOO internal serial port connected between the ARM CPU and the Arduino CPU. PHP writes a message asking for, let's say, the temperature, and the reads the value back.
RUN IT ON YOUR UDOO
- Clone the udoo branch of the GitHub repo.
- Flash /orto/arduino/orto/orto.ino using Arduino IDE
- Install some magic:
sudo apt-get install nginx php5-fpm php5-cli php5-sqlite imagemagick fswebcam
- Schedule scripts via crontab:
crontab -e # then paste the contents of /orto/scripts/crontab.dist
-
Configure the webserver:
# paste the following block in /etc/nginx/sites-available/default
server {
listen 80;
root /orto/public;ode>index index.php;
server_name localhost;ode>location / {ode>
try_files $uri $uri/ /index.php;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;ode>fastcgi_index index.php;
fastcgi_index index.php;ode>include fastcgi_params;
}
}ode> - Optional: if you want to use ngrok, install it as a service:
sudo cp /orto/scripts/ngrok.sh.dist /etc/init.d/ngrok
sudo nano /etc/init.d/ngrok
sudo chown root:root /etc/init.d/ngrok
sudo update-rc.d ngrok defaults
sudo update-rc.d ngrok enable
Comments